Fixing - Windows kubelet configs shouldn't overwrite Linux configs in hybrid cluster
@@ -30,6 +30,12 @@ func setKubeletConfig(cs *api.ContainerService) {
for key, val := range staticLinuxKubeletConfig {
staticWindowsKubeletConfig[key] = val
}
+ staticWindowsKubeletConfig["--azure-container-registry-config"] = "c:\\k\\azure.json"
+ staticWindowsKubeletConfig["--pod-infra-container-image"] = "kubletwin/pause"
+ staticWindowsKubeletConfig["--kubeconfig"] = "c:\\k\\config"
+ staticWindowsKubeletConfig["--cloud-config"] = "c:\\k\\azure.json"
+ staticWindowsKubeletConfig["--cgroups-per-qos"] = "false"
+ staticWindowsKubeletConfig["--enforce-node-allocatable"] = "\"\""
// Default Kubelet config
defaultKubeletConfig := map[string]string{
@@ -74,13 +80,7 @@ func setKubeletConfig(cs *api.ContainerService) {
// We don't support user-configurable values for the following,
// so any of the value assignments below will override user-provided values
- var overrideKubeletConfig map[string]string
- if cs.Properties.HasWindows() {
- overrideKubeletConfig = staticWindowsKubeletConfig
- } else {
- overrideKubeletConfig = staticLinuxKubeletConfig
- }
- for key, val := range overrideKubeletConfig {
+ for key, val := range staticLinuxKubeletConfig {
o.KubernetesConfig.KubeletConfig[key] = val
}
@@ -127,6 +127,11 @@ func setKubeletConfig(cs *api.ContainerService) {
if profile.KubernetesConfig == nil {
profile.KubernetesConfig = &api.KubernetesConfig{}
profile.KubernetesConfig.KubeletConfig = copyMap(profile.KubernetesConfig.KubeletConfig)
+ if profile.OSType == "Windows" {
+ for key, val := range staticWindowsKubeletConfig {
+ profile.KubernetesConfig.KubeletConfig[key] = val
+ }
+ }
}
setMissingKubeletValues(profile.KubernetesConfig, o.KubernetesConfig.KubeletConfig)
