feat!: use extraModules helper method for templating the image value
* image definition for OTel image is now split up in image, repo and registry values
This commit is contained in:
parent
4824469180
commit
cf67302e46
4 changed files with 7 additions and 17 deletions
|
@ -257,7 +257,7 @@ Extra modules.
|
|||
*/}}
|
||||
{{- define "extraModules" -}}
|
||||
- name: {{ .name }}
|
||||
image: {{ .image }}
|
||||
image: {{ printf "%s/%s:%s" .image.registry .image.image .image.tag }}{{ include "ingress-nginx.imageDigest" .image }}
|
||||
command:
|
||||
{{- if .distroless }}
|
||||
- /init_module
|
||||
|
|
|
@ -191,10 +191,6 @@ spec:
|
|||
{{- $containerSecurityContext := .containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||
{{- include "extraModules" (dict "name" .name "image" .image "distroless" .distroless "containerSecurityContext" $containerSecurityContext "resources" .resources) | nindent 8 }}
|
||||
{{- end }}
|
||||
<!!----- old ---->
|
||||
{{ $otelContainerSecurityContext := $.Values.controller.opentelemetry.containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||
{{ $fullImage := printf "%s/%s:%s@%s" .Values.controller.opentelemetry.image.registry .Values.controller.opentelemetry.image.image .Values.controller.opentelemetry.image.tag .Values.controller.opentelemetry.image.digest }}
|
||||
{{- include "extraModules" (dict "name" "opentelemetry" "image" .Values.controller.opentelemetry.image "containerSecurityContext" $otelContainerSecurityContext) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.hostNetwork }}
|
||||
|
|
|
@ -194,10 +194,6 @@ spec:
|
|||
{{- $containerSecurityContext := .containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||
{{- include "extraModules" (dict "name" .name "image" .image "distroless" .distroless "containerSecurityContext" $containerSecurityContext "resources" .resources) | nindent 8 }}
|
||||
{{- end }}
|
||||
<!------ oldd -->
|
||||
{{- $otelContainerSecurityContext := $.Values.controller.opentelemetry.containerSecurityContext | default $.Values.controller.containerSecurityContext }}
|
||||
{{- $fullImage := printf "%s/%s:%s@%s" .Values.controller.opentelemetry.image.registry .Values.controller.opentelemetry.image.image .Values.controller.opentelemetry.image.tag .Values.controller.opentelemetry.image.digest }}
|
||||
{{- include "extraModules" (dict "name" "opentelemetry" "image" $fullImage "containerSecurityContext" $otelContainerSecurityContext) | nindent 8}}
|
||||
{{- end }}
|
||||
{{- end }}
|
||||
{{- if .Values.controller.hostNetwork }}
|
||||
|
|
|
@ -587,7 +587,10 @@ controller:
|
|||
# -- Modules, which are mounted into the core nginx image. See values.yaml for a sample to add opentelemetry module
|
||||
extraModules: []
|
||||
# - name: mytestmodule
|
||||
# image: registry.k8s.io/ingress-nginx/mytestmodule
|
||||
# image:
|
||||
# registry: registry.k8s.io
|
||||
# image: ingress-nginx/mytestmodule
|
||||
# tag: latest
|
||||
# distroless: false
|
||||
# containerSecurityContext:
|
||||
# runAsNonRoot: true
|
||||
|
@ -608,16 +611,11 @@ controller:
|
|||
opentelemetry:
|
||||
enabled: false
|
||||
name: opentelemetry
|
||||
image: registry.k8s.io/ingress-nginx/opentelemetry:v20230721-3e2062ee5@sha256:13bee3f5223883d3ca62fee7309ad02d22ec00ff0d7033e3e9aca7a9f60fd472
|
||||
|
||||
|
||||
image:
|
||||
registry: registry.k8s.io
|
||||
image: ingress-nginx/opentelemetry
|
||||
tag: "v20230312-helm-chart-4.5.2-28-g66a760794"
|
||||
digest: sha256:40f766ac4a9832f36f217bb0e98d44c8d38faeccbfe861fbc1a76af7e9ab257f
|
||||
|
||||
|
||||
tag: "v20230721-3e2062ee5"
|
||||
digest: sha256:13bee3f5223883d3ca62fee7309ad02d22ec00ff0d7033e3e9aca7a9f60fd472
|
||||
distroless: true
|
||||
containerSecurityContext:
|
||||
runAsNonRoot: true
|
||||
|
|
Loading…
Reference in a new issue