helm-charts/grampsweb/templates/deployment.yaml

117 lines
3.8 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "grampsweb.fullname" . }}
labels:
{{- include "grampsweb.labels" . | nindent 4 }}
spec:
{{- if not .Values.autoscaling.enabled }}
replicas: {{ .Values.replicaCount }}
{{- end }}
selector:
matchLabels:
{{- include "grampsweb.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "grampsweb.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "grampsweb.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.registry }}/{{ .Values.image.repository }}:{{ .Values.image.tag | default (printf "v%s" .Chart.AppVersion) }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.gramps }}
env:
- name: "GRAMPSWEB_TREE"
value: "{{ .tree }}"
- name: "GRAMPSWEB_BASE_URL"
value: "{{ .baseURL }}"
{{- end }}
envFrom:
- secretRef:
name: {{ include "grampsweb.fullname" . }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
livenessProbe:
httpGet:
path: /
port: http
readinessProbe:
httpGet:
path: /
port: http
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
# gramps_users
- name: "data"
mountPath: "/app/users"
subPath: "app/users"
# gramps_index
- name: "data"
mountPath: "/app/indexdir"
subPath: "app/indexdir"
# gramps_thumb_cache
- name: "data"
mountPath: "/app/thumbnail_cache"
subPath: "app/thumbnail_cache"
# gramps_secret
- name: "data"
mountPath: "/app/secret"
subPath: "app/secret"
# gramps_db
- name: "data"
mountPath: "/root/.gramps/grampsdb"
subPath: "root/.gramps/grampsdb"
# gramps_media
- name: "data"
mountPath: "/app/media"
subPath: "app/media"
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
- name: "data"
{{- if .Values.persistence.hostPath }}
hostPath:
type: Directory
path: {{ .Values.persistence.hostPath | quote }}
{{- else if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ if .Values.persistence.existingClaim }}{{ .Values.persistence.existingClaim }}{{- else }}{{ template "grampsweb.fullname" . }}{{- end }}
{{- else }}
emptyDir: {}
{{- end }}
{{- with .Values.volumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}