From e782805cfe2511b99193ed5850e7f6207d17ec03 Mon Sep 17 00:00:00 2001 From: k8s-ci-robot Date: Thu, 16 Sep 2021 21:24:27 +0000 Subject: [PATCH] Deploy GitHub Pages --- .../configmap-client-response.yaml | 10 ++ .../customization/custom-headers/index.html | 3 +- search/search_index.json | 2 +- sitemap.xml | 102 +++++++++--------- sitemap.xml.gz | Bin 711 -> 711 bytes 5 files changed, 64 insertions(+), 53 deletions(-) create mode 100644 examples/customization/custom-headers/configmap-client-response.yaml diff --git a/examples/customization/custom-headers/configmap-client-response.yaml b/examples/customization/custom-headers/configmap-client-response.yaml new file mode 100644 index 000000000..3213de3f2 --- /dev/null +++ b/examples/customization/custom-headers/configmap-client-response.yaml @@ -0,0 +1,10 @@ +apiVersion: v1 +data: + add-headers: "ingress-nginx/custom-headers" +kind: ConfigMap +metadata: + name: ingress-nginx-controller + namespace: ingress-nginx + labels: + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/part-of: ingress-nginx \ No newline at end of file diff --git a/examples/customization/custom-headers/index.html b/examples/customization/custom-headers/index.html index 39e272bb6..d7a77cdee 100644 --- a/examples/customization/custom-headers/index.html +++ b/examples/customization/custom-headers/index.html @@ -1,6 +1,7 @@ Custom Headers - NGINX Ingress Controller
Skip to content

Custom Headers

This example demonstrates configuration of the nginx ingress controller via a ConfigMap to pass a custom list of headers to the upstream server.

custom-headers.yaml defines a ConfigMap in the ingress-nginx namespace named custom-headers, holding several custom X-prefixed HTTP headers.

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/customization/custom-headers/custom-headers.yaml
 

configmap.yaml defines a ConfigMap in the ingress-nginx namespace named ingress-nginx-controller. This controls the global configuration of the ingress controller, and already exists in a standard installation. The key proxy-set-headers is set to cite the previously-created ingress-nginx/custom-headers ConfigMap.

kubectl apply -f https://raw.githubusercontent.com/kubernetes/ingress-nginx/main/docs/examples/customization/custom-headers/configmap.yaml
-

The nginx ingress controller will read the ingress-nginx/ingress-nginx-controller ConfigMap, find the proxy-set-headers key, read HTTP headers from the ingress-nginx/custom-headers ConfigMap, and include those HTTP headers in all requests flowing from nginx to the backends.

Test

Check the contents of the ConfigMaps are present in the nginx.conf file using: kubectl exec ingress-nginx-controller-873061567-4n3k2 -n ingress-nginx -- cat /etc/nginx/nginx.conf