vikunja-helm/templates/deployment.yaml
Ash Leece 467e8e9556
All checks were successful
Helm Chart Build and Publish / build-and-publish (push) Successful in 10s
Add environment variables support to deployment template
2024-12-20 11:47:42 +00:00

94 lines
3.0 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "vikunja.fullname" . }}
labels:
{{- include "vikunja.labels" . | nindent 4 }}
spec:
replicas: 1
selector:
matchLabels:
{{- include "vikunja.selectorLabels" . | nindent 6 }}
template:
metadata:
{{- with .Values.podAnnotations }}
annotations:
{{- toYaml . | nindent 8 }}
{{- end }}
labels:
{{- include "vikunja.labels" . | nindent 8 }}
{{- with .Values.podLabels }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "vikunja.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
initContainers:
- name: init-permissions
image: busybox
command: ["sh", "-c", "mkdir -p /app/vikunja/files /db && chown 1000:1000 /app/vikunja/files /db"]
volumeMounts:
{{- if .Values.persistence.enabled }}
- name: {{ .Chart.Name }}-data
mountPath: /app/vikunja/files
{{- end }}
{{- if .Values.persistence.db.enabled }}
- name: {{ .Chart.Name }}-db
mountPath: /db
{{- end }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag | default .Chart.AppVersion }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
env: {{ toYaml .Values.env | nindent 12 }}
ports:
- name: http
containerPort: {{ .Values.service.port }}
protocol: TCP
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumeMounts:
{{- if .Values.persistence.enabled }}
- name: {{ .Chart.Name }}-data
mountPath: /app/vikunja/files
{{- end }}
{{- if .Values.persistence.db.enabled }}
- name: {{ .Chart.Name }}-db
mountPath: /db
{{- end }}
{{- with .Values.volumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
volumes:
{{- if .Values.persistence.enabled }}
- name: {{ .Chart.Name }}-data
persistentVolumeClaim:
claimName: {{ .Chart.Name }}-data
{{- end }}
{{- if .Values.persistence.db.enabled }}
- name: {{ .Chart.Name }}-db
persistentVolumeClaim:
claimName: {{ .Chart.Name }}-db
{{- 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 }}