@@ -261,6 +261,8 @@ function Set-EnvironmentVars {
261
261
" CNI_CONFIG_DIR" = ${kube_env} [' CNI_CONFIG_DIR' ]
262
262
" WINDOWS_CNI_STORAGE_PATH" = ${kube_env} [' WINDOWS_CNI_STORAGE_PATH' ]
263
263
" WINDOWS_CNI_VERSION" = ${kube_env} [' WINDOWS_CNI_VERSION' ]
264
+ " CSI_PROXY_STORAGE_PATH" = ${kube_env} [' CSI_PROXY_STORAGE_PATH' ]
265
+ " CSI_PROXY_VERSION" = ${kube_env} [' CSI_PROXY_VERSION' ]
264
266
" PKI_DIR" = ${kube_env} [' PKI_DIR' ]
265
267
" CA_FILE_PATH" = ${kube_env} [' CA_FILE_PATH' ]
266
268
" KUBELET_CONFIG" = ${kube_env} [' KUBELET_CONFIG_FILE' ]
@@ -394,6 +396,33 @@ function DownloadAndInstall-KubernetesBinaries {
394
396
Remove-Item - Force - Recurse $tmp_dir
395
397
}
396
398
399
+ # Downloads the csi-proxy binaries from kube-env's CSI_PROXY_STORAGE_PATH and
400
+ # CSI_PROXY_VERSION, and then puts them in a subdirectory of $env:NODE_DIR.
401
+ # Note: for now the installation is skipped for non-test clusters. Will be
402
+ # installed for all cluster after tests pass.
403
+ # Required ${kube_env} keys:
404
+ # CSI_PROXY_STORAGE_PATH and CSI_PROXY_VERSION
405
+ function DownloadAndInstall-CSIProxyBinaries {
406
+ if (Test-IsTestCluster $kube_env ) {
407
+ if (ShouldWrite- File ${env: NODE_DIR} \csi-proxy.exe ) {
408
+ $tmp_dir = ' C:\k8s_tmp'
409
+ New-Item - Force - ItemType ' directory' $tmp_dir | Out-Null
410
+ $filename = ' csi-proxy.exe'
411
+ $urls = " ${env: CSI_PROXY_STORAGE_PATH} /${env: CSI_PROXY_VERSION} /$filename "
412
+ MustDownload- File - OutFile $tmp_dir \$filename - URLs $urls
413
+ Move-Item - Force $tmp_dir \$filename ${env: NODE_DIR} \$filename
414
+ # Clean up the temporary directory
415
+ Remove-Item - Force - Recurse $tmp_dir
416
+ }
417
+ }
418
+ }
419
+
420
+ # TODO(jingxu97): Make csi-proxy.exe as a service similar to kubelet.exe
421
+ function Start-CSIProxy {
422
+ Log- Output ' Starting CSI Proxy'
423
+ Start-Process " ${env: NODE_DIR} \csi-proxy.exe"
424
+ }
425
+
397
426
# TODO(pjh): this is copied from
398
427
# https://github.com/Microsoft/SDN/blob/master/Kubernetes/windows/start-kubelet.ps1#L98.
399
428
# See if there's a way to fetch or construct the "management subnet" so that
@@ -909,7 +938,6 @@ Import-Module -Name $modulePath'.replace('K8S_DIR', ${env:K8S_DIR})
909
938
}
910
939
Copy-Item ${env: K8S_DIR} \diskutil.exe - Destination " C:\Windows\system32"
911
940
}
912
-
913
941
}
914
942
915
943
# Setup cni network. This function supports both Docker and containerd.
0 commit comments