Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
audacioustux committed Jun 19, 2024
1 parent 36db1bc commit c060e79
Show file tree
Hide file tree
Showing 7 changed files with 229 additions and 24 deletions.
2 changes: 1 addition & 1 deletion charts/mautic/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions charts/mautic/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
31 changes: 28 additions & 3 deletions charts/mautic/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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:
Expand Down
111 changes: 111 additions & 0 deletions charts/mautic/templates/job.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
59 changes: 59 additions & 0 deletions charts/mautic/templates/pvc.yaml
Original file line number Diff line number Diff line change
@@ -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 }}
2 changes: 2 additions & 0 deletions charts/mautic/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
46 changes: 26 additions & 20 deletions charts/mautic/values.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand All @@ -18,11 +18,29 @@ mautic:
MAUTIC_ADMIN_EMAIL: "[email protected]"
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
Expand Down Expand Up @@ -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: /
Expand Down

0 comments on commit c060e79

Please sign in to comment.