@@ -253,6 +253,8 @@ function Set-EnvironmentVars {
253
253
" CNI_CONFIG_DIR" = ${kube_env} [' CNI_CONFIG_DIR' ]
254
254
" WINDOWS_CNI_STORAGE_PATH" = ${kube_env} [' WINDOWS_CNI_STORAGE_PATH' ]
255
255
" WINDOWS_CNI_VERSION" = ${kube_env} [' WINDOWS_CNI_VERSION' ]
256
+ " CSI_PROXY_STORAGE_PATH" = ${kube_env} [' CSI_PROXY_STORAGE_PATH' ]
257
+ " CSI_PROXY_VERSION" = ${kube_env} [' CSI_PROXY_VERSION' ]
256
258
" PKI_DIR" = ${kube_env} [' PKI_DIR' ]
257
259
" CA_FILE_PATH" = ${kube_env} [' CA_FILE_PATH' ]
258
260
" KUBELET_CONFIG" = ${kube_env} [' KUBELET_CONFIG_FILE' ]
@@ -386,6 +388,33 @@ function DownloadAndInstall-KubernetesBinaries {
386
388
Remove-Item - Force - Recurse $tmp_dir
387
389
}
388
390
391
+ # Downloads the csi-proxy binaries from kube-env's CSI_PROXY_STORAGE_PATH and
392
+ # CSI_PROXY_VERSION, and then puts them in a subdirectory of $env:NODE_DIR.
393
+ # Note: for now the installation is skipped for non-test clusters. Will be
394
+ # installed for all cluster after tests pass.
395
+ # Required ${kube_env} keys:
396
+ # CSI_PROXY_STORAGE_PATH and CSI_PROXY_VERSION
397
+ function DownloadAndInstall-CSIProxyBinaries {
398
+ if (Test-IsTestCluster $kube_env ) {
399
+ if (ShouldWrite- File ${env: NODE_DIR} \csi-proxy.exe ) {
400
+ $tmp_dir = ' C:\k8s_tmp'
401
+ New-Item - Force - ItemType ' directory' $tmp_dir | Out-Null
402
+ $filename = ' csi-proxy.exe'
403
+ $urls = " ${env: CSI_PROXY_STORAGE_PATH} /${env: CSI_PROXY_VERSION} /$filename "
404
+ MustDownload- File - OutFile $tmp_dir \$filename - URLs $urls
405
+ Move-Item - Force $tmp_dir \$filename ${env: NODE_DIR} \$filename
406
+ # Clean up the temporary directory
407
+ Remove-Item - Force - Recurse $tmp_dir
408
+ }
409
+ }
410
+ }
411
+
412
+ # TODO(jingxu97): Make csi-proxy.exe as a service similar to kubelet.exe
413
+ function Start-CSIProxy {
414
+ Log- Output ' Starting CSI Proxy'
415
+ Start-Process " ${env: NODE_DIR} \csi-proxy.exe"
416
+ }
417
+
389
418
# TODO(pjh): this is copied from
390
419
# https://github.com/Microsoft/SDN/blob/master/Kubernetes/windows/start-kubelet.ps1#L98.
391
420
# See if there's a way to fetch or construct the "management subnet" so that
@@ -901,7 +930,6 @@ Import-Module -Name $modulePath'.replace('K8S_DIR', ${env:K8S_DIR})
901
930
}
902
931
Copy-Item ${env: K8S_DIR} \diskutil.exe - Destination " C:\Windows\system32"
903
932
}
904
-
905
933
}
906
934
907
935
# Setup cni network. This function supports both Docker and containerd.
0 commit comments