apiVersion: apps/v1 kind: Deployment metadata: name: "{{ $.Release.Name }}-{{ $.Chart.Name }}" labels: app.kubernetes.io/name: {{ $.Chart.Name }} app.kubernetes.io/instance: {{ $.Release.Name }} app.kubernetes.io/version: {{ $.Chart.AppVersion | quote }} spec: replicas: {{ $.Values.replicaCount }} selector: matchLabels: app.kubernetes.io/name: {{ $.Chart.Name }} app.kubernetes.io/instance: {{ $.Release.Name }} template: metadata: labels: app.kubernetes.io/name: {{ $.Chart.Name }} app.kubernetes.io/instance: {{ $.Release.Name }} spec: {{- with $.Values.imagePullSecrets }} imagePullSecrets: {{- toYaml . | nindent 8 }} {{- end }} securityContext: {{- toYaml $.Values.podSecurityContext | nindent 8 }} containers: - name: {{ $.Chart.Name }} securityContext: {{- toYaml $.Values.securityContext | nindent 12 }} image: "{{ $.Values.image.name }}:{{ default $.Chart.AppVersion $.Values.image.tag }}" imagePullPolicy: {{ $.Values.image.pullPolicy }} ports: - name: http containerPort: {{ $.Values.port }} protocol: TCP livenessProbe: httpGet: path: / port: http initialDelaySeconds: 5 periodSeconds: 10 readinessProbe: httpGet: path: / port: http initialDelaySeconds: 3 periodSeconds: 10 {{- if $.Values.resources }} resources: {{- toYaml $.Values.resources | nindent 12 }} {{- end }}