django-helm-chart/templates/deployment.yaml
David Burke 308366ca60 beat
2020-02-09 16:56:26 -05:00

91 lines
3.1 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: {{ include "glitchtip.fullname" . }}
labels:
{{- include "glitchtip.labels" . | nindent 4 }}
spec:
replicas: {{ .Values.web.replicaCount }}
selector:
matchLabels:
{{- include "glitchtip.selectorLabels" . | nindent 6 }}
role: web
template:
metadata:
annotations:
checksum/secret: {{ include (print $.Template.BasePath "/secrets.yaml") . | sha256sum }}
labels:
{{- include "glitchtip.selectorLabels" . | nindent 8 }}
role: web
spec:
{{- with .Values.imagePullSecrets }}
imagePullSecrets:
{{- toYaml . | nindent 8 }}
{{- end }}
serviceAccountName: {{ include "glitchtip.serviceAccountName" . }}
securityContext:
{{- toYaml .Values.podSecurityContext | nindent 8 }}
containers:
- name: {{ .Chart.Name }}
securityContext:
{{- toYaml .Values.securityContext | nindent 12 }}
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
ports:
- name: http
containerPort: 8080
protocol: TCP
livenessProbe:
failureThreshold: {{ .Values.web.livenessProbe.failureThreshold }}
httpGet:
path: /_health/
port: 8080
initialDelaySeconds: {{ .Values.web.livenessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.web.livenessProbe.timeoutSeconds }}
readinessProbe:
failureThreshold: {{ .Values.web.readinessProbe.failureThreshold }}
httpGet:
path: /_health/
port: 8080
initialDelaySeconds: {{ .Values.web.readinessProbe.initialDelaySeconds }}
timeoutSeconds: {{ .Values.web.readinessProbe.timeoutSeconds }}
resources:
{{- toYaml .Values.web.resources | nindent 12 }}
env:
- name: DEBUG
value: "False"
- name: STATIC_URL
value: /
- name: ENABLE_SOCIAL_AUTH
value: {{ .Values.enableSocialAuth | quote }}
{{- if .Values.redisURL }}
- name: REDIS_URL
value: {{ .Values.redisURL }}
{{- end }}
{{- if .Values.redis.enabled }}
- name: REDIS_PASSWORD
valueFrom:
secretKeyRef:
key: redis-password
name: {{ include "glitchtip.fullname" . }}-glitchtip-redis
- name: REDIS_HOST
value: {{ template "glitchtip.redis.host" . }}
- name: REDIS_PORT
value: {{ template "glitchtip.redis.port" . }}
{{- end }}
envFrom:
- secretRef:
name: {{ include "glitchtip.fullname" . }}
{{- with .Values.web.nodeSelector }}
nodeSelector:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.web.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.web.tolerations }}
tolerations:
{{- toYaml . | nindent 8 }}
{{- end }}