From 83b5fbc38a08d9837ba78a8c1c669efc262d282b Mon Sep 17 00:00:00 2001 From: Mark Sagi-Kazar Date: Sat, 18 Dec 2021 15:11:44 +0100 Subject: [PATCH] Add extra containers to helm chart --- deployments/helm-chart/README.md | 1 + deployments/helm-chart/templates/controller-daemonset.yaml | 3 +++ deployments/helm-chart/templates/controller-deployment.yaml | 3 +++ deployments/helm-chart/values.yaml | 6 ++++++ docs/content/installation/installation-with-helm.md | 1 + 5 files changed, 14 insertions(+) diff --git a/deployments/helm-chart/README.md b/deployments/helm-chart/README.md index 6601a1377a..474fdd03a8 100644 --- a/deployments/helm-chart/README.md +++ b/deployments/helm-chart/README.md @@ -172,6 +172,7 @@ Parameter | Description | Default `controller.volumes` | The volumes of the Ingress controller pods. | [] `controller.volumeMounts` | The volumeMounts of the Ingress controller pods. | [] `controller.initContainers` | InitContainers for the Ingress controller pods. | [] +`controller.extraContainers` | Extra (eg. sidecar) containers for the Ingress controller pods. | [] `controller.resources` | The resources of the Ingress controller pods. | {} `controller.replicaCount` | The number of replicas of the Ingress controller deployment. | 1 `controller.ingressClass` | A class of the Ingress controller. An IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of kubernetes. | nginx diff --git a/deployments/helm-chart/templates/controller-daemonset.yaml b/deployments/helm-chart/templates/controller-daemonset.yaml index fabc545a21..9797d327bf 100644 --- a/deployments/helm-chart/templates/controller-daemonset.yaml +++ b/deployments/helm-chart/templates/controller-daemonset.yaml @@ -163,6 +163,9 @@ spec: - -ready-status={{ .Values.controller.readyStatus.enable }} - -ready-status-port={{ .Values.controller.readyStatus.port }} - -enable-latency-metrics={{ .Values.controller.enableLatencyMetrics }} +{{- if .Values.controller.extraContainers }} + {{ toYaml .Values.controller.extraContainers | nindent 6 }} +{{- end }} {{- if .Values.controller.initContainers }} initContainers: {{ toYaml .Values.controller.initContainers | nindent 8 }} {{- end }} diff --git a/deployments/helm-chart/templates/controller-deployment.yaml b/deployments/helm-chart/templates/controller-deployment.yaml index 40e14c622b..0626d3dd12 100644 --- a/deployments/helm-chart/templates/controller-deployment.yaml +++ b/deployments/helm-chart/templates/controller-deployment.yaml @@ -161,6 +161,9 @@ spec: - -ready-status={{ .Values.controller.readyStatus.enable }} - -ready-status-port={{ .Values.controller.readyStatus.port }} - -enable-latency-metrics={{ .Values.controller.enableLatencyMetrics }} +{{- if .Values.controller.extraContainers }} + {{ toYaml .Values.controller.extraContainers | nindent 6 }} +{{- end }} {{- if .Values.controller.initContainers }} initContainers: {{ toYaml .Values.controller.initContainers | nindent 8 }} {{- end }} diff --git a/deployments/helm-chart/values.yaml b/deployments/helm-chart/values.yaml index fc3d96f061..de0f1b1d2e 100644 --- a/deployments/helm-chart/values.yaml +++ b/deployments/helm-chart/values.yaml @@ -133,6 +133,12 @@ controller: # image: busybox:1.34 # command: ['sh', '-c', 'echo this is initial setup!'] + ## Extra containers for the Ingress controller pods. + extraContainers: [] + # - name: container + # image: busybox:1.34 + # command: ['sh', '-c', 'echo this is a sidecar!'] + ## The number of replicas of the Ingress controller deployment. replicaCount: 1 diff --git a/docs/content/installation/installation-with-helm.md b/docs/content/installation/installation-with-helm.md index 4795ad04bc..88a515d841 100644 --- a/docs/content/installation/installation-with-helm.md +++ b/docs/content/installation/installation-with-helm.md @@ -179,6 +179,7 @@ The following tables lists the configurable parameters of the NGINX Ingress cont |``controller.volumes`` | The volumes of the Ingress controller pods. | [] | |``controller.volumeMounts`` | The volumeMounts of the Ingress controller pods. | [] | |``controller.initContainers`` | InitContainers for the Ingress controller pods. | [] +|``controller.extraContainers`` | Extra (eg. sidecar) containers for the Ingress controller pods. | [] |``controller.resources`` | The resources of the Ingress controller pods. | {} | |``controller.replicaCount`` | The number of replicas of the Ingress controller deployment. | 1 | |``controller.ingressClass`` | A class of the Ingress controller. An IngressClass resource with the name equal to the class must be deployed. Otherwise, the Ingress Controller will fail to start. The Ingress controller only processes resources that belong to its class - i.e. have the "ingressClassName" field resource equal to the class. The Ingress Controller processes all the VirtualServer/VirtualServerRoute/TransportServer resources that do not have the "ingressClassName" field for all versions of kubernetes. | nginx |