Skip to content
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

feat: support workload identity #1798

Merged
merged 2 commits into from
Mar 18, 2025

Conversation

cvvz
Copy link
Member

@cvvz cvvz commented Jan 20, 2025

What type of PR is this?
/kind feature

What this PR does / why we need it:
The previous implementation of supporting workload identity is to use workload identity to retrieve account key for mounting. Since blobfuse2 has supported workload identity authentication, we can use workload identity to directly mount without retrieving account key.

Which issue(s) this PR fixes:

Fixes #

Requirements:

Special notes for your reviewer:

Release note:

feat: support original workload identity for blobfuse2 (without retrieve account key)

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 20, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 20, 2025
@cvvz cvvz changed the title Support workload identity [WIP] Support workload identity Jan 20, 2025
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2025
@acortelyou
Copy link
Contributor

Really glad to see some progress on this feature!

I know it's WIP so perhaps you're already planning to address, but I wanted to mention that the token audience varies by cloud so that will need to be dynamic or configurable.

eg:

var azureTokenExchange = {
  AzureCloud:         'api://AzureADTokenExchange'
  AzureUSGovernment:  'api://AzureADTokenExchangeUSGov'
  AzureChinaCloud:    'api://AzureADTokenExchangeChina'
}[environment().name]

@cvvz
Copy link
Member Author

cvvz commented Mar 17, 2025

I've went through the doc docs/workload-identity-static-pv-mount.md to test with the latest blobfuse2 version v2.4.1 on AKS and checked blobfuse2 and csi driver logs. It worked fine.
image

image
I've removed the WIP label.
cc @andyzhangx

@cvvz cvvz changed the title [WIP] Support workload identity Support workload identity Mar 17, 2025
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 17, 2025
@cvvz
Copy link
Member Author

cvvz commented Mar 17, 2025

@acortelyou Thanks for your kindly reminder. We will keep the token audience unchanged in this PR. And we are discussing whether it should be changed by cloud. If so, we will file another pr to fix it (not only in blob driver but also azurefile driver).

@cvvz
Copy link
Member Author

cvvz commented Mar 17, 2025

/retest

@andyzhangx andyzhangx changed the title Support workload identity feat: support workload identity Mar 17, 2025

// parseServiceAccountToken parses the bound service account token from the token passed from NodePublishVolume Request.
// ref: https://kubernetes-csi.github.io/docs/token-requests.html
func parseServiceAccountToken(tokenStr string) (string, error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you add the ut?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pls add the ut in another PR

Copy link
Member

@andyzhangx andyzhangx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 18, 2025
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: andyzhangx, cvvz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2025
@andyzhangx
Copy link
Member

/retest

@k8s-ci-robot k8s-ci-robot merged commit 452606b into kubernetes-sigs:master Mar 18, 2025
22 checks passed
@andyzhangx
Copy link
Member

/cherrypick release-1.26

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #1888

In response to this:

/cherrypick release-1.26

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@andyzhangx
Copy link
Member

/cherrypick release-1.25

@k8s-infra-cherrypick-robot

@andyzhangx: new pull request created: #1889

In response to this:

/cherrypick release-1.25

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants