diff --git a/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml b/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml index 9836501..062d989 100644 --- a/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml +++ b/charts/portalmodelo/v0.5.0/templates/plone-deployment.yaml @@ -56,36 +56,6 @@ spec: - mountPath: /data name: data {{- end }} - {{- if .Values.portal.createAndUpgrade }} - - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" - name: {{ .Release.Name }}-plonecfg - command: [ "/configure.sh" ] - env: - {{- if .Values.instance.zeoclient }} - - name: ZEO_ADDRESS - value: {{ template "portalmodelo.fullname" . }}-zeoserver:8100 - {{- else }} - - name: ZEO_ADDRESS - value: "" - {{- end }} - - name: EMAIL - value: {{ .Values.portal.adminEmail }} - - name: PASSWORD - value: {{ .Values.portal.adminPassword }} - - name: TITLE - value: {{ .Values.portal.title }} - - name: DESCR - value: {{ .Values.portal.description }} - - name: HOSTNAME - value: {{ .Values.portal.hostname }} - - name: ROOTPWD - value: {{ .Values.portal.rootPassword }} - - name: TZ - value: {{ .Values.portal.timeZone }} - volumeMounts: - - mountPath: /data - name: data - {{- end }} containers: - env: {{- if .Values.instance.zeoclient }} diff --git a/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml b/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml new file mode 100644 index 0000000..e111211 --- /dev/null +++ b/charts/portalmodelo/v0.5.0/templates/plonecfg-job.yaml @@ -0,0 +1,60 @@ +{{- if .Values.portal.createAndUpgrade }} +apiVersion: batch/v1 +kind: Job +metadata: + name: {{ include "portalmodelo.fullname" . }}-plonecfg + labels: + {{- include "portalmodelo.labels" . | nindent 4 }} +spec: + backoffLimit: 0 + template: + metadata: + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-1" + labels: + {{- include "portalmodelo.ploneSelectorLabels" . | nindent 8 }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + restartPolicy: Never + containers: + - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" + name: {{ .Release.Name }}-plonecfg + command: [ "/configure.sh" ] + env: + {{- if .Values.instance.zeoclient }} + - name: ZEO_ADDRESS + value: {{ template "portalmodelo.fullname" . }}-zeoserver:8100 + {{- else }} + - name: ZEO_ADDRESS + value: "" + {{- end }} + - name: EMAIL + value: {{ .Values.portal.adminEmail }} + - name: PASSWORD + value: {{ .Values.portal.adminPassword }} + - name: TITLE + value: {{ .Values.portal.title }} + - name: DESCR + value: {{ .Values.portal.description }} + - name: HOSTNAME + value: {{ .Values.portal.hostname }} + - name: ROOTPWD + value: {{ .Values.portal.rootPassword }} + - name: TZ + value: {{ .Values.portal.timeZone }} + volumeMounts: + - mountPath: /data + name: data + {{- if .Values.persistence.enabled }} + volumes: + - name: data + persistentVolumeClaim: + claimName: data + {{- end }} +{{- end }} diff --git a/charts/portalmodelo/v0.5.0/templates/pvc.yaml b/charts/portalmodelo/v0.5.0/templates/pvc.yaml index 0640056..d6ff4a7 100644 --- a/charts/portalmodelo/v0.5.0/templates/pvc.yaml +++ b/charts/portalmodelo/v0.5.0/templates/pvc.yaml @@ -2,7 +2,10 @@ apiVersion: v1 kind: PersistentVolumeClaim metadata: - name: data + name: data + annotations: + "helm.sh/hook": pre-install,pre-upgrade + "helm.sh/hook-weight": "-10" spec: accessModes: - {{ .Values.persistence.accessMode }}