diff --git a/charts/flagger/README.md b/charts/flagger/README.md index 349fa7f7..c5543f04 100644 --- a/charts/flagger/README.md +++ b/charts/flagger/README.md @@ -186,6 +186,8 @@ The following tables lists the configurable parameters of the Flagger chart and | `podDisruptionBudget.minAvailable` | The minimal number of available replicas that will be set in the PodDisruptionBudget | `1` | | `noCrossNamespaceRefs` | If `true`, cross namespace references to custom resources will be disabled | `false` | | `namespace` | When specified, Flagger will restrict itself to watching Canary objects from that namespace | `""` | +| `additionalVolumes` | Extra volumes to add to the Flagger pod | `[]` | +| `additionalVolumeMounts` | Extra volume mounts to add to the Flagger container | `[]` | | `deploymentLabels` | Labels to add to Flagger deployment | `{}` | | `podLabels` | Labels to add to pods of Flagger deployment | `{}` | diff --git a/charts/flagger/templates/deployment.yaml b/charts/flagger/templates/deployment.yaml index ee7d22b5..93884ace 100644 --- a/charts/flagger/templates/deployment.yaml +++ b/charts/flagger/templates/deployment.yaml @@ -53,15 +53,17 @@ spec: imagePullSecrets: - name: {{ .Values.image.pullSecret }} {{- end }} - {{- if .Values.controlplane.kubeconfig.secretName }} + {{- if or .Values.controlplane.kubeconfig.secretName .Values.additionalVolumes }} volumes: + {{- if .Values.controlplane.kubeconfig.secretName }} - name: kubeconfig secret: secretName: "{{ .Values.controlplane.kubeconfig.secretName }}" {{- end }} - {{- if .Values.additionalVolumes }} - {{- toYaml .Values.additionalVolumes | nindent 8 -}} - {{- end }} + {{- if .Values.additionalVolumes }} +{{ toYaml .Values.additionalVolumes | nindent 8 }} + {{- end }} + {{- end }} {{- if .Values.podPriorityClassName }} priorityClassName: {{ .Values.podPriorityClassName }} {{- end }} @@ -71,11 +73,16 @@ spec: securityContext: {{ toYaml .Values.securityContext.context | indent 12 }} {{- end }} - {{- if .Values.controlplane.kubeconfig.secretName }} + {{- if or .Values.controlplane.kubeconfig.secretName .Values.additionalVolumeMounts }} volumeMounts: + {{- if .Values.controlplane.kubeconfig.secretName }} - name: kubeconfig mountPath: "/tmp/controlplane" {{- end }} + {{- if .Values.additionalVolumeMounts }} +{{ toYaml .Values.additionalVolumeMounts | nindent 12 }} + {{- end }} + {{- end }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index dbc9fc01..92e9d37c 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -204,6 +204,11 @@ deploymentLabels: { } noCrossNamespaceRefs: false #Placeholder to supply additional volumes to the flagger pod -additionalVolumes: {} +additionalVolumes: [] # - name: tmpfs # emptyDir: {} + +# Placeholder to supply additional volume mounts to the flagger container +additionalVolumeMounts: [] + # - name: tmpfs + # mountPath: /tmp