Skip to content
This repository has been archived by the owner on Jan 11, 2023. It is now read-only.

Commit

Permalink
Merge remote-tracking branch 'origin/set_defaults_refactor' into set_…
Browse files Browse the repository at this point in the history
…defaults_refactor

Signed-off-by: tariqibrahim <tariq.ibrahim@microsoft.com>
  • Loading branch information
tariqibrahim committed Oct 10, 2018
2 parents 735bf00 + e2e6458 commit a807d7a
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions pkg/acsengine/params_k8s.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,36 +19,36 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params

if orchestratorProfile.IsKubernetes() ||
orchestratorProfile.IsOpenShift() {
kubeConfig := api.K8sComponentsByVersionMap[orchestratorProfile.OrchestratorVersion]
k8sComponents := api.K8sComponentsByVersionMap[orchestratorProfile.OrchestratorVersion]

dockerEngineVersion := kubeConfig["dockerEngineVersion"]
dockerEngineVersion := k8sComponents["dockerEngineVersion"]

kubernetesConfig := orchestratorProfile.KubernetesConfig

if kubernetesConfig != nil {
if helpers.IsTrueBoolPointer(kubernetesConfig.UseCloudControllerManager) {
kubernetesCcmSpec := kubernetesConfig.KubernetesImageBase + kubeConfig["ccm"]
kubernetesCcmSpec := kubernetesConfig.KubernetesImageBase + k8sComponents["ccm"]
if kubernetesConfig.CustomCcmImage != "" {
kubernetesCcmSpec = kubernetesConfig.CustomCcmImage
}

addValue(parametersMap, "kubernetesCcmImageSpec", kubernetesCcmSpec)
}

kubernetesHyperkubeSpec := kubernetesConfig.KubernetesImageBase + kubeConfig["hyperkube"]
kubernetesHyperkubeSpec := kubernetesConfig.KubernetesImageBase + k8sComponents["hyperkube"]
if kubernetesConfig.CustomHyperkubeImage != "" {
kubernetesHyperkubeSpec = kubernetesConfig.CustomHyperkubeImage
}

addValue(parametersMap, "kubeDNSServiceIP", kubernetesConfig.DNSServiceIP)
addValue(parametersMap, "kubeServiceCidr", kubernetesConfig.ServiceCIDR)
addValue(parametersMap, "kubernetesHyperkubeSpec", kubernetesHyperkubeSpec)
addValue(parametersMap, "kubernetesAddonManagerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["addonmanager"])
addValue(parametersMap, "kubernetesAddonResizerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["addonresizer"])
addValue(parametersMap, "kubernetesDNSMasqSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["dnsmasq"])
addValue(parametersMap, "kubernetesExecHealthzSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["exechealthz"])
addValue(parametersMap, "kubernetesDNSSidecarSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["k8s-dns-sidecar"])
addValue(parametersMap, "kubernetesHeapsterSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["heapster"])
addValue(parametersMap, "kubernetesAddonManagerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["addonmanager"])
addValue(parametersMap, "kubernetesAddonResizerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["addonresizer"])
addValue(parametersMap, "kubernetesDNSMasqSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["dnsmasq"])
addValue(parametersMap, "kubernetesExecHealthzSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["exechealthz"])
addValue(parametersMap, "kubernetesDNSSidecarSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["k8s-dns-sidecar"])
addValue(parametersMap, "kubernetesHeapsterSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["heapster"])
if kubernetesConfig.IsTillerEnabled() {
tillerAddon := kubernetesConfig.GetAddonByName(DefaultTillerAddonName)
c := tillerAddon.GetAddonContainersIndexByName(DefaultTillerAddonName)
Expand All @@ -61,7 +61,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if tillerAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesTillerSpec", tillerAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesTillerSpec", cloudSpecConfig.KubernetesSpecConfig.TillerImageBase+kubeConfig[DefaultTillerAddonName])
addValue(parametersMap, "kubernetesTillerSpec", cloudSpecConfig.KubernetesSpecConfig.TillerImageBase+k8sComponents[DefaultTillerAddonName])
}
}
}
Expand All @@ -88,7 +88,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if aciConnectorAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesACIConnectorSpec", aciConnectorAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesACIConnectorSpec", cloudSpecConfig.KubernetesSpecConfig.ACIConnectorImageBase+kubeConfig[DefaultACIConnectorAddonName])
addValue(parametersMap, "kubernetesACIConnectorSpec", cloudSpecConfig.KubernetesSpecConfig.ACIConnectorImageBase+k8sComponents[DefaultACIConnectorAddonName])
}
}
} else {
Expand All @@ -110,7 +110,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if clusterAutoscalerAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesClusterAutoscalerSpec", clusterAutoscalerAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesClusterAutoscalerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig[DefaultClusterAutoscalerAddonName])
addValue(parametersMap, "kubernetesClusterAutoscalerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents[DefaultClusterAutoscalerAddonName])
}
}
} else {
Expand Down Expand Up @@ -155,7 +155,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if dashboardAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesDashboardSpec", dashboardAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesDashboardSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig[DefaultDashboardAddonName])
addValue(parametersMap, "kubernetesDashboardSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents[DefaultDashboardAddonName])
}
}
}
Expand All @@ -170,7 +170,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if reschedulerAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesReschedulerSpec", reschedulerAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesReschedulerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig[DefaultReschedulerAddonName])
addValue(parametersMap, "kubernetesReschedulerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents[DefaultReschedulerAddonName])
}
}
}
Expand All @@ -181,7 +181,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if metricsServerAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesMetricsServerSpec", metricsServerAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesMetricsServerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig[DefaultMetricsServerAddonName])
addValue(parametersMap, "kubernetesMetricsServerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents[DefaultMetricsServerAddonName])
}
}
}
Expand All @@ -196,7 +196,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if nvidiaDevicePluginAddon.Containers[c].Image != "" {
addValue(parametersMap, "kubernetesNVIDIADevicePluginSpec", nvidiaDevicePluginAddon.Containers[c].Image)
} else {
addValue(parametersMap, "kubernetesNVIDIADevicePluginSpec", cloudSpecConfig.KubernetesSpecConfig.NVIDIAImageBase+kubeConfig[NVIDIADevicePluginAddonName])
addValue(parametersMap, "kubernetesNVIDIADevicePluginSpec", cloudSpecConfig.KubernetesSpecConfig.NVIDIAImageBase+k8sComponents[NVIDIADevicePluginAddonName])
}
}
}
Expand All @@ -215,7 +215,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if containerMonitoringAddon.Containers[c].Image != "" {
addValue(parametersMap, "omsAgentImage", containerMonitoringAddon.Containers[c].Image)
} else {
addValue(parametersMap, "omsAgentImage", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig[ContainerMonitoringAddonName])
addValue(parametersMap, "omsAgentImage", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents[ContainerMonitoringAddonName])
}
}
}
Expand All @@ -242,12 +242,12 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if azureCNINetworkmonitorAddon.Containers[c].Image != "" {
addValue(parametersMap, "AzureCNINetworkMonitorImageURL", azureCNINetworkmonitorAddon.Containers[c].Image)
} else {
addValue(parametersMap, "AzureCNINetworkMonitorImageURL", cloudSpecConfig.KubernetesSpecConfig.AzureCNIImageBase+kubeConfig[AzureCNINetworkMonitoringAddonName])
addValue(parametersMap, "AzureCNINetworkMonitorImageURL", cloudSpecConfig.KubernetesSpecConfig.AzureCNIImageBase+k8sComponents[AzureCNINetworkMonitoringAddonName])
}
}
}
addValue(parametersMap, "kubernetesKubeDNSSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["dns"])
addValue(parametersMap, "kubernetesPodInfraContainerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+kubeConfig["pause"])
addValue(parametersMap, "kubernetesKubeDNSSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["dns"])
addValue(parametersMap, "kubernetesPodInfraContainerSpec", cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase+k8sComponents["pause"])
addValue(parametersMap, "cloudproviderConfig", api.CloudProviderConfig{
CloudProviderBackoff: kubernetesConfig.CloudProviderBackoff,
CloudProviderBackoffRetries: kubernetesConfig.CloudProviderBackoffRetries,
Expand Down

0 comments on commit a807d7a

Please sign in to comment.