-
Notifications
You must be signed in to change notification settings - Fork 145
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 setting in static PV mount #1566
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls provide brief description in PR, .e.g.
what new fields are introduced
what protocol is supported
dynamic provisioning (storage class) is not supported, etc.
|
||
## prerequisite | ||
|
||
### 1. Create a cluster with oidc-issuer enabled |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
there is already doc here: https://github.com/kubernetes-sigs/azurefile-csi-driver/blob/master/docs/workload-identity.md, it's better removing redundant doc steps otherwise we need to maintain two doc pages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Basically, these are two very different features for different purpose although they both use federated workload identity and actually there are very few common steps between these two docs and maintain two docs should be better.
btw, |
az aks get-credentials -n $CLUSTER_NAME -g $RESOURCE_GROUP --overwrite-existing | ||
``` | ||
|
||
### 2. Create a storage account and fileshare (or use your own storage account and fileshare) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove the account creation steps
|
||
az group create --name $RESOURCE_GROUP --location $REGION | ||
|
||
az aks create -n $CLUSTER_NAME -g $RESOURCE_GROUP --enable-oidc-issuer |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's only mention --enable-oidc-issuer
should be specified for cluster creation.
pkg/azurefile/nodeserver.go
Outdated
@@ -59,6 +59,19 @@ func (d *Driver) NodePublishVolume(ctx context.Context, req *csi.NodePublishVolu | |||
mountPermissions := d.mountPermissions | |||
context := req.GetVolumeContext() | |||
if context != nil { | |||
// token request | |||
if context[serviceAccountTokenField] != "" && context[clientIDField] != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clientID
is a user input parameter, since all user input parameters are not case sensitive, suggest using a func to check whether it's a token request
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I use a func to check the clientIDField for both upper and lower case.
pkg/azurefile/nodeserver.go
Outdated
@@ -155,6 +168,12 @@ func (d *Driver) NodeStageVolume(ctx context.Context, req *csi.NodeStageVolumeRe | |||
|
|||
volumeID := req.GetVolumeId() | |||
context := req.GetVolumeContext() | |||
|
|||
if context[serviceAccountTokenField] == "" && context[clientIDField] != "" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
clientID
is a user input parameter, since all user input parameters are not case sensitive, suggest using a func to check whether it's a token request
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pls squash all commits, it lgtm in general.
pkg/azurefile/azurefile.go
Outdated
@@ -765,8 +778,16 @@ func (d *Driver) GetAccountInfo(ctx context.Context, volumeID string, secrets, r | |||
} | |||
} | |||
|
|||
// if client id is specified, we only use service account token to get account key | |||
if clientID != "" { | |||
klog.Info("clientID is specified, use service account token to get account key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
klog.V(2).Infof("clientID(%s) is specified, use service account token to get account key", clientID)
commit 15c7f99 Merge: 8388a01 7fe3ebc Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 27 09:37:50 2023 +0000 Merge branch 'master' of https://github.com/kubernetes-sigs/azurefile-csi-driver into workload-identity commit 8388a01 Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 27 09:33:51 2023 +0000 fix commit 44c4812 Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 27 06:15:20 2023 +0000 fix commit 09e5b67 Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 27 04:00:47 2023 +0000 fix commit 354f4d7 Author: weizhichen <weizhichen@microsoft.com> Date: Tue Dec 26 08:29:07 2023 +0000 helm commit 960912d Merge: 0c58154 5dd86f5 Author: weizhichen <weizhichen@microsoft.com> Date: Tue Dec 26 08:00:51 2023 +0000 Merge branch 'master' of https://github.com/kubernetes-sigs/azurefile-csi-driver into workload-identity commit 0c58154 Merge: e3adfa4 d519073 Author: weizhichen <weizhichen@microsoft.com> Date: Mon Dec 18 02:18:53 2023 +0000 Merge branch 'master' of https://github.com/kubernetes-sigs/azurefile-csi-driver into workload-identity commit e3adfa4 Author: weizhichen <weizhichen@microsoft.com> Date: Thu Dec 14 03:17:25 2023 +0000 spell commit 78c82b5 Author: weizhichen <weizhichen@microsoft.com> Date: Thu Dec 14 03:09:16 2023 +0000 doc commit 7bb959f Author: weizhichen <weizhichen@microsoft.com> Date: Thu Dec 14 03:05:08 2023 +0000 doc commit 2dde59d Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 13 14:45:37 2023 +0000 doc commit e774ff5 Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 13 13:46:37 2023 +0000 update go mod commit 2e79ca3 Merge: 7846026 6cfe218 Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 13 13:19:41 2023 +0000 Merge branch 'master' of https://github.com/kubernetes-sigs/azurefile-csi-driver into workload-identity commit 7846026 Author: weizhichen <weizhichen@microsoft.com> Date: Wed Dec 13 13:07:48 2023 +0000 update go mod commit 0446a46 Author: weizhichen <weizhichen@microsoft.com> Date: Fri Nov 24 08:52:03 2023 +0000 update cloud-provider-azure commit ff2aeb4 Author: weizhichen <weizhichen@microsoft.com> Date: Tue Nov 14 12:29:14 2023 +0000 doc commit 633641b Author: weizhichen <weizhichen@microsoft.com> Date: Tue Nov 14 12:01:02 2023 +0000 add docs commit afcb818 Author: weizhichen <weizhichen@microsoft.com> Date: Tue Nov 14 11:20:40 2023 +0000 feat: support workload identity setting in static PV mount on AKS
15c7f99
to
64c67e3
Compare
/retest |
1 similar comment
/retest |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
[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 |
/cherrypick release-1.29 |
@andyzhangx: #1566 failed to apply on top of branch "release-1.29":
In response to this:
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/test-infra repository. |
@cvvz can you cherrypick to release-1.29 and also make similar change in blob csi driver? thanks. |
@cvvz: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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/test-infra repository. I understand the commands that are listed here. |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes
Azure/AKS#3432
Azure/azure-storage-fuse#1049 (comment)
Requirements:
Special notes for your reviewer:
documentation: https://github.com/kubernetes-sigs/azurefile-csi-driver/pull/1566/files#diff-ba6bdf5d643d138b4a41b51808bf8041b48d4d519ebc3c511b4464d14a6ba639
Here are the csi driver's logs:
Release note: