# services/maintenance/secretproviderclass.yaml
apiVersion: secrets-store.csi.x-k8s.io/v1
kind: SecretProviderClass
metadata:
  name: maintenance-vault
  namespace: maintenance
spec:
  provider: vault
  parameters:
    vaultAddress: "http://vault.vault.svc.cluster.local:8200"
    roleName: "maintenance"
    objects: |
      - objectName: "harbor-pull__dockerconfigjson"
        secretPath: "kv/data/atlas/shared/harbor-pull"
        secretKey: "dockerconfigjson"
      - objectName: "soteria-restic__AWS_ACCESS_KEY_ID"
        secretPath: "kv/data/atlas/shared/soteria-restic"
        secretKey: "AWS_ACCESS_KEY_ID"
      - objectName: "soteria-restic__AWS_SECRET_ACCESS_KEY"
        secretPath: "kv/data/atlas/shared/soteria-restic"
        secretKey: "AWS_SECRET_ACCESS_KEY"
      - objectName: "soteria-restic__RESTIC_PASSWORD"
        secretPath: "kv/data/atlas/shared/soteria-restic"
        secretKey: "RESTIC_PASSWORD"
      - objectName: "soteria-restic__AWS_ENDPOINTS"
        secretPath: "kv/data/atlas/shared/soteria-restic"
        secretKey: "AWS_ENDPOINTS"
  secretObjects:
    - secretName: harbor-regcred
      type: kubernetes.io/dockerconfigjson
      data:
        - objectName: harbor-pull__dockerconfigjson
          key: .dockerconfigjson
    - secretName: soteria-restic
      type: Opaque
      data:
        - objectName: soteria-restic__AWS_ACCESS_KEY_ID
          key: AWS_ACCESS_KEY_ID
        - objectName: soteria-restic__AWS_SECRET_ACCESS_KEY
          key: AWS_SECRET_ACCESS_KEY
        - objectName: soteria-restic__RESTIC_PASSWORD
          key: RESTIC_PASSWORD
        - objectName: soteria-restic__AWS_ENDPOINTS
          key: AWS_ENDPOINTS
