{{- if eq .Values.kind "StatefulSet" }} {{- $svc_name := tpl .Values.templates.service . }} apiVersion: apps/v1 kind: StatefulSet metadata: labels: application: {{ .Values.application.name }} name: {{ tpl .Values.templates.deployment . }} {{- if .Values.clustered }} annotations: {{- include "drainer.pod" . | nindent 6 }} {{- end }} spec: revisionHistoryLimit: 2 selector: matchLabels: application: {{ .Values.application.name }} {{- if .Values.clustered }} podManagementPolicy: OrderedReady replicas: {{ .Values.application.replicas }} {{- else }} replicas: 1 {{- end }} serviceName: {{ $svc_name }} template: metadata: # trigger deployments on config map changes annotations: configmap/checksum: {{ include (print $.Template.BasePath "/configmap.yaml") . | sha256sum }} labels: application: {{ .Values.application.name }} deployment: {{ tpl .Values.templates.deployment . }} app: {{ .Values.application.name }} name: {{ tpl .Values.templates.deployment . }} spec: {{- include "amq.pod" . | nindent 6 }} {{- if .Values.application.persistent }} volumeClaimTemplates: - apiVersion: v1 kind: PersistentVolumeClaim metadata: name: {{ tpl .Values.templates.pvc_name . }} spec: accessModes: [ "ReadWriteOnce" ] resources: requests: storage: {{ .Values.application.volume_capacity }} storageClassName: "{{ .Values.application.storageclass }}" {{- end }} {{- end }}