bitwarden-secret.yaml 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  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. service_account_key: |-
  25. {{ .service_account_key }}
  26. data:
  27. - secretKey: username
  28. sourceRef:
  29. storeRef:
  30. name: bitwarden-login
  31. kind: ClusterSecretStore # or SecretStore
  32. remoteRef:
  33. key: aaaabbbb-cccc-dddd-eeee-000011112222
  34. property: username
  35. - secretKey: password
  36. sourceRef:
  37. storeRef:
  38. name: bitwarden-login
  39. kind: ClusterSecretStore # or SecretStore
  40. remoteRef:
  41. key: aaaabbbb-cccc-dddd-eeee-000011112222
  42. property: password
  43. - secretKey: postgres_password
  44. sourceRef:
  45. storeRef:
  46. name: bitwarden-fields
  47. kind: ClusterSecretStore # or SecretStore
  48. remoteRef:
  49. key: aaaabbbb-cccc-dddd-eeee-000011112222
  50. property: admin-password
  51. - secretKey: postgres_replication_password
  52. sourceRef:
  53. storeRef:
  54. name: bitwarden-fields
  55. kind: ClusterSecretStore # or SecretStore
  56. remoteRef:
  57. key: aaaabbbb-cccc-dddd-eeee-000011112222
  58. property: postgres-replication-password
  59. - secretKey: service_account_key
  60. sourceRef:
  61. storeRef:
  62. name: bitwarden-notes
  63. kind: ClusterSecretStore # or SecretStore
  64. remoteRef:
  65. key: service_account_key
  66. {% endraw %}