resources/flatgit.chart/templates/deployment.yaml
raw ยท 2592 bytes
apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "flatgit.fullname" . }}
labels:
{{- include "flatgit.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.replicaCount }}
strategy:
type: Recreate
selector:
matchLabels:
app.kubernetes.io/name: {{ include "flatgit.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
template:
metadata:
labels:
app.kubernetes.io/name: {{ include "flatgit.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
securityContext:
runAsNonRoot: {{ .Values.securityContext.runAsNonRoot }}
runAsUser: {{ .Values.securityContext.runAsUser }}
runAsGroup: {{ .Values.securityContext.runAsGroup }}
fsGroup: {{ .Values.securityContext.fsGroup }}
fsGroupChangePolicy: {{ .Values.securityContext.fsGroupChangePolicy | quote }}
containers:
- name: flatgit
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
args:
- daemon
- -c
- /etc/flatgit/config.json
env:
- name: TZ
value: {{ .Values.timezone | quote }}
- name: FLATGIT_WEBHOOK_SECRET
valueFrom:
secretKeyRef:
name: {{ include "flatgit.fullname" . }}-webhook
key: secret
ports:
- name: http
containerPort: 8080
volumeMounts:
- name: config
mountPath: /etc/flatgit
readOnly: true
- name: data
mountPath: {{ .Values.flatgit.dataDir }}
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 30
resources:
{{- toYaml .Values.resources | nindent 12 }}
volumes:
- name: config
configMap:
name: {{ include "flatgit.fullname" . }}-config
- name: data
{{- if .Values.persistence.enabled }}
persistentVolumeClaim:
claimName: {{ include "flatgit.fullname" . }}-data
{{- else }}
emptyDir: {}
{{- end }}