full-cluster-secret-store.yaml 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. apiVersion: external-secrets.io/v1beta1
  2. kind: ClusterSecretStore
  3. metadata:
  4. name: example
  5. spec:
  6. # Used to select the correct ESO controller (think: ingress.ingressClassName)
  7. # The ESO controller is instantiated with a specific controller name
  8. # and filters ES based on this property
  9. # Optional
  10. controller: dev
  11. # provider field contains the configuration to access the provider
  12. # which contains the secret exactly one provider must be configured.
  13. provider:
  14. # (1): AWS Secrets Manager
  15. # aws configures this store to sync secrets using AWS Secret Manager provider
  16. aws:
  17. service: SecretsManager
  18. # Role is a Role ARN which the SecretManager provider will assume
  19. role: iam-role
  20. # AWS Region to be used for the provider
  21. region: eu-central-1
  22. # Auth defines the information necessary to authenticate against AWS
  23. auth:
  24. # Getting the accessKeyID and secretAccessKey from an already created Kubernetes Secret
  25. secretRef:
  26. accessKeyIDSecretRef:
  27. name: awssm-secret
  28. key: access-key
  29. secretAccessKeySecretRef:
  30. name: awssm-secret
  31. key: secret-access-key
  32. # IAM roles for service accounts
  33. # https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html
  34. jwt:
  35. serviceAccountRef:
  36. name: my-serviceaccount
  37. namespace: sa-namespace
  38. vault:
  39. server: "https://vault.acme.org"
  40. # Path is the mount path of the Vault KV backend endpoint
  41. # Used as a path prefix for the external secret key
  42. path: "secret"
  43. # Version is the Vault KV secret engine version.
  44. # This can be either "v1" or "v2", defaults to "v2"
  45. version: "v2"
  46. # vault enterprise namespace: https://www.vaultproject.io/docs/enterprise/namespaces
  47. namespace: "a-team"
  48. # base64 encoded string of certificate
  49. caBundle: "..."
  50. # Instead of caBundle you can also specify a caProvider
  51. # this will retrieve the cert from a Secret or ConfigMap
  52. caProvider:
  53. # Can be Secret or ConfigMap
  54. type: "Secret"
  55. # namespace is mandatory for ClusterSecretStore and not relevant for SecretStore
  56. namespace: "my-cert-secret-namespace"
  57. name: "my-cert-secret"
  58. key: "cert-key"
  59. auth:
  60. # static token: https://www.vaultproject.io/docs/auth/token
  61. tokenSecretRef:
  62. name: "my-secret"
  63. namespace: "secret-admin"
  64. key: "vault-token"
  65. # AppRole auth: https://www.vaultproject.io/docs/auth/approle
  66. appRole:
  67. path: "approle"
  68. # Instead of referencing the AppRole's ID from the secret, you can also specify it directly
  69. # roleId: "db02de05-fa39-4855-059b-67221c5c2f63"
  70. roleRef:
  71. name: "my-secret"
  72. namespace: "secret-admin"
  73. key: "vault-role-id"
  74. secretRef:
  75. name: "my-secret"
  76. namespace: "secret-admin"
  77. key: "vault-role-secret"
  78. # Kubernetes auth: https://www.vaultproject.io/docs/auth/kubernetes
  79. kubernetes:
  80. mountPath: "kubernetes"
  81. role: "demo"
  82. # Optional service account reference
  83. serviceAccountRef:
  84. name: "my-sa"
  85. namespace: "secret-admin"
  86. # Optional secret field containing a Kubernetes ServiceAccount JWT
  87. # used for authenticating with Vault
  88. secretRef:
  89. name: "my-secret"
  90. namespace: "secret-admin"
  91. key: "vault"
  92. # (2): GCP Secret Manager
  93. gcpsm:
  94. # Auth defines the information necessary to authenticate against GCP by getting
  95. # the credentials from an already created Kubernetes Secret.
  96. auth:
  97. secretRef:
  98. secretAccessKeySecretRef:
  99. name: gcpsm-secret
  100. key: secret-access-credentials
  101. namespace: example
  102. projectID: myproject
  103. # (3): Kubernetes provider
  104. kubernetes:
  105. server:
  106. url: "https://myapiserver.tld"
  107. caProvider:
  108. type: Secret
  109. name: my-cluster-secrets
  110. namespace: example
  111. key: ca.crt
  112. auth:
  113. serviceAccount:
  114. name: "example-sa"
  115. namespace: "example"
  116. # (4): Oracle provider
  117. oracle:
  118. # The vault OCID
  119. vault: ocid1.vault.oc1.eu-frankfurt-1.aaa1aaaaaaaaa.aaaaaaaaaaaaaa1aaaaaaa111aaaaaaaaaaaaaaaa
  120. # The vault region
  121. region: eu-frankfurt-1
  122. auth:
  123. # The user OCID
  124. user: ocid1.user.oc1..aaa1aaaaaaaaa.aaaaaaaaaaaaaa1aaaaaaa111aaaaaaaaaaaaaaaa
  125. # The tenancy OCID
  126. tenancy: ocid1.tenancy.oc1..aaa1aaaaaaaaa.aaaaaaaaaaaaaa1aaaaaaa111aaaaaaaaaaaaaaaa
  127. secretRef:
  128. privatekey:
  129. # The secret that contains your privatekey
  130. name: oci-secret-name
  131. key: privateKey
  132. namespace: example-namespace
  133. fingerprint:
  134. # The secret that contains your fingerprint
  135. name: oci-secret-name
  136. key: fingerprint
  137. namespace: example-namespace
  138. # (TODO): add more provider examples here
  139. # Conditions about namespaces in which the ClusterSecretStore is usable for ExternalSecrets
  140. conditions:
  141. # Options are namespaceSelector, namespaces or namespacesRegex
  142. - namespaceSelector:
  143. matchLabels:
  144. my.namespace.io/some-label: "value" # Only namespaces with that label will work
  145. - namespaces:
  146. - "namespace-a"
  147. - "namespace-b"
  148. # Namespace regexes are useful for policy management or when external tools auto-generate namespaces with prefixes/suffixes
  149. - namespaceRegexes:
  150. - "namespace-a-.*" # All namespaces prefixed by namespace-a- will work
  151. - "namespace-b-.*" # All namespaces prefixed by namespace-b- will work
  152. # conditions needs only one of the conditions to meet for the CSS to be usable in the namespace.
  153. status:
  154. # Standard condition schema
  155. conditions:
  156. # SecretStore ready condition indicates the given store is in ready
  157. # state and able to referenced by ExternalSecrets
  158. # If the `status` of this condition is `False`, ExternalSecret controllers
  159. # should prevent attempts to fetch secrets
  160. - type: Ready
  161. status: "False"
  162. reason: "ConfigError"
  163. message: "SecretStore validation failed"
  164. lastTransitionTime: "2019-08-12T12:33:02Z"