From 81252a6d78c98a82f36431f1a44a188d0c89d93d Mon Sep 17 00:00:00 2001 From: Yu Liao Date: Thu, 30 Jan 2020 10:40:55 -0800 Subject: [PATCH] added env var WINDOWS_CNI_STORAGE_PATH and WINDOWS_CNI_VERSION --- build/dependencies.yaml | 4 ++-- cluster/gce/config-common.sh | 4 ++++ cluster/gce/util.sh | 2 ++ cluster/gce/windows/k8s-node-setup.psm1 | 16 ++++++++-------- 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/build/dependencies.yaml b/build/dependencies.yaml index b960bd73e06..ef9f8fb4b6e 100644 --- a/build/dependencies.yaml +++ b/build/dependencies.yaml @@ -56,8 +56,8 @@ dependencies: match: CNI_VERSION = - path: cluster/gce/gci/configure.sh match: DEFAULT_CNI_VERSION= - - path: cluster/gce/windows/k8s-node-setup.psm1 - match: CNI_RELEASE_VERSION = + - path: cluster/gce/config-common.sh + match: WINDOWS_CNI_VERSION= - path: test/e2e_node/remote/utils.go match: cniVersion[\t\n\f\r ]*= diff --git a/cluster/gce/config-common.sh b/cluster/gce/config-common.sh index a8f27f70f82..068a50a0930 100644 --- a/cluster/gce/config-common.sh +++ b/cluster/gce/config-common.sh @@ -140,6 +140,10 @@ export WINDOWS_LOGS_DIR="${WINDOWS_K8S_DIR}\logs" export WINDOWS_CNI_DIR="${WINDOWS_K8S_DIR}\cni" # Directory where CNI config files will be stored on Windows nodes. export WINDOWS_CNI_CONFIG_DIR="${WINDOWS_K8S_DIR}\cni\config" +# CNI storage path for Windows nodes +export WINDOWS_CNI_STORAGE_PATH="https://storage.googleapis.com/k8s-artifacts-cni/release" +# CNI version for Windows nodes +export WINDOWS_CNI_VERSION="v0.8.5" # Pod manifests directory for Windows nodes on Windows nodes. export WINDOWS_MANIFESTS_DIR="${WINDOWS_K8S_DIR}\manifests" # Directory where cert/key files will be stores on Windows nodes. diff --git a/cluster/gce/util.sh b/cluster/gce/util.sh index b0f12bd50f7..8a96237248e 100755 --- a/cluster/gce/util.sh +++ b/cluster/gce/util.sh @@ -1538,6 +1538,8 @@ NODE_DIR: $(yaml-quote ${WINDOWS_NODE_DIR}) LOGS_DIR: $(yaml-quote ${WINDOWS_LOGS_DIR}) CNI_DIR: $(yaml-quote ${WINDOWS_CNI_DIR}) CNI_CONFIG_DIR: $(yaml-quote ${WINDOWS_CNI_CONFIG_DIR}) +WINDOWS_CNI_STORAGE_PATH: $(yaml-quote ${WINDOWS_CNI_STORAGE_PATH}) +WINDOWS_CNI_VERSION: $(yaml-quote ${WINDOWS_CNI_VERSION}) MANIFESTS_DIR: $(yaml-quote ${WINDOWS_MANIFESTS_DIR}) PKI_DIR: $(yaml-quote ${WINDOWS_PKI_DIR}) CA_FILE_PATH: $(yaml-quote ${WINDOWS_CA_FILE}) diff --git a/cluster/gce/windows/k8s-node-setup.psm1 b/cluster/gce/windows/k8s-node-setup.psm1 index 011b926feba..0c22c43aeb9 100644 --- a/cluster/gce/windows/k8s-node-setup.psm1 +++ b/cluster/gce/windows/k8s-node-setup.psm1 @@ -236,6 +236,8 @@ function Set-EnvironmentVars { "NODE_DIR" = ${kube_env}['NODE_DIR'] "CNI_DIR" = ${kube_env}['CNI_DIR'] "CNI_CONFIG_DIR" = ${kube_env}['CNI_CONFIG_DIR'] + "WINDOWS_CNI_STORAGE_PATH" = ${kube_env}['WINDOWS_CNI_STORAGE_PATH'] + "WINDOWS_CNI_VERSION" = ${kube_env}['WINDOWS_CNI_VERSION'] "PKI_DIR" = ${kube_env}['PKI_DIR'] "CA_FILE_PATH" = ${kube_env}['CA_FILE_PATH'] "KUBELET_CONFIG" = ${kube_env}['KUBELET_CONFIG_FILE'] @@ -300,7 +302,7 @@ function Download-HelperScripts { return } MustDownload-File -OutFile ${env:K8S_DIR}\hns.psm1 ` - -URLs "https://www.googleapis.com/storage/v1/b/gke-release/o/winnode%2fconfig%2fsdn%2fmaster%2fhns.psm1?alt=media" + -URLs "https://storage.googleapis.com/gke-release/winnode/config/sdn/master/hns.psm1" } # Takes the Windows version string from the cluster bash scripts (e.g. @@ -916,7 +918,7 @@ function Configure-HostNetworkingService { function Configure-GcePdTools { if (ShouldWrite-File ${env:K8S_DIR}\GetGcePdName.dll) { MustDownload-File -OutFile ${env:K8S_DIR}\GetGcePdName.dll ` - -URLs "https://www.googleapis.com/storage/v1/b/gke-release/o/winnode%2fconfig%2fgce-tools%2fmaster%2fGetGcePdName%2fGetGcePdName.dll?alt=media" + -URLs "https://storage.googleapis.com/gke-release/winnode/config/gce-tools/master/GetGcePdName/GetGcePdName.dll" } if (-not (Test-Path $PsHome\profile.ps1)) { New-Item -path $PsHome\profile.ps1 -type file @@ -953,16 +955,14 @@ function Configure-CniNetworking { # CLUSTER_IP_RANGE # SERVICE_CLUSTER_IP_RANGE function Configure_Dockerd_CniNetworking { - $CNI_RELEASE_VERSION = 'v0.8.5' if ((ShouldWrite-File ${env:CNI_DIR}\win-bridge.exe) -or (ShouldWrite-File ${env:CNI_DIR}\host-local.exe)) { $tmp_dir = 'C:\cni_tmp' New-Item $tmp_dir -ItemType 'directory' -Force | Out-Null - $release_url = ('https://storage.googleapis.com/k8s-artifacts-cni/release%2f' + - $CNI_RELEASE_VERSION + '%2f') + $release_url = (${env:WINDOWS_CNI_STORAGE_PATH} + '/' + ${env:WINDOWS_CNI_VERSION} + '/') $tgz_url = ($release_url + - "cni-plugins-windows-amd64-$CNI_RELEASE_VERSION.tgz") + "cni-plugins-windows-amd64-${env:WINDOWS_CNI_VERSION}.tgz") $sha_url = ($tgz_url + ".sha1") MustDownload-File -URLs $sha_url -OutFile $tmp_dir\cni-plugins.sha1 $sha1_val = ($(Get-Content $tmp_dir\cni-plugins.sha1) -split ' ',2)[0] @@ -1582,8 +1582,8 @@ function Install-LoggingAgent { return } - $url = ("https://www.googleapis.com/storage/v1/b/gke-release/o/winnode%2fstackdriver%2f" + - "StackdriverLogging-${STACKDRIVER_VERSION}.exe?alt=media") + $url = ("https://storage.googleapis.com/gke-release/winnode/stackdriver/" + + "StackdriverLogging-${STACKDRIVER_VERSION}.exe") $tmp_dir = 'C:\stackdriver_tmp' New-Item $tmp_dir -ItemType 'directory' -Force | Out-Null $installer_file = "${tmp_dir}\StackdriverLogging-${STACKDRIVER_VERSION}.exe"