feat(azure): support Azure workload identity via projected service account token#816
Open
rkthtrifork wants to merge 1 commit intocloudnative-pg:mainfrom
Open
feat(azure): support Azure workload identity via projected service account token#816rkthtrifork wants to merge 1 commit intocloudnative-pg:mainfrom
rkthtrifork wants to merge 1 commit intocloudnative-pg:mainfrom
Conversation
Signed-off-by: rkthtrifork <rkth@trifork.com>
1faa68d to
2a70f54
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds Azure workload identity support for plugin-managed CNPG sidecars by projecting a service account token with the Azure audience into the sidecar pod when
azureCredentials.useDefaultAzureCredentials: trueis configured.This keeps the existing AKS managed identity flow unchanged:
inheritFromAzureAD: truestill uses the managed identity / IMDS pathuseDefaultAzureCredentials: truenow supports workload identity by exposingAZURE_FEDERATED_TOKEN_FILEand the projected token toDefaultAzureCredentialChanges
ObjectStoreusesuseDefaultAzureCredentialsAZURE_FEDERATED_TOKEN_FILEfor the sidecarAZURE_FEDERATED_TOKEN_FILEBehavior
With this change:
useDefaultAzureCredentials: truethe plugin sidecar gets:
api://AzureADTokenExchangeAZURE_FEDERATED_TOKEN_FILE=/var/run/secrets/azure/tokens/azure-identity-tokeninheritFromAzureAD: truebehavior is unchanged and no federated token volume is injected
This means clusters using the older implicit AKS managed identity flow remain supported, while clusters using Azure workload identity can now work without relying on an external injector to provide the token file.