ConfigMap with proxy-set-headers not required when using the configuration-snippets to add a custom header to a specific Ingress configuration. The Ingress does need to be created for the example to work.

This commit is contained in:
Arjan Schaaf 2017-04-24 16:24:20 +02:00
parent 389e0f527c
commit 1b5f8b8779
2 changed files with 9 additions and 8 deletions

View file

@ -38,7 +38,15 @@ default-http-backend-2657704409-qgwdd 1/1 Running 0 2m
nginx-ingress-controller-873061567-4n3k2 1/1 Running 0 42s
```
## Ingress
The Ingress in this example adds a custom header to Nginx configuration that only applies to that specific Ingress. If you want to add headers that apply globally to all Ingresses, please have a look at [this example](/examples/customization/custom-headers/nginx).
```console
$ kubectl apply -f ingress.yaml
deployment "nginx-ingress-controller" created
```
## Test
Check the contents of the annotation is present in the nginx.conf file using:
Check if the contents of the annotation are present in the nginx.conf file using:
`kubectl exec nginx-ingress-controller-873061567-4n3k2 -n kube-system cat /etc/nginx/nginx.conf`

View file

@ -1,7 +0,0 @@
apiVersion: v1
data:
proxy-set-headers: "kube-system/custom-headers"
kind: ConfigMap
metadata:
name: nginx-load-balancer-conf
namespace: kube-system