{{ if .Values.secrets_manager.enabled }}
apiVersion: apps/v1
kind: Deployment
metadata:
  name: secrets-manager
spec:
  replicas: 1
  selector:
    matchLabels:
      app: secrets-manager
  template:
    metadata:
      name: secrets-manager
      labels:
        app: secrets-manager
    spec:
      terminationGracePeriodSeconds: 1
      containers:
      - name: secrets-manager
        image: docker.io/goalprofit/secrets-manager:{{.Values.secrets_manager.version}}
        imagePullPolicy: Always
        volumeMounts:
          - mountPath: /work
            name: work
            subPath: data/secrets-manager

      imagePullSecrets:
      - name: regcred
        {{ include "app.affinity" . | nindent 6}}

      volumes:
      - name: work
        {{ include "app.customer_volume" . | nindent 8}}
{{ end }}