-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support for multiple managed identities per Kubernetes pod #408
Comments
Azure/secrets-store-csi-driver-provider-azure#837 issue tracks the deprecation of User-assigned managed identity and System-assigned managed identity access modes only. AAD Pod Identity mode in secrets-store-csi-driver-provider-azure will be deprecated and removed after Workload Identity federation support with managed identity is available: #325. Workload identity to access keyvault is already supported with the Azure Key Vault Provider for Secrets Store CSI Driver: https://azure.github.io/secrets-store-csi-driver-provider-azure/docs/configurations/identity-access-modes/workload-identity-mode/. That doesn't require the webhook that's provided in this repo. It supports multiple identities and there is no 1:1 mapping.
Today, you can use multiple identities with the same pod. The annotation in the service account will be used to inject The mutating webhook provided as part of this repo enhances the experience by injecting some of the default env vars used by the SDK. That doesn't mean you're pod is limited to just that single identity annotated in the service account. Your app can provide the specific client ID as part of the token request and you can setup federated identity credential for each managed identity that's used by your workload. The same service account token can then be exchanged for a valid AAD token for the requested identity. |
Hello @aramase and thank you for the reply. We understand that pod managed identities are not deprecated as of yet, but the fact that they are already planned for removal means it is not something we wish to dedicate ourselves to at this point if we can avoid it. So if I understand you correctly, the If this is true, I thank you very much for clarifying the setup for us, and you are free to go ahead and close the issue. |
That's right! The webhook and annotations as part of this project aren't for the CSI driver. For Secrets Store CSI Driver, the client id configuration is part of SecretProviderClass and no annotation is required. If you're using workload identity for accessing other resources in addition to the Secrets Store CSI Driver, you can leverage the mutating webhook as part of this repo to facilitate setting up the projected service account token volume and other env vars that can be useful for your workload.
Thank you! I'll close this issue now. If you run into any issues with using workload identity + Azure Key Vault Provider for Secrets Store CSI Driver, feel free to open an issue here. If you have any questions specifically for the webhook or how to use workload identity, you can open an issue in this repo. |
Is your feature request related to a problem? Please describe.
We are currently using pod managed identities to control access between our workloads in Kubernetes and various Azure resources, such as SQL Server and Key Vault. We have resolved (for the time being) to using a single managed identity per Kubernetes pod, since multiple pod managed identities were not supported yet. It was, however, on the roadmap (Azure/secrets-store-csi-driver-provider-azure#284).
We were just about to make an attempt at a PR ourselves, but then we saw that pod managed identities were being deprecated (Azure/secrets-store-csi-driver-provider-azure#837). Thus, we have now begun looking into migrating to workload identity federation. We wish to ensure that our use cases are supported / can be supported - otherwise we need to rethink. Looking at your current documentation, it seems that there might be a 1-1 binding
between:
Describe the solution you'd like
Once managed identities are supported with workload identity federation, we would like the ability for a pod to use one of multiple managed identities depending on the resource it is trying to access at any given time. For instance:
This enables us to create a limited set of managed identities, each with a very restrictive set of permissions, and dynamically assign them to pods in Kubernetes depending on the needs of each individual pod. The less dependent we are on creating new managed identities for all kinds of permutations, the better in our opinion.
Describe alternatives you've considered
We have considered to instead rethink our model, and create a separate managed identity per pod in Kubernetes (or at least per permutation of permissions). However, we see some issues with this:
Additional context
We are not against changing our current design, but we would at least be interested in best practices for handling our use cases with workload identity federation in whichever form it is released in. We know that managed identities are not currently supported (#325). When they are, however, is there any chance that it might support some of our needs?
The text was updated successfully, but these errors were encountered: