apiVersion: apps/v1 kind: Deployment metadata: name: {{ template "testapp.fullname" . }}-srv labels: app: {{ template "testapp.name" . }}-srv chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" release: "{{ .Release.Name }}" heritage: "{{ .Release.Service }}" component: srv spec: replicas: {{ .Values.srv.replicas }} selector: matchLabels: app: {{ template "testapp.name" . }}-srv release: "{{ .Release.Name }}" component: srv template: metadata: annotations: {{- if .Values.srv.annotations }} {{ toYaml .Values.srv.annotations | indent 8 }} {{- end }} labels: app: {{ template "testapp.name" . }}-srv release: "{{ .Release.Name }}" component: srv spec: {{- if .Values.srv.schedulerName }} schedulerName: "{{ .Values.srv.schedulerName }}" {{- end }} {{- if .Values.srv.affinity }} affinity: {{ toYaml .Values.srv.affinity | indent 8 }} {{- end }} {{- if .Values.srv.nodeSelector }} nodeSelector: {{ toYaml .Values.srv.nodeSelector | indent 8 }} {{- end }} containers: - name: {{ template "testapp.fullname" . }}-srv image: "{{ .Values.images.srv.repository }}:{{ .Values.images.srv.tag }}" imagePullPolicy: {{ .Values.images.srv.pullPolicy }} ports: - name: http containerPort: 8080 protocol: TCP env: - name: DB_HOST value: {{ template "testapp.fullname" . }}-db.{{ .Release.Namespace }}.svc {{- range $key, $value := .Values.srv.env }} - name: {{ $key }} value: {{ $value | quote }} {{- end }} resources: {{ toYaml .Values.srv.resources | indent 10 }} {{- if .Values.srv.livenessProbe.enabled }} livenessProbe: httpGet: path: "/healthz" port: http initialDelaySeconds: {{ .Values.srv.livenessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.srv.livenessProbe.periodSeconds }} timeoutSeconds: {{ .Values.srv.livenessProbe.timeoutSeconds }} successThreshold: {{ .Values.srv.livenessProbe.successThreshold }} failureThreshold: {{ .Values.srv.livenessProbe.failureThreshold }} {{- end }} {{- if .Values.srv.readinessProbe.enabled }} readinessProbe: httpGet: path: "/healthz" port: http initialDelaySeconds: {{ .Values.srv.readinessProbe.initialDelaySeconds }} periodSeconds: {{ .Values.srv.readinessProbe.periodSeconds }} timeoutSeconds: {{ .Values.srv.readinessProbe.timeoutSeconds }} successThreshold: {{ .Values.srv.readinessProbe.successThreshold }} failureThreshold: {{ .Values.srv.readinessProbe.failureThreshold }} {{- end }}