Interview Prep/CI/CD/Secrets and Credentials

How do you store secrets in Git safely for GitOps?

IntermediateProductionSecrets and Credentials
Answer

Never commit plaintext. Options: External Secrets Operator (Git holds only an ExternalSecret that references a path in Vault or AWS Secrets Manager), Sealed Secrets (encrypt with a cluster public key; only the cluster controller can decrypt), or SOPS with KMS/age keys (encrypted values in YAML, decrypted by Flux or an Argo CD plugin). We prefer External Secrets because rotation happens in the secret manager with no Git change.

apiVersion: external-secrets.io/v1beta1
kind: ExternalSecret
metadata: { name: db-creds }
spec:
  secretStoreRef: { name: aws-sm, kind: ClusterSecretStore }
  target: { name: db-creds }
  data:
    - secretKey: password
      remoteRef: { key: prod/shop/db, property: password }
All CI/CD questions

More on Secrets and Credentials