Open calmzhu opened 3 months ago
hi @calmzhu . This is intended. If oyu dont provide a namespace, you are referring the authentication to the namespace of the externalSecret object. In this case, you need to have a service account per namespace.
if you want to allow the same access for all ExternalSecrets, adding the namespace is mandatory
Describe the bug
ExternalSecret cannot create when use ClusterSecretStore(vault provider and kubernetes auth)
cannot request Kubernetes service account token for service account "xxxxx": serviceaccounts "xxxx" not found
To Reproduce
and left ClusterSecretStore.spec.provider.vault.auth.kubernetes.serviceAccountRef.namespace be comment
create external secret with above ClusterSecretStore
apply above ExternalSecret yaml to different namespace. external secrets only synced success in serviceAccount's namespace cso
for test1 and test2 namespace got error
cannot request Kubernetes service account token for service account "vault-secret-store-reader": serviceaccounts "vault-secret-store-reader" not found
Expected behavior extenal secrt create success in all namespace
Additional context
After uncomment ClusterSecretStore.spec.provider.vault.auth.kubernetes.serviceAccountRef.namespace to explicitly set service account's namespace. all ExternalSecret Create Success.
As documents described: The ClusterSecretStore is a cluster scoped SecretStore that can be referenced by all ExternalSecrets from all namespaces. Use it to offer a central gateway to your secret backend. ,the same ClusterStore should behave exactly the same in different namespace