{{- 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" "helm.sh/resource-policy": "keep" labels: {{- include "portalmodelo.ploneSelectorLabels" . | nindent 8 }} spec: {{- with .Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml .Values.podSecurityContext | nindent 8 }} restartPolicy: Never initContainers: - image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}" name: {{ .Release.Name }}-chownplone command: - "chown" - "plone:plone" - "/data" securityContext: runAsNonRoot: false runAsUser: 0 volumeMounts: - mountPath: /data name: data 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 }}