diff --git a/charts/zot/Chart.yaml b/charts/zot/Chart.yaml index f650ae0..b813b4b 100644 --- a/charts/zot/Chart.yaml +++ b/charts/zot/Chart.yaml @@ -3,4 +3,4 @@ appVersion: v2.0.0-rc7 description: A Helm chart for Kubernetes name: zot type: application -version: 0.1.38 +version: 0.1.39 diff --git a/charts/zot/templates/deployment.yaml b/charts/zot/templates/deployment.yaml index fae77ca..c48dda1 100644 --- a/charts/zot/templates/deployment.yaml +++ b/charts/zot/templates/deployment.yaml @@ -32,12 +32,12 @@ spec: image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" imagePullPolicy: {{ .Values.image.pullPolicy }} env: - {{- toYaml .Values.env | nindent 12 }} + {{- toYaml .Values.env | nindent 12 }} ports: - name: zot containerPort: 5000 protocol: TCP - {{- if or .Values.mountConfig .Values.mountSecret .Values.persistence .Values.externalSecrets }} + {{- if or (not (empty .Values.extraVolumeMounts)) .Values.mountConfig .Values.mountSecret .Values.persistence .Values.externalSecrets }} volumeMounts: {{- if .Values.mountConfig }} - mountPath: '/etc/zot' @@ -55,6 +55,9 @@ spec: - mountPath: '/var/lib/registry' name: {{ .Release.Name }}-volume {{- end }} + {{- with .Values.extraVolumeMounts }} + {{- toYaml . | nindent 12 }} + {{- end }} {{- end }} livenessProbe: initialDelaySeconds: 5 @@ -80,7 +83,7 @@ spec: {{- end }} resources: {{- toYaml .Values.resources | nindent 12 }} - {{- if or .Values.mountConfig .Values.mountSecret .Values.persistence .Values.externalSecrets }} + {{- if or .Values.mountConfig .Values.mountSecret .Values.persistence .Values.externalSecrets (not (empty .Values.extraVolumes))}} volumes: {{- if .Values.mountConfig }} - name: {{ .Release.Name }}-config @@ -102,6 +105,9 @@ spec: persistentVolumeClaim: claimName: {{ .Values.pvc.name | default (printf "%s-pvc" .Release.Name) }} {{- end }} + {{- with .Values.extraVolumes }} + {{- toYaml . | nindent 8 }} + {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/zot/values.yaml b/charts/zot/values.yaml index bcd95f3..0b61db2 100644 --- a/charts/zot/values.yaml +++ b/charts/zot/values.yaml @@ -152,3 +152,13 @@ env: # secretKeyRef: # name: mysecret # key: username + +# Extra Volume Mounts +extraVolumeMounts: [] +# - name: data +# mountPath: /var/lib/registry + +# Extra Volumes +extraVolumes: [] +# - name: data +# emptyDir: {} diff --git a/tests/ci/extra-volume/.helmignore b/tests/ci/extra-volume/.helmignore new file mode 100644 index 0000000..0e8a0eb --- /dev/null +++ b/tests/ci/extra-volume/.helmignore @@ -0,0 +1,23 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ diff --git a/tests/ci/extra-volume/Chart.yaml b/tests/ci/extra-volume/Chart.yaml new file mode 100644 index 0000000..4f322bb --- /dev/null +++ b/tests/ci/extra-volume/Chart.yaml @@ -0,0 +1,10 @@ +apiVersion: v2 +name: extra-volumes +description: Test chart for zot extra-volumes values +type: application +version: 0.1.0 +appVersion: "0.1.0" +dependencies: +- name: zot + version: ~0.1.39 + repository: "file://../../../charts/zot" diff --git a/tests/ci/extra-volume/values.yaml b/tests/ci/extra-volume/values.yaml new file mode 100644 index 0000000..49fd94b --- /dev/null +++ b/tests/ci/extra-volume/values.yaml @@ -0,0 +1,11 @@ +zot: + securityContext: + runAsUser: 1000 + + extraVolumeMounts: + - name: data + mountPath: /var/lib/registry + + extraVolumes: + - name: data + emptyDir: {}