From d54c5101541083872648c9494aab02064e2bf515 Mon Sep 17 00:00:00 2001 From: Marshall Cottrell Date: Thu, 8 Apr 2021 10:26:44 -0500 Subject: [PATCH] do not hash nginx configmap name The nginx controller pods automatically watch their configmap for changes, so we don't need to force the pods to restart. This should eliminate downtime during upgrades. --- .../custom-config/kustomization.yaml | 17 +------------ ingress-nginx/upstream/deploy.yaml | 25 ++++++++++--------- 2 files changed, 14 insertions(+), 28 deletions(-) diff --git a/ingress-nginx/custom-config/kustomization.yaml b/ingress-nginx/custom-config/kustomization.yaml index 8f2bfa2..c99a5cd 100644 --- a/ingress-nginx/custom-config/kustomization.yaml +++ b/ingress-nginx/custom-config/kustomization.yaml @@ -5,7 +5,7 @@ configurations: configMapGenerator: # https://kubernetes.github.io/ingress-nginx/user-guide/nginx-configuration/configmap/ - name: ingress-nginx-controller - behavior: create + behavior: merge literals: - add-headers=$(HEADERS_CONFIGMAP_NAMESPACE)/$(HEADERS_CONFIGMAP_NAME) - enable-vts-status="true" @@ -14,22 +14,7 @@ configMapGenerator: behavior: create literals: - X-Powered-By="appdat" -patches: -- patch: |- - - op: replace - path: /spec/template/spec/containers/0/args/4 - value: --configmap=$(POD_NAMESPACE)/$(CUSTOM_CONFIGMAP_NAME) - target: - kind: Deployment - name: ingress-nginx-controller vars: -- name: CUSTOM_CONFIGMAP_NAME - fieldref: - fieldpath: metadata.name - objref: - name: ingress-nginx-controller - apiVersion: v1 - kind: ConfigMap - name: HEADERS_CONFIGMAP_NAME fieldref: fieldpath: metadata.name diff --git a/ingress-nginx/upstream/deploy.yaml b/ingress-nginx/upstream/deploy.yaml index 4a178fc..a01f856 100644 --- a/ingress-nginx/upstream/deploy.yaml +++ b/ingress-nginx/upstream/deploy.yaml @@ -13,18 +13,19 @@ metadata: automountServiceAccountToken: true --- # Source: ingress-nginx/templates/controller-configmap.yaml -# apiVersion: v1 -# kind: ConfigMap -# metadata: -# labels: -# helm.sh/chart: ingress-nginx-3.23.0 -# app.kubernetes.io/name: ingress-nginx -# app.kubernetes.io/instance: ingress-nginx -# app.kubernetes.io/version: 0.44.0 -# app.kubernetes.io/managed-by: Helm -# app.kubernetes.io/component: controller -# name: ingress-nginx-controller -# --- +apiVersion: v1 +kind: ConfigMap +metadata: + labels: + helm.sh/chart: ingress-nginx-3.27.0 + app.kubernetes.io/name: ingress-nginx + app.kubernetes.io/instance: ingress-nginx + app.kubernetes.io/version: 0.45.0 + app.kubernetes.io/managed-by: Helm + app.kubernetes.io/component: controller + name: ingress-nginx-controller +data: +--- # Source: ingress-nginx/templates/clusterrole.yaml apiVersion: rbac.authorization.k8s.io/v1 kind: ClusterRole