apiVersion: apps/v1 kind: Deployment metadata: name: {{ .Values.app.name }} labels: app: {{ .Values.app.name }} spec: replicas: {{ .Values.app.replicaCount }} revisionHistoryLimit: 3 selector: matchLabels: app: {{ .Values.app.name }} template: metadata: labels: app: {{ .Values.app.name }} {{- with .Values.podAnnotations }} annotations: {{- toYaml . | nindent 8 }} {{- end }} spec: {{- with .Values.securityContext }} securityContext: {{- toYaml . | nindent 8 }} {{- end }} containers: - name: {{ .Values.app.name }} image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}" imagePullPolicy: {{ .Values.image.pullPolicy }} ports: - name: http containerPort: {{ .Values.service.targetPort }} protocol: TCP volumeMounts: - name: config-volume mountPath: /etc/config readOnly: true env: - name: JAVA_OPTS value: "-Xmx512m -Xms256m" {{- with .Values.resources }} resources: {{- toYaml . | nindent 12 }} {{- end }} livenessProbe: httpGet: path: /actuator/health port: http initialDelaySeconds: 30 periodSeconds: 10 readinessProbe: httpGet: path: /actuator/health port: http initialDelaySeconds: 5 periodSeconds: 5 volumes: - name: config-volume configMap: name: {{ .Values.app.name }}-config {{- with .Values.nodeSelector }} nodeSelector: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.affinity }} affinity: {{- toYaml . | nindent 8 }} {{- end }} {{- with .Values.tolerations }} tolerations: {{- toYaml . | nindent 8 }} {{- end }}