azkv-external-secret.yaml 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. apiVersion: external-secrets.io/v1
  2. kind: ExternalSecret
  3. metadata:
  4. name: database-credentials
  5. spec:
  6. refreshInterval: 1h
  7. secretStoreRef:
  8. kind: SecretStore
  9. name: azure-store
  10. target:
  11. name: database-credentials
  12. creationPolicy: Owner
  13. data:
  14. # name of the SECRET in the Azure KV (no prefix is by default a SECRET)
  15. - secretKey: database-username
  16. remoteRef:
  17. key: database-username
  18. # explicit type and name of secret in the Azure KV
  19. - secretKey: database-password
  20. remoteRef:
  21. key: secret/database-password
  22. # metadataPolicy to fetch all the tags in JSON format
  23. - secretKey: database-credentials-metadata
  24. remoteRef:
  25. key: database-credentials
  26. metadataPolicy: Fetch
  27. # metadataPolicy to fetch a specific tag which name must be in property
  28. - secretKey: database-credentials
  29. remoteRef:
  30. key: database-credentials
  31. metadataPolicy: Fetch
  32. property: environment
  33. # type/name of certificate in the Azure KV
  34. # raw value will be returned, use templating features for data processing
  35. - secretKey: db-client-cert
  36. remoteRef:
  37. key: cert/db-client-cert
  38. # type/name of the public key in the Azure KV
  39. # the key is returned PEM encoded
  40. - secretKey: encryption-pubkey
  41. remoteRef:
  42. key: key/encryption-pubkey