feat(helm): Add image digest pinning support (#1531)
* feat(helm): add image digest field to values - Add optional 'digest' field under image.repository configuration - Allows users to pin container images by SHA256 digest - Improves security through immutable image identification - Fully backward compatible (digest is optional) * feat(helm): implement image digest pinning in deployment template - Add conditional logic to support SHA256 digest in image references - When digest is set with tag: generates 'repository:tag@sha256:digest' - When digest is set without tag: generates 'repository@sha256:digest' - Preserves backward compatibility with tag-only deployments - Validates tag presence to avoid invalid image references * docs(helm): add image digest pinning documentation - Add 'Image Digest Pinning' section under Advanced Configuration - Include methods for finding image digests (docker inspect, skopeo) - Document two usage options: - Option 1: Digest with tag (recommended) for reference + verification - Option 2: Digest only for minimalist configuration - Explain security benefits (immutability, supply chain security, reproducibility) - Provide complete helm and values.yaml examples
This commit is contained in:
@@ -39,7 +39,16 @@ spec:
|
||||
- name: {{ .Chart.Name }}
|
||||
securityContext:
|
||||
{{- toYaml .Values.securityContext | nindent 12 }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
|
||||
{{- $imageTag := .Values.image.tag | default .Chart.AppVersion }}
|
||||
{{- if .Values.image.digest }}
|
||||
{{- if $imageTag }}
|
||||
image: "{{ .Values.image.repository }}:{{ $imageTag }}@sha256:{{ .Values.image.digest }}"
|
||||
{{- else }}
|
||||
image: "{{ .Values.image.repository }}@sha256:{{ .Values.image.digest }}"
|
||||
{{- end }}
|
||||
{{- else }}
|
||||
image: "{{ .Values.image.repository }}:{{ $imageTag }}"
|
||||
{{- end }}
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- name: http
|
||||
|
||||
Reference in New Issue
Block a user