Skip to content

Commit d29f0ef

Browse files
authored
Merge pull request #141 from andyzhangx/disable-imds
feat: disable IMDS in controller to support MSI
2 parents 8b0b8fb + 47fd29a commit d29f0ef

File tree

6 files changed

+12
-3
lines changed

6 files changed

+12
-3
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
{{ include "blobfuse.labels" . | indent 6 }}
1515
app: csi-blobfuse-controller
1616
spec:
17+
hostNetwork: true
1718
serviceAccountName: csi-blobfuse-controller-sa
1819
nodeSelector:
1920
kubernetes.io/os: linux
@@ -91,7 +92,6 @@ spec:
9192
args:
9293
- "--v=5"
9394
- "--endpoint=$(CSI_ENDPOINT)"
94-
- "--nodeid=$(KUBE_NODE_NAME)"
9595
ports:
9696
- containerPort: 29622
9797
name: healthz

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spec:
1313
{{ include "blobfuse.labels" . | indent 6 }}
1414
app: csi-blobfuse-node
1515
spec:
16+
hostNetwork: true
1617
serviceAccountName: csi-blobfuse-node-sa
1718
nodeSelector:
1819
kubernetes.io/os: linux

deploy/csi-blobfuse-controller.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ spec:
1414
labels:
1515
app: csi-blobfuse-controller
1616
spec:
17+
hostNetwork: true
1718
serviceAccountName: csi-blobfuse-controller-sa
1819
nodeSelector:
1920
kubernetes.io/os: linux
@@ -87,7 +88,6 @@ spec:
8788
image: mcr.microsoft.com/k8s/csi/blobfuse-csi:latest
8889
args:
8990
- "--v=5"
90-
- "--endpoint=$(CSI_ENDPOINT)"
9191
- "--nodeid=$(KUBE_NODE_NAME)"
9292
ports:
9393
- containerPort: 29622

deploy/csi-blobfuse-node.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ spec:
1313
labels:
1414
app: csi-blobfuse-node
1515
spec:
16+
hostNetwork: true
1617
serviceAccountName: csi-blobfuse-node-sa
1718
nodeSelector:
1819
kubernetes.io/os: linux

hack/verify-yamllint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ deployDirNum=`ls deploy/*.yaml | wc -l`
2626
helmDirNum=`ls $helmPath/*.yaml | grep -v serviceaccount | wc -l`
2727
if [[ "${deployDirNum}" != "${helmDirNum}" ]]; then
2828
echo "yaml file num($deployDirNum) under deploy/ not equal to num($helmDirNum) under $helmPath"
29-
#exit 1
29+
exit 1
3030
fi
3131

3232
for path in "deploy/*.yaml" "deploy/example/*.yaml"

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(),

0 commit comments

Comments
 (0)