k8s/app-chart/templates/codebattle_deployment.yaml
---
kind: Deployment
apiVersion: apps/v1
metadata:
name: "codebattle-deployment"
spec:
replicas: {{ .Values.codebattle.replicaCount }}
selector:
matchLabels:
app: "codebattle"
strategy:
rollingUpdate:
maxUnavailable: 0
maxSurge: 1
template:
metadata:
labels:
app: "codebattle"
spec:
{{- with .Values.codebattle.affinity }}
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: nginx
imagePullPolicy: "{{ .Values.nginx.image.imagePullPolicy }}"
image: "{{- if .Values.registry -}}{{ .Values.registry }}/{{- end -}}{{ .Values.nginx.image.repository }}:{{ .Values.version }}"
readinessProbe:
httpGet:
path: /health
port: 80
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
env:
- name: NGINX_SERVER_ADDRESS
value: 127.0.0.1
- name: codebattle
imagePullPolicy: "{{ .Values.codebattle.image.imagePullPolicy }}"
image: "{{- if .Values.registry -}}{{ .Values.registry }}/{{- end -}}{{ .Values.codebattle.image.repository }}:{{ .Values.version }}"
readinessProbe:
httpGet:
path: /health
port: 4000
initialDelaySeconds: 5
periodSeconds: 5
successThreshold: 1
command:
- make
- start
envFrom:
- secretRef:
name: codebattle-secrets
- configMapRef:
name: codebattle-env
optional: true
env:
- name: DEPLOYED_AT
value: {{ dateInZone "2006-01-02 15:04:05" (now) "UTC" }}