diff --git a/charts/mautic/Chart.yaml b/charts/mautic/Chart.yaml index 56e066d..b490b55 100644 --- a/charts/mautic/Chart.yaml +++ b/charts/mautic/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 0.2.6 +version: 0.2.7 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/mautic/templates/configmap.yaml b/charts/mautic/templates/configmap.yaml index 701daf8..f4cb072 100644 --- a/charts/mautic/templates/configmap.yaml +++ b/charts/mautic/templates/configmap.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: ConfigMap metadata: name: {{ include "mautic.fullname" . }}-db + labels: + {{- include "mautic.labels" . | nindent 4 }} data: {{- toYaml .Values.mautic.db.configMap | nindent 2 }} {{- end }} diff --git a/charts/mautic/templates/deployment.yaml b/charts/mautic/templates/deployment.yaml index 83807b2..833a2de 100644 --- a/charts/mautic/templates/deployment.yaml +++ b/charts/mautic/templates/deployment.yaml @@ -34,8 +34,8 @@ spec: - name: {{ .Chart.Name }} securityContext: {{- toYaml .Values.securityContext | nindent 12 }} - image: "{{ .Values.mautic.web.image.repository }}:web-{{ .Chart.AppVersion }}" - imagePullPolicy: {{ .Values.mautic.web.image.pullPolicy }} + image: "{{ .Values.mautic.image.repository }}:web-{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.mautic.image.pullPolicy }} envFrom: # DB ConfigMap {{- if .Values.mautic.db.existingConfigMap }} @@ -78,14 +78,39 @@ spec: readinessProbe: {{- toYaml .Values.readinessProbe | nindent 12 }} resources: - {{- toYaml .Values.resources | nindent 12 }} + {{- toYaml .Values.mautic.web.resources | nindent 12 }} {{- with .Values.volumeMounts }} volumeMounts: {{- toYaml . | nindent 12 }} + - mountPath: /var/www/html/var/logs + name: logs + - mountPath: /var/www/html/docroot/media/files + name: files + - mountPath: /var/www/html/docroot/media/images + name: images + - mountPath: /var/www/html/config + name: config + - mountPath: /var/www/html/docroot/var/tmp + name: tmp {{- end }} {{- with .Values.volumes }} volumes: {{- toYaml . | nindent 8 }} + - name: logs + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-logs + - name: files + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-files + - name: images + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-images + - name: config + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-config + - name: tmp + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-tmp {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/mautic/templates/job.yaml b/charts/mautic/templates/job.yaml new file mode 100644 index 0000000..4a6d75a --- /dev/null +++ b/charts/mautic/templates/job.yaml @@ -0,0 +1,111 @@ +kind: Job +apiVersion: batch/v1 +metadata: + name: {{ include "mautic.fullname" . }}-install +spec: + template: + metadata: + {{- with .Values.podAnnotations }} + annotations: + {{- toYaml . | nindent 8 }} + {{- end }} + labels: + {{- include "mautic.labels" . | nindent 8 }} + {{- with .Values.podLabels }} + {{- toYaml . | nindent 8 }} + {{- end }} + spec: + {{- with .Values.imagePullSecrets }} + imagePullSecrets: + {{- toYaml . | nindent 8 }} + {{- end }} + serviceAccountName: {{ include "mautic.serviceAccountName" . }} + securityContext: + {{- toYaml .Values.podSecurityContext | nindent 8 }} + containers: + - name: {{ .Chart.Name }} + securityContext: + {{- toYaml .Values.securityContext | nindent 12 }} + image: "{{ .Values.mautic.image.repository }}:install-{{ .Chart.AppVersion }}" + imagePullPolicy: {{ .Values.mautic.image.pullPolicy }} + envFrom: + # DB ConfigMap + {{- if .Values.mautic.db.existingConfigMap }} + - configMapRef: + name: {{ .Values.mautic.db.existingConfigMap }} + {{- else }} + - configMapRef: + name: {{ include "mautic.fullname" . }}-db + {{- end }} + # DB Secret + {{- if .Values.mautic.db.existingSecret }} + - secretRef: + name: {{ .Value.mautic.db.existingSecret }} + {{- else }} + - secretRef: + name: {{ include "mautic.fullname" . }}-db + {{- end }} + # Maustic ConfigMap + {{- if .Values.mautic.existingConfigMap }} + - configMapRef: + name: {{ .Values.mautic.existingConfigMap }} + {{- else }} + - configMapRef: + name: {{ include "mautic.fullname" . }}-config + {{- end }} + # Mautic Secret + {{- if .Values.mautic.existingSecret }} + - secretRef: + name: {{ .Values.mautic.existingSecret }} + {{- else }} + - secretRef: + name: {{ include "mautic.fullname" . }}-secret + {{- end }} + resources: + {{- toYaml .Values.mautic.install.resources | nindent 12 }} + {{- with .Values.volumeMounts }} + volumeMounts: + {{- toYaml . | nindent 12 }} + - mountPath: /var/www/html/var/logs + name: logs + - mountPath: /var/www/html/docroot/media/files + name: files + - mountPath: /var/www/html/docroot/media/images + name: images + - mountPath: /var/www/html/config + name: config + - mountPath: /var/www/html/docroot/var/tmp + name: tmp + {{- end }} + {{- with .Values.volumes }} + volumes: + {{- toYaml . | nindent 8 }} + - name: logs + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-logs + - name: files + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-files + - name: images + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-images + - name: config + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-config + - name: tmp + persistentVolumeClaim: + claimName: {{ include "mautic.fullname" . }}-tmp + {{- end }} + restartPolicy: OnFailure + {{- with .Values.nodeSelector }} + nodeSelector: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.affinity }} + affinity: + {{- toYaml . | nindent 8 }} + {{- end }} + {{- with .Values.tolerations }} + tolerations: + {{- toYaml . | nindent 8 }} + {{- end }} diff --git a/charts/mautic/templates/pvc.yaml b/charts/mautic/templates/pvc.yaml new file mode 100644 index 0000000..94f3471 --- /dev/null +++ b/charts/mautic/templates/pvc.yaml @@ -0,0 +1,59 @@ +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mautic.fullname" . }}-logs +spec: + accessModes: + - {{ .Values.mautic.persistence.accessMode | quote }} + resources: + requests: + storage: 1Gi + storageClassName: {{ .Values.mautic.persistence.storageClass | quote }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mautic.fullname" . }}-files +spec: + accessModes: + - {{ .Values.mautic.persistence.accessMode | quote }} + resources: + requests: + storage: 1Gi + storageClassName: {{ .Values.mautic.persistence.storageClass | quote }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mautic.fullname" . }}-images +spec: + accessModes: + - {{ .Values.mautic.persistence.accessMode | quote }} + resources: + requests: + storage: 1Gi + storageClassName: {{ .Values.mautic.persistence.storageClass | quote }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mautic.fullname" . }}-config +spec: + accessModes: + - {{ .Values.mautic.persistence.accessMode | quote }} + resources: + requests: + storage: 1Gi + storageClassName: {{ .Values.mautic.persistence.storageClass | quote }} +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: {{ include "mautic.fullname" . }}-tmp +spec: + accessModes: + - {{ .Values.mautic.persistence.accessMode | quote }} + resources: + requests: + storage: 1Gi + storageClassName: {{ .Values.mautic.persistence.storageClass | quote }} diff --git a/charts/mautic/templates/secret.yaml b/charts/mautic/templates/secret.yaml index 773f11e..db9e6d2 100644 --- a/charts/mautic/templates/secret.yaml +++ b/charts/mautic/templates/secret.yaml @@ -3,6 +3,8 @@ apiVersion: v1 kind: Secret metadata: name: {{ include "mautic.fullname" . }}-db + labels: + {{- include "mautic.labels" . | nindent 4 }} type: Opaque stringData: {{- toYaml .Values.mautic.db.secret | nindent 2 }} diff --git a/charts/mautic/values.yaml b/charts/mautic/values.yaml index d05a678..b05de62 100644 --- a/charts/mautic/values.yaml +++ b/charts/mautic/values.yaml @@ -1,10 +1,10 @@ -# Default values for mautic. -# This is a YAML-formatted file. -# Declare variables to be passed into your templates. - replicaCount: 1 mautic: + image: + repository: tanjim/mautic + pullPolicy: IfNotPresent + # existingConfigMap: "" # ignore the following values if existingConfigMap is set configMap: @@ -18,11 +18,29 @@ mautic: MAUTIC_ADMIN_EMAIL: "contact@example.com" MAUTIC_ADMIN_PASSWORD: "admin" - web: - image: - repository: tanjim/mautic - pullPolicy: IfNotPresent + persistence: + # options: ReadWriteOnce, ReadWriteMany + # replicaCount should be 1 when using ReadWriteOnce + accessMode: ReadWriteMany + # example: efs, nfs, ebs + storageClass: "" + web: + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi + install: + resources: {} + # limits: + # cpu: 100m + # memory: 128Mi + # requests: + # cpu: 100m + # memory: 128Mi db: # existingConfigMap: "" # ignore the following values if existingConfigMap is set @@ -86,18 +104,6 @@ ingress: # hosts: # - chart-example.local -resources: {} - # We usually recommend not to specify default resources and to leave this as a conscious - # choice for the user. This also increases chances charts run on environments with little - # resources, such as Minikube. If you do want to specify resources, uncomment the following - # lines, adjust them as necessary, and remove the curly braces after 'resources:'. - # limits: - # cpu: 100m - # memory: 128Mi - # requests: - # cpu: 100m - # memory: 128Mi - livenessProbe: httpGet: path: /