forked from vikunja/helm-chart
116 lines
3.6 KiB
YAML
116 lines
3.6 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "vikunja.apiFullname" . }}
|
|
labels:
|
|
{{- include "vikunja.labels" . | nindent 4 }}
|
|
spec:
|
|
{{- if not .Values.api.autoscaling.enabled }}
|
|
replicas: {{ .Values.api.replicaCount }}
|
|
{{- end }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "vikunja.apiSelectorLabels" . | nindent 6 }}
|
|
template:
|
|
metadata:
|
|
{{- with .Values.api.podAnnotations }}
|
|
annotations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
labels:
|
|
{{- include "vikunja.apiSelectorLabels" . | nindent 8 }}
|
|
spec:
|
|
{{- with .Values.api.imagePullSecrets }}
|
|
imagePullSecrets:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
serviceAccountName: {{ include "vikunja.serviceAccountName" . }}
|
|
{{- with .Values.api.podSecurityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
containers:
|
|
- name: {{ .Chart.Name }}
|
|
{{- with .Values.api.securityContext }}
|
|
securityContext:
|
|
{{- toYaml . | nindent 10 }}
|
|
{{- end }}
|
|
{{- $image := required ".image.repository is not set" .Values.api.image.repository }}
|
|
{{- $tag := required ".image.tag is not set" .Values.api.image.tag }}
|
|
image: {{ printf "%s:%s" $image $tag | quote }}
|
|
imagePullPolicy: {{ .Values.api.image.pullPolicy }}
|
|
ports:
|
|
- name: http
|
|
containerPort: 5000
|
|
protocol: TCP
|
|
{{- with .Values.api.env }}
|
|
env:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.api.envFrom }}
|
|
envFrom:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.api.livenessProbe }}
|
|
livenessProbe:
|
|
{{- toYaml . | nindent 10 }}
|
|
{{- end }}
|
|
{{- with .Values.api.readinessProbe }}
|
|
readinessProbe:
|
|
{{- toYaml . | nindent 10 }}
|
|
{{- end }}
|
|
{{- with .Values.api.startupProbe }}
|
|
startupProbe:
|
|
{{- toYaml . | nindent 10 }}
|
|
{{- end }}
|
|
{{- with .Values.api.resources }}
|
|
resources:
|
|
{{- toYaml . | nindent 10 }}
|
|
{{- end }}
|
|
volumeMounts:
|
|
- name: tmp
|
|
mountPath: /tmp
|
|
- name: api-config
|
|
subPath: api-config.yaml
|
|
mountPath: /etc/vikunja/config.yaml
|
|
{{- if .Values.api.persistence.enabled }}
|
|
- name: storage
|
|
subPath: files
|
|
mountPath: {{ quote .Values.api.config.files.basepath }}
|
|
{{- if eq .Values.api.config.database.type "sqlite" }}
|
|
- name: storage
|
|
subPath: sqlite
|
|
mountPath: {{ base .Values.api.config.database.path | quote }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- with .Values.api.extraVolumeMounts }}
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
volumes:
|
|
- name: tmp
|
|
emptyDir: {}
|
|
- name: api-config
|
|
secret:
|
|
secretName: {{ include "vikunja.fullname" . }}
|
|
defaultMode: 0644
|
|
{{- if .Values.api.persistence.enabled }}
|
|
- name: storage
|
|
persistentVolumeClaim:
|
|
claimName: {{ include "vikunja.apiFullname" . }}
|
|
{{- end }}
|
|
{{- with .Values.api.extraVolumes }}
|
|
{{- toYaml . | nindent 6 }}
|
|
{{- end }}
|
|
{{- with .Values.api.nodeSelector }}
|
|
nodeSelector:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.api.affinity }}
|
|
affinity:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|
|
{{- with .Values.api.tolerations }}
|
|
tolerations:
|
|
{{- toYaml . | nindent 8 }}
|
|
{{- end }}
|