| 1 |
apiVersion: apps/v1 |
| 2 |
kind: Deployment |
| 3 |
metadata: |
| 4 |
name: {{ include "helm.fullname" . }} |
| 5 |
labels: |
| 6 |
{{- include "helm.labels" . | nindent 4 }} |
| 7 |
spec: |
| 8 |
replicas: {{ .Values.replicaCount }} |
| 9 |
selector: |
| 10 |
matchLabels: |
| 11 |
{{- include "helm.selectorLabels" . | nindent 6 }} |
| 12 |
template: |
| 13 |
metadata: |
| 14 |
labels: |
| 15 |
{{- include "helm.selectorLabels" . | nindent 8 }} |
| 16 |
spec: |
| 17 |
{{- with .Values.imagePullSecrets }} |
| 18 |
imagePullSecrets: |
| 19 |
{{- toYaml . | nindent 8 }} |
| 20 |
{{- end }} |
| 21 |
serviceAccountName: {{ include "helm.serviceAccountName" . }} |
| 22 |
securityContext: |
| 23 |
{{- toYaml .Values.podSecurityContext | nindent 8 }} |
| 24 |
containers: |
| 25 |
- name: {{ .Chart.Name }} |
| 26 |
securityContext: |
| 27 |
{{- toYaml .Values.securityContext | nindent 12 }} |
| 28 |
image: "{{ .Values.image.repository }}:{{ .Chart.AppVersion }}" |
| 29 |
imagePullPolicy: {{ .Values.image.pullPolicy }} |
| 30 |
{{- if .Values.envs }} |
| 31 |
env: |
| 32 |
{{- range $key, $val := .Values.envs }} |
| 33 |
- name: {{ $key | quote }} |
| 34 |
value: {{ $val | quote }} |
| 35 |
{{- end }} |
| 36 |
{{- end }} |
| 37 |
ports: |
| 38 |
- name: http |
| 39 |
containerPort: 8080 |
| 40 |
protocol: TCP |
| 41 |
livenessProbe: |
| 42 |
httpGet: |
| 43 |
path: /healthz |
| 44 |
port: http |
| 45 |
initialDelaySeconds: 2 |
| 46 |
periodSeconds: 60 |
| 47 |
readinessProbe: |
| 48 |
httpGet: |
| 49 |
path: /healthz |
| 50 |
port: http |
| 51 |
resources: |
| 52 |
{{- toYaml .Values.resources | nindent 12 }} |
| 53 |
{{- with .Values.nodeSelector }} |
| 54 |
nodeSelector: |
| 55 |
{{- toYaml . | nindent 8 }} |
| 56 |
{{- end }} |
| 57 |
{{- with .Values.affinity }} |
| 58 |
affinity: |
| 59 |
{{- toYaml . | nindent 8 }} |
| 60 |
{{- end }} |
| 61 |
{{- with .Values.tolerations }} |
| 62 |
tolerations: |
| 63 |
{{- toYaml . | nindent 8 }} |
| 64 |
{{- end }} |