apiVersion: external-secrets.io/v1beta1
kind: SecretStore
metadata:
  name: dmz-infisical
  namespace: hf-suitecrm
  annotations:
    argocd.argoproj.io/sync-wave: "1"
spec:
  provider:
    infisical:
      hostAPI: http://infisical-infisical-standalone-infisical.platform-infisical.svc.cluster.local:8080
      auth:
        universalAuthCredentials:
          clientId:
            name: infisical-universal-auth
            key: clientId
          clientSecret:
            name: infisical-universal-auth
            key: clientSecret
      secretsScope:
        projectSlug: platform-kubernetes-pqmd
        environmentSlug: prod
        secretsPath: /tenants/pidoka/suitecrm
---
apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata:
  name: suitecrm-secret
  namespace: hf-suitecrm
  annotations:
    argocd.argoproj.io/sync-wave: "2"
spec:
  refreshInterval: 1h
  secretStoreRef:
    name: dmz-infisical
    kind: SecretStore
  target:
    name: suitecrm-secret
    creationPolicy: Merge
    deletionPolicy: Retain
  data:
    - secretKey: DB_HOST
      remoteRef:
        key: DB_HOST
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: DB_PORT
      remoteRef:
        key: DB_PORT
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: DB_NAME
      remoteRef:
        key: DB_NAME
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: DB_USER
      remoteRef:
        key: DB_USER
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: DB_PASSWORD
      remoteRef:
        key: DB_PASSWORD
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: SITE_URL
      remoteRef:
        key: SITE_URL
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_DATABASE
      remoteRef:
        key: MARIADB_DATABASE
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_USER
      remoteRef:
        key: MARIADB_USER
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_PASSWORD
      remoteRef:
        key: MARIADB_PASSWORD
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
    - secretKey: MARIADB_ROOT_PASSWORD
      remoteRef:
        key: MARIADB_ROOT_PASSWORD
        conversionStrategy: Default
        decodingStrategy: None
        metadataPolicy: None
