From 2ac4a190d6a46a3b994865afdf014790f8f004c3 Mon Sep 17 00:00:00 2001 From: Dong Liu Date: Thu, 26 Apr 2018 11:10:27 +0800 Subject: [PATCH] Add CustomWindowsPackageURL config in kubernetesConfig --- docs/clusterdefinition.md | 1 + pkg/acsengine/engine.go | 7 ++++++- pkg/api/converterfromapi.go | 1 + pkg/api/convertertoapi.go | 1 + pkg/api/types.go | 1 + pkg/api/vlabs/types.go | 1 + 6 files changed, 11 insertions(+), 1 deletion(-) diff --git a/docs/clusterdefinition.md b/docs/clusterdefinition.md index bdc77d50c3..80380d53aa 100644 --- a/docs/clusterdefinition.md +++ b/docs/clusterdefinition.md @@ -54,6 +54,7 @@ Here are the valid values for the orchestrator types: |cloudControllerManagerConfig|no|Configure various runtime configuration for cloud-controller-manager. See `cloudControllerManagerConfig` [below](#feat-cloud-controller-manager-config)| |apiServerConfig|no|Configure various runtime configuration for apiserver. See `apiServerConfig` [below](#feat-apiserver-config)| |schedulerConfig|no|Configure various runtime configuration for scheduler. See `schedulerConfig` [below](#feat-scheduler-config)| +|customWindowsPackageURL|no|Configure custom windows Kubernetes release package URL for deployment on Windows| #### addons diff --git a/pkg/acsengine/engine.go b/pkg/acsengine/engine.go index e8feaef672..135b16c94b 100644 --- a/pkg/acsengine/engine.go +++ b/pkg/acsengine/engine.go @@ -842,7 +842,12 @@ func getParameters(cs *api.ContainerService, isClassicMode bool, generatorCode s } if properties.OrchestratorProfile.IsKubernetes() || properties.OrchestratorProfile.IsOpenShift() { k8sVersion := properties.OrchestratorProfile.OrchestratorVersion - addValue(parametersMap, "kubeBinariesSASURL", cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase+KubeConfigs[k8sVersion]["windowszip"]) + kubeBinariesSASURL := properties.OrchestratorProfile.KubernetesConfig.CustomWindowsPackageURL + if kubeBinariesSASURL == "" { + kubeBinariesSASURL = cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase + KubeConfigs[k8sVersion]["windowszip"] + } + + addValue(parametersMap, "kubeBinariesSASURL", kubeBinariesSASURL) addValue(parametersMap, "windowsPackageSASURLBase", cloudSpecConfig.KubernetesSpecConfig.WindowsPackageSASURLBase) addValue(parametersMap, "kubeBinariesVersion", k8sVersion) addValue(parametersMap, "windowsTelemetryGUID", cloudSpecConfig.KubernetesSpecConfig.WindowsTelemetryGUID) diff --git a/pkg/api/converterfromapi.go b/pkg/api/converterfromapi.go index ca593de5f9..ddb6411c84 100644 --- a/pkg/api/converterfromapi.go +++ b/pkg/api/converterfromapi.go @@ -703,6 +703,7 @@ func convertKubernetesConfigToVLabs(api *KubernetesConfig, vlabs *vlabs.Kubernet vlabs.DockerEngineVersion = api.DockerEngineVersion vlabs.CustomCcmImage = api.CustomCcmImage vlabs.UseCloudControllerManager = api.UseCloudControllerManager + vlabs.CustomWindowsPackageURL = api.CustomWindowsPackageURL vlabs.UseInstanceMetadata = api.UseInstanceMetadata vlabs.EnableRbac = api.EnableRbac vlabs.EnableSecureKubelet = api.EnableSecureKubelet diff --git a/pkg/api/convertertoapi.go b/pkg/api/convertertoapi.go index ceaee18431..24c28600ba 100644 --- a/pkg/api/convertertoapi.go +++ b/pkg/api/convertertoapi.go @@ -667,6 +667,7 @@ func convertVLabsKubernetesConfig(vlabs *vlabs.KubernetesConfig, api *Kubernetes api.DockerEngineVersion = vlabs.DockerEngineVersion api.CustomCcmImage = vlabs.CustomCcmImage api.UseCloudControllerManager = vlabs.UseCloudControllerManager + api.CustomWindowsPackageURL = vlabs.CustomWindowsPackageURL api.UseInstanceMetadata = vlabs.UseInstanceMetadata api.EnableRbac = vlabs.EnableRbac api.EnableSecureKubelet = vlabs.EnableSecureKubelet diff --git a/pkg/api/types.go b/pkg/api/types.go index 2036dfc9e2..b78fd6c4fb 100644 --- a/pkg/api/types.go +++ b/pkg/api/types.go @@ -274,6 +274,7 @@ type KubernetesConfig struct { DockerEngineVersion string `json:"dockerEngineVersion,omitempty"` CustomCcmImage string `json:"customCcmImage,omitempty"` // Image for cloud-controller-manager UseCloudControllerManager *bool `json:"useCloudControllerManager,omitempty"` + CustomWindowsPackageURL string `json:"customWindowsPackageURL,omitempty"` UseInstanceMetadata *bool `json:"useInstanceMetadata,omitempty"` EnableRbac *bool `json:"enableRbac,omitempty"` EnableSecureKubelet *bool `json:"enableSecureKubelet,omitempty"` diff --git a/pkg/api/vlabs/types.go b/pkg/api/vlabs/types.go index 8f13decd58..535b376e4e 100644 --- a/pkg/api/vlabs/types.go +++ b/pkg/api/vlabs/types.go @@ -274,6 +274,7 @@ type KubernetesConfig struct { DockerEngineVersion string `json:"dockerEngineVersion,omitempty"` CustomCcmImage string `json:"customCcmImage,omitempty"` UseCloudControllerManager *bool `json:"useCloudControllerManager,omitempty"` + CustomWindowsPackageURL string `json:"customWindowsPackageURL,omitempty"` UseInstanceMetadata *bool `json:"useInstanceMetadata,omitempty"` EnableRbac *bool `json:"enableRbac,omitempty"` EnableSecureKubelet *bool `json:"enableSecureKubelet,omitempty"`