dapr / dotnet-sdk

Dapr SDK for .NET

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AddDaprSecretStore() fails on Kubernetes

CraigTenn opened this issue · comments

Not sure if anyone else has seen this, but on a new kubernetes enviro with dapr 1.13.2 seeing a problem with AddDaprSecretStore(). Did not see this in local development only once deployed to kubernetes.

Expected Behavior

AddDaprSecretStore() should load secrets into the configuration

Actual Behavior

AddDaprSecretStore() on kubernetes throws an exception and fails, no secrets loaded

Steps to Reproduce the Problem

On a kubernetes enviro have a secret store setup and call AddDaprSecretStore(). No problems in the local environment. Also on kubernetes the daprClient.GetSecretAsync() call works correctly for the same secret store

Seems to be permission/account related with the bulk secret call. See error below

2024-04-23T02:02:31 -- Attempting to AddDaprSecretStore
2024-04-23T02:02:31 -- DAPR exception Bulk secret operation failed: the Dapr endpoint indicated a failure. See InnerException for details.
2024-04-23T02:02:31 -- DAPR exception Bulk secret operation failed: the Dapr endpoint indicated a failure. See InnerException for details. Inner: Status(StatusCode="Internal", Detail="failed getting secrets from secret store testsecretstore: secrets is forbidden: User "system:serviceaccount:default:default" cannot list resource "secrets" in API group "" in the namespace "default"")

This is unlikely to be an SDK issue as opposed to a Kubernetes and/or Dapr secrets configuration one. So the same application, accessing the same secret store, can successfully retrieve a single secret, but just not bulk secret?s Could you provide more information about how the application and secret store are configured? (In any case, as the underlying error is through the Dapr runtime, that an issue in that repo might provide better results.