Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add VirtualServer custom template support #1036

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
PR feedback
  • Loading branch information
Dean-Coakley committed Jul 6, 2020
commit c6515415a3d152eec350ec3846b958c2fbdeb011
2 changes: 1 addition & 1 deletion examples-of-custom-resources/custom-templates/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Custom Templates

The Ingress Controller uses templates to generate NGINX configuration for VirtualServer resources and the main NGINX configuration file. You can customize the templates and apply them via the ConfigMap. See the [corresponding example](../../examples/custom-templates/README.md).
The Ingress Controller uses a template to generate NGINX configuration for VirtualServer resources. You can customize the template and apply it via the ConfigMap. See the [combined custom templates](../../examples/custom-templates/README.md) example, which shows how to customize the template for the VirtualServer resource as well as the other templates used by the Ingress Controller.
17 changes: 1 addition & 16 deletions examples/custom-templates/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The Ingress controller allows you to customize your templates through a [ConfigM
* `ingress-template` - Sets the Ingress NGINX configuration template for an Ingress resource.
* `virtualserver-template` - Sets the NGINX configuration template for an VirtualServer resource.

## Ingress Example
## Example
```yaml
kind: ConfigMap
apiVersion: v1
Expand All @@ -24,21 +24,6 @@ data:
{{if $upstream.LBMethod }}{{$upstream.LBMethod}};{{end}}
...
}{{end}}
```

## VirtualServer Example
```yaml
kind: ConfigMap
apiVersion: v1
metadata:
name: nginx-config
namespace: nginx-ingress
data:
main-template: |
worker_processes {{.WorkerProcesses}};
...
include /etc/nginx/conf.d/*.conf;
}
virtualserver-template: |
{{ range $u := .Upstreams }}
upstream {{ $u.Name }} {
Expand Down