bitwarden-secret.yaml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {% raw %}
  2. apiVersion: external-secrets.io/v1beta1
  3. kind: ExternalSecret
  4. metadata:
  5. name: my-db-secrets
  6. namespace: default
  7. spec:
  8. target:
  9. name: my-db-secrets
  10. deletionPolicy: Delete
  11. template:
  12. type: Opaque
  13. data:
  14. username: |-
  15. {{ .username }}
  16. password: |-
  17. {{ .password }}
  18. postgres-password: |-
  19. {{ .postgres_password }}
  20. postgres-replication-password: |-
  21. {{ .postgres_replication_password }}
  22. db_url: |-
  23. postgresql://{{ .username }}:{{ .password }}@my-postgresql:5432/mydb
  24. data:
  25. - secretKey: username
  26. sourceRef:
  27. storeRef:
  28. name: bitwarden-login
  29. kind: ClusterSecretStore # or SecretStore
  30. remoteRef:
  31. key: aaaabbbb-cccc-dddd-eeee-000011112222
  32. property: username
  33. - secretKey: password
  34. sourceRef:
  35. storeRef:
  36. name: bitwarden-login
  37. kind: ClusterSecretStore # or SecretStore
  38. remoteRef:
  39. key: aaaabbbb-cccc-dddd-eeee-000011112222
  40. property: password
  41. - secretKey: postgres_password
  42. sourceRef:
  43. storeRef:
  44. name: bitwarden-fields
  45. kind: ClusterSecretStore # or SecretStore
  46. remoteRef:
  47. key: aaaabbbb-cccc-dddd-eeee-000011112222
  48. property: admin-password
  49. - secretKey: postgres_replication_password
  50. sourceRef:
  51. storeRef:
  52. name: bitwarden-fields
  53. kind: ClusterSecretStore # or SecretStore
  54. remoteRef:
  55. key: aaaabbbb-cccc-dddd-eeee-000011112222
  56. property: postgres-replication-password
  57. {% endraw %}