Skip to content

Commit 47fd29a

Browse files
committed
fix: disable UseInstanceMetadata for controller
1 parent cfec99a commit 47fd29a

File tree

4 files changed

+7
-10
lines changed

4 files changed

+7
-10
lines changed

charts/latest/blobfuse-csi-driver/templates/csi-blobfuse-controller.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,6 @@ spec:
9292
args:
9393
- "--v=5"
9494
- "--endpoint=$(CSI_ENDPOINT)"
95-
- "--nodeid=$(KUBE_NODE_NAME)"
9695
ports:
9796
- containerPort: 29622
9897
name: healthz

deploy/csi-blobfuse-controller.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,6 @@ spec:
8888
image: mcr.microsoft.com/k8s/csi/blobfuse-csi:latest
8989
args:
9090
- "--v=5"
91-
- "--endpoint=$(CSI_ENDPOINT)"
9291
- "--nodeid=$(KUBE_NODE_NAME)"
9392
ports:
9493
- containerPort: 29622

pkg/blobfuse/blobfuse.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,13 @@ func (d *Driver) Run(endpoint, kubeconfig string) {
7979
}
8080
d.cloud = cloud
8181

82+
if d.NodeID == "" {
83+
// Disable UseInstanceMetadata for controller to mitigate a timeout issue using IMDS
84+
// https://github.com/kubernetes-sigs/azuredisk-csi-driver/issues/168
85+
klog.Infoln("disable UseInstanceMetadata for controller")
86+
d.cloud.Config.UseInstanceMetadata = false
87+
}
88+
8289
d.mounter = &mount.SafeFormatAndMount{
8390
Interface: mount.New(""),
8491
Exec: mount.NewOsExec(),

pkg/blobfuse/controllerserver.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,6 @@ func (d *Driver) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequest)
8181
resourceGroup = d.cloud.ResourceGroup
8282
}
8383

84-
// Disable UseInstanceMetadata to mitigate a timeout issue from IMDS
85-
// https://github.com/kubernetes-sigs/azuredisk-csi-driver/issues/168
86-
d.cloud.Config.UseInstanceMetadata = false
87-
8884
account, accountKey, err := d.cloud.EnsureStorageAccount(accountName, storageAccountType, string(storage.StorageV2), resourceGroup, location, blobfuseAccountNamePrefix)
8985
if err != nil {
9086
return nil, fmt.Errorf("could not get storage key for storage account %s: %v", accountName, err)
@@ -148,10 +144,6 @@ func (d *Driver) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequest)
148144
resourceGroupName = d.cloud.ResourceGroup
149145
}
150146

151-
// Disable UseInstanceMetadata to mitigate a timeout issue from IMDS
152-
// https://github.com/kubernetes-sigs/azuredisk-csi-driver/issues/168
153-
d.cloud.Config.UseInstanceMetadata = false
154-
155147
accountKey, err := d.cloud.GetStorageAccesskey(accountName, resourceGroupName)
156148
if err != nil {
157149
return nil, fmt.Errorf("no key for storage account(%s) under resource group(%s), err %v", accountName, resourceGroupName, err)

0 commit comments

Comments
 (0)