Fix several Helm YAML issues with extraModules and extraInitContainers (#9709)
* Fix indention issue for DaemonSets when using extraModules and extraInitContainers * Improve documentation * Unify and fix templating * Enable support for the opentelemetry from values.yaml
This commit is contained in:
parent
9b3599206c
commit
00bfb2e84a
3 changed files with 11 additions and 12 deletions
|
@ -178,17 +178,14 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.controller.extraModules }}
|
{{- if .Values.controller.extraModules }}
|
||||||
{{- range .Values.controller.extraModules }}
|
{{- range .Values.controller.extraModules }}
|
||||||
- name: {{ .Name }}
|
{{ $containerSecurityContext := .containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||||
image: {{ .Image }}
|
{{ include "extraModules" (dict "name" .name "image" .image "containerSecurityContext" $containerSecurityContext) | indent 8 }}
|
||||||
command: ['sh', '-c', '/usr/local/bin/init_module.sh']
|
|
||||||
{{- if (or $.Values.controller.containerSecurityContext .containerSecurityContext) }}
|
|
||||||
securityContext: {{ .containerSecurityContext | default $.Values.controller.containerSecurityContext | toYaml | nindent 14 }}
|
|
||||||
{{- end }}
|
|
||||||
volumeMounts:
|
|
||||||
- name: modules
|
|
||||||
mountPath: /modules_mount
|
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
{{- if .Values.controller.opentelemetry.enabled}}
|
||||||
|
{{ $otelContainerSecurityContext := $.Values.controller.opentelemetry.containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||||
|
{{- include "extraModules" (dict "name" "opentelemetry" "image" .Values.controller.opentelemetry.image "containerSecurityContext" $otelContainerSecurityContext) | nindent 8}}
|
||||||
|
{{- end}}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.controller.hostNetwork }}
|
{{- if .Values.controller.hostNetwork }}
|
||||||
hostNetwork: {{ .Values.controller.hostNetwork }}
|
hostNetwork: {{ .Values.controller.hostNetwork }}
|
||||||
|
@ -207,9 +204,9 @@ spec:
|
||||||
{{- end }}
|
{{- end }}
|
||||||
serviceAccountName: {{ template "ingress-nginx.serviceAccountName" . }}
|
serviceAccountName: {{ template "ingress-nginx.serviceAccountName" . }}
|
||||||
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }}
|
terminationGracePeriodSeconds: {{ .Values.controller.terminationGracePeriodSeconds }}
|
||||||
{{- if (or .Values.controller.customTemplate.configMapName .Values.controller.extraVolumeMounts .Values.controller.admissionWebhooks.enabled .Values.controller.extraVolumes .Values.controller.extraModules) }}
|
{{- if (or .Values.controller.customTemplate.configMapName .Values.controller.extraVolumeMounts .Values.controller.admissionWebhooks.enabled .Values.controller.extraVolumes .Values.controller.extraModules .Values.controller.opentelemetry.enabled) }}
|
||||||
volumes:
|
volumes:
|
||||||
{{- if .Values.controller.extraModules }}
|
{{- if (or .Values.controller.extraModules .Values.controller.opentelemetry.enabled)}}
|
||||||
- name: modules
|
- name: modules
|
||||||
emptyDir: {}
|
emptyDir: {}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -185,7 +185,7 @@ spec:
|
||||||
{{- if .Values.controller.extraModules }}
|
{{- if .Values.controller.extraModules }}
|
||||||
{{- range .Values.controller.extraModules }}
|
{{- range .Values.controller.extraModules }}
|
||||||
{{ $containerSecurityContext := .containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
{{ $containerSecurityContext := .containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||||
{{- include "extraModules" (dict "name" .name "image" .image "containerSecurityContext" $containerSecurityContext | nindent 8) }}
|
{{ include "extraModules" (dict "name" .name "image" .image "containerSecurityContext" $containerSecurityContext) | indent 8 }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- if .Values.controller.opentelemetry.enabled}}
|
{{- if .Values.controller.opentelemetry.enabled}}
|
||||||
|
|
|
@ -527,6 +527,8 @@ controller:
|
||||||
|
|
||||||
# -- Modules, which are mounted into the core nginx image. See values.yaml for a sample to add opentelemetry module
|
# -- Modules, which are mounted into the core nginx image. See values.yaml for a sample to add opentelemetry module
|
||||||
extraModules: []
|
extraModules: []
|
||||||
|
# - name: mytestmodule
|
||||||
|
# image: registry.k8s.io/ingress-nginx/mytestmodule
|
||||||
# containerSecurityContext:
|
# containerSecurityContext:
|
||||||
# allowPrivilegeEscalation: false
|
# allowPrivilegeEscalation: false
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue