refactor: add KubernetesImageBaseType (#2711)

This commit is contained in:
Jack Francis 2020-02-12 18:57:16 -08:00 коммит произвёл GitHub
Родитель 07ba791531
Коммит d8f587d3eb
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
24 изменённых файлов: 1313 добавлений и 1125 удалений

Просмотреть файл

@ -22,6 +22,7 @@ import (
v1 "k8s.io/api/core/v1"
"github.com/Azure/aks-engine/pkg/api"
"github.com/Azure/aks-engine/pkg/api/common"
"github.com/Azure/aks-engine/pkg/armhelpers"
"github.com/Azure/aks-engine/pkg/engine"
"github.com/Azure/aks-engine/pkg/engine/transform"
@ -313,7 +314,7 @@ func (rcc *rotateCertsCmd) deleteServiceAccounts() error {
}
for _, sa := range saList.Items {
switch sa.Name {
case "kube-dns", "kubernetes-dashboard", "metrics-server":
case common.KubeDNSAddonName, "kubernetes-dashboard", common.MetricsServerAddonName:
log.Debugf("Deleting service account %s", sa.Name)
err = kubeClient.DeleteServiceAccount(&sa)
if err != nil {

Просмотреть файл

@ -19,6 +19,7 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"github.com/Azure/aks-engine/pkg/api"
"github.com/Azure/aks-engine/pkg/api/common"
"github.com/Azure/aks-engine/pkg/armhelpers"
"github.com/Azure/aks-engine/pkg/helpers"
)
@ -133,7 +134,7 @@ func TestDeleteAllPods(t *testing.T) {
Items: []v1.Pod{
{
ObjectMeta: metav1.ObjectMeta{
Name: "kube-dns",
Name: common.KubeDNSAddonName,
Namespace: "kube-system",
},
},
@ -220,7 +221,7 @@ func TestDeleteServiceAccounts(t *testing.T) {
Items: []v1.ServiceAccount{
{
ObjectMeta: metav1.ObjectMeta{
Name: "kube-dns",
Name: common.KubeDNSAddonName,
Namespace: "kube-system",
},
},

Просмотреть файл

@ -22,7 +22,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
clusterDNSPrefix = cs.Properties.MasterProfile.DNSPrefix
}
cloudSpecConfig := cs.GetCloudSpecConfig()
k8sComponents := K8sComponentsByVersionMap[o.OrchestratorVersion]
k8sComponents := GetK8sComponentsByVersionMap(o.KubernetesConfig)[o.OrchestratorVersion]
specConfig := cloudSpecConfig.KubernetesSpecConfig
omsagentImage := "mcr.microsoft.com/azuremonitor/containerinsights/ciprod:ciprod01072020"
var workspaceDomain string
@ -45,7 +45,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
Containers: []KubernetesContainerSpec{
{
Name: common.HeapsterAddonName,
Image: specConfig.KubernetesImageBase + k8sComponents["heapster"],
Image: specConfig.KubernetesImageBase + k8sComponents[common.HeapsterAddonName],
CPURequests: "88m",
MemoryRequests: "204Mi",
CPULimits: "88m",
@ -53,7 +53,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
},
{
Name: "heapster-nanny",
Image: specConfig.KubernetesImageBase + k8sComponents["addonresizer"],
Image: specConfig.KubernetesImageBase + k8sComponents[common.AddonResizerComponentName],
CPURequests: "88m",
MemoryRequests: "204Mi",
CPULimits: "88m",
@ -357,24 +357,24 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
Enabled: to.BoolPtr(o.KubernetesConfig.NetworkPolicy == NetworkPolicyCalico),
Containers: []KubernetesContainerSpec{
{
Name: "calico-typha",
Image: specConfig.CalicoImageBase + k8sComponents["calico-typha"],
Name: common.CalicoTyphaComponentName,
Image: specConfig.CalicoImageBase + k8sComponents[common.CalicoTyphaComponentName],
},
{
Name: "calico-cni",
Image: specConfig.CalicoImageBase + k8sComponents["calico-cni"],
Name: common.CalicoCNIComponentName,
Image: specConfig.CalicoImageBase + k8sComponents[common.CalicoCNIComponentName],
},
{
Name: "calico-node",
Image: specConfig.CalicoImageBase + k8sComponents["calico-node"],
Name: common.CalicoNodeComponentName,
Image: specConfig.CalicoImageBase + k8sComponents[common.CalicoNodeComponentName],
},
{
Name: "calico-pod2daemon",
Image: specConfig.CalicoImageBase + k8sComponents["calico-pod2daemon"],
Name: common.CalicoPod2DaemonComponentName,
Image: specConfig.CalicoImageBase + k8sComponents[common.CalicoPod2DaemonComponentName],
},
{
Name: "calico-cluster-proportional-autoscaler",
Image: specConfig.KubernetesImageBase + k8sComponents["calico-cluster-proportional-autoscaler"],
Name: common.CalicoClusterAutoscalerComponentName,
Image: specConfig.KubernetesImageBase + k8sComponents[common.CalicoClusterAutoscalerComponentName],
},
},
}
@ -645,15 +645,15 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) {
Containers: []KubernetesContainerSpec{
{
Name: "kubedns",
Image: specConfig.KubernetesImageBase + k8sComponents["kube-dns"],
Image: specConfig.KubernetesImageBase + k8sComponents[common.KubeDNSAddonName],
},
{
Name: "dnsmasq",
Image: specConfig.KubernetesImageBase + k8sComponents["dnsmasq"],
Name: common.DNSMasqComponentName,
Image: specConfig.KubernetesImageBase + k8sComponents[common.DNSMasqComponentName],
},
{
Name: "sidecar",
Image: specConfig.KubernetesImageBase + k8sComponents["k8s-dns-sidecar"],
Image: specConfig.KubernetesImageBase + k8sComponents[common.DNSSidecarComponentName],
},
},
}

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -36,10 +36,12 @@ type DCOSSpecConfig struct {
//KubernetesSpecConfig is the kubernetes container images used.
type KubernetesSpecConfig struct {
AzureTelemetryPID string `json:"azureTelemetryPID,omitempty"`
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
TillerImageBase string `json:"tillerImageBase,omitempty"`
ACIConnectorImageBase string `json:"aciConnectorImageBase,omitempty"`
AzureTelemetryPID string `json:"azureTelemetryPID,omitempty"`
// KubernetesImageBase defines a base image URL substring to source images that originate from upstream k8s.gcr.io
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
TillerImageBase string `json:"tillerImageBase,omitempty"`
ACIConnectorImageBase string `json:"aciConnectorImageBase,omitempty"`
// MCRKubernetesImageBase defines a base image URL substring to source MS-curated images that originate from MCR
MCRKubernetesImageBase string `json:"mcrKubernetesImageBase,omitempty"`
NVIDIAImageBase string `json:"nvidiaImageBase,omitempty"`
AzureCNIImageBase string `json:"azureCNIImageBase,omitempty"`

Просмотреть файл

@ -138,8 +138,12 @@ const (
DashboardAddonName = "kubernetes-dashboard"
// ReschedulerAddonName is the name of the rescheduler addon deployment
ReschedulerAddonName = "rescheduler"
// ExecHealthZComponentName is the name of the exechealthz component
ExecHealthZComponentName = "exechealthz"
// MetricsServerAddonName is the name of the kubernetes metrics server addon deployment
MetricsServerAddonName = "metrics-server"
// AddonResizerComponentName is the name of the kubernetes addon-resizer component
AddonResizerComponentName = "addon-resizer"
// NVIDIADevicePluginAddonName is the name of the NVIDIA device plugin addon deployment
NVIDIADevicePluginAddonName = "nvidia-device-plugin"
// ContainerMonitoringAddonName is the name of the kubernetes Container Monitoring addon deployment
@ -180,6 +184,16 @@ const (
DNSAutoscalerAddonName = "dns-autoscaler"
// CalicoAddonName is the name of calico daemonset addon
CalicoAddonName = "calico-daemonset"
// CalicoTyphaComponentName is the name of calico-typha component
CalicoTyphaComponentName = "calico-typha"
// CalicoCNIComponentName is the name of calico-cni component
CalicoCNIComponentName = "calico-cni"
// CalicoNodeComponentName is the name of calico-node component
CalicoNodeComponentName = "calico-node"
// CalicoPod2DaemonComponentName is the name of calico-pod2daemon component
CalicoPod2DaemonComponentName = "calico-pod2daemon"
// CalicoClusterAutoscalerComponentName is the name of calico-cluster-proportional-autoscaler component
CalicoClusterAutoscalerComponentName = "calico-cluster-proportional-autoscaler"
// AADPodIdentityAddonName is the name of the aad-pod-identity addon deployment
AADPodIdentityAddonName = "aad-pod-identity"
// AzurePolicyAddonName is the name of the Azure Policy addon
@ -214,6 +228,12 @@ const (
Hyperkube = "hyperkube"
// KubeDNSAddonName is the name of the kube-dns-deployment addon
KubeDNSAddonName = "kube-dns"
// DNSMasqComponentName is the name of the dnsmasq component
DNSMasqComponentName = "dnsmasq"
// DNSSidecarComponentName is the name of the dnsmasq component
DNSSidecarComponentName = "k8s-dns-sidecar"
// PauseComponentName is the name of the pause component
PauseComponentName = "pause"
// CoreDNSAddonName is the name of the coredns addon
CoreDNSAddonName = "coredns"
// KubeProxyAddonName is the name of the kube-proxy config addon
@ -262,6 +282,8 @@ const (
AddonManagerComponentName = "kube-addon-manager"
)
const WindowsArtifactComponentName = "windowszip"
const (
// AzureStackSuffix is appended to kubernetes version on Azure Stack instances
AzureStackSuffix = "-azs"
@ -270,3 +292,8 @@ const (
// AzureStackCaCertLocation is where Azure Stack's CRP drops the stamp CA certificate
AzureStackCaCertLocation = "/var/lib/waagent/Certificates.pem"
)
const (
KubernetesImageBaseTypeGCR = "gcr"
KubernetesImageBaseTypeMCR = "mcr"
)

Просмотреть файл

@ -208,7 +208,7 @@ func getComponentDefaultContainerImage(component string, cs *ContainerService) s
}
kubernetesConfig := cs.Properties.OrchestratorProfile.KubernetesConfig
cloudSpecConfig := cs.GetCloudSpecConfig()
k8sComponents := K8sComponentsByVersionMap[cs.Properties.OrchestratorProfile.OrchestratorVersion]
k8sComponents := GetK8sComponentsByVersionMap(cs.Properties.OrchestratorProfile.KubernetesConfig)[cs.Properties.OrchestratorProfile.OrchestratorVersion]
specConfig := cloudSpecConfig.KubernetesSpecConfig
hyperkubeImageBase := specConfig.KubernetesImageBase
hyperkubeImage := hyperkubeImageBase + k8sComponents[common.Hyperkube]

Просмотреть файл

@ -837,6 +837,7 @@ func TestGetContainerImages(t *testing.T) {
},
}
orchestratorVersionOneDotEighteen := csOneDotEighteen.Properties.OrchestratorProfile.OrchestratorVersion
k8sComponentsByVersionMap := GetK8sComponentsByVersionMap(&KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR})
cases := []struct {
name string
cs *ContainerService
@ -849,11 +850,11 @@ func TestGetContainerImages(t *testing.T) {
{
name: "1.13",
cs: csOneDotThirteen,
expectedAPIServerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotThirteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotThirteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotThirteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotThirteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.AddonManagerComponentName],
},
{
name: "1.13 custom images in ContainerService",
@ -862,25 +863,25 @@ func TestGetContainerImages(t *testing.T) {
expectedControllerManagerImageString: csOneDotThirteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedCloudControllerManagerImageString: csOneDotThirteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomCcmImage,
expectedSchedulerImageString: csOneDotThirteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedAddonManagerImageString: csOneDotThirteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.AddonManagerComponentName],
expectedAddonManagerImageString: csOneDotThirteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.AddonManagerComponentName],
},
{
name: "1.13 Azure Stack",
cs: csOneDotThirteenAzureStack,
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotThirteen][common.AddonManagerComponentName],
},
{
name: "1.14",
cs: csOneDotFourteen,
expectedAPIServerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotFourteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotFourteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotFourteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotFourteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.AddonManagerComponentName],
},
{
name: "1.14 custom images in ContainerService",
@ -889,25 +890,25 @@ func TestGetContainerImages(t *testing.T) {
expectedControllerManagerImageString: csOneDotFourteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedCloudControllerManagerImageString: csOneDotFourteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomCcmImage,
expectedSchedulerImageString: csOneDotFourteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedAddonManagerImageString: csOneDotFourteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.AddonManagerComponentName],
expectedAddonManagerImageString: csOneDotFourteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.AddonManagerComponentName],
},
{
name: "1.14 Azure Stack",
cs: csOneDotFourteenAzureStack,
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFourteen][common.AddonManagerComponentName],
},
{
name: "1.15",
cs: csOneDotFifteen,
expectedAPIServerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotFifteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotFifteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotFifteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotFifteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.AddonManagerComponentName],
},
{
name: "1.15 custom images in ContainerService",
@ -916,25 +917,25 @@ func TestGetContainerImages(t *testing.T) {
expectedControllerManagerImageString: csOneDotFifteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedCloudControllerManagerImageString: csOneDotFifteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomCcmImage,
expectedSchedulerImageString: csOneDotFifteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedAddonManagerImageString: csOneDotFifteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.AddonManagerComponentName],
expectedAddonManagerImageString: csOneDotFifteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.AddonManagerComponentName],
},
{
name: "1.15 Azure Stack",
cs: csOneDotFifteenAzureStack,
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotFifteen][common.AddonManagerComponentName],
},
{
name: "1.16",
cs: csOneDotSixteen,
expectedAPIServerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotSixteen.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotSixteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube],
expectedControllerManagerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube],
expectedCloudControllerManagerImageString: csOneDotSixteen.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube],
expectedAddonManagerImageString: csOneDotSixteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.AddonManagerComponentName],
},
{
name: "1.16 custom images in ContainerService",
@ -943,70 +944,70 @@ func TestGetContainerImages(t *testing.T) {
expectedControllerManagerImageString: csOneDotSixteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedCloudControllerManagerImageString: csOneDotSixteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomCcmImage,
expectedSchedulerImageString: csOneDotSixteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomHyperkubeImage,
expectedAddonManagerImageString: csOneDotSixteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.AddonManagerComponentName],
expectedAddonManagerImageString: csOneDotSixteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.AddonManagerComponentName],
},
{
name: "1.16 Azure Stack",
cs: csOneDotSixteenAzureStack,
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: csOneDotSixteenAzureStack.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube] + common.AzureStackSuffix,
expectedCloudControllerManagerImageString: csOneDotSixteenAzureStack.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.Hyperkube] + common.AzureStackSuffix,
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSixteen][common.AddonManagerComponentName],
},
{
name: "1.17",
cs: csOneDotSeventeen,
expectedAPIServerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.AddonManagerComponentName],
expectedAPIServerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.AddonManagerComponentName],
},
{
name: "1.17 custom images in ContainerService",
cs: csOneDotSeventeenCustomImages,
expectedAPIServerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.ControllerManagerComponentName],
expectedAPIServerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotSeventeenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomCcmImage,
expectedSchedulerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.AddonManagerComponentName],
expectedSchedulerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotSeventeen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.AddonManagerComponentName],
},
{
name: "1.17 Azure Stack",
cs: csOneDotSeventeenAzureStack,
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.APIServerComponentName],
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotSeventeenAzureStack.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.SchedulerComponentName],
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.APIServerComponentName],
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotSeventeenAzureStack.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.SchedulerComponentName],
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotSeventeen][common.AddonManagerComponentName],
},
{
name: "1.18",
cs: csOneDotEighteen,
expectedAPIServerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.AddonManagerComponentName],
expectedAPIServerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotEighteen.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.AddonManagerComponentName],
},
{
name: "1.18 custom images in ContainerService",
cs: csOneDotEighteenCustomImages,
expectedAPIServerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.ControllerManagerComponentName],
expectedAPIServerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.APIServerComponentName],
expectedControllerManagerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.CustomCcmImage,
expectedSchedulerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.AddonManagerComponentName],
expectedSchedulerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.SchedulerComponentName],
expectedAddonManagerImageString: csOneDotEighteenCustomImages.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.AddonManagerComponentName],
},
{
name: "1.18 Azure Stack",
cs: csOneDotEighteenAzureStack,
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.APIServerComponentName],
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotEighteenAzureStack.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.SchedulerComponentName],
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + K8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.AddonManagerComponentName],
expectedAPIServerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.APIServerComponentName],
expectedControllerManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.ControllerManagerComponentName],
expectedCloudControllerManagerImageString: csOneDotEighteenAzureStack.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.CloudControllerManagerComponentName],
expectedSchedulerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.SchedulerComponentName],
expectedAddonManagerImageString: specConfigAzureStack.KubernetesImageBase + k8sComponentsByVersionMap[orchestratorVersionOneDotEighteen][common.AddonManagerComponentName],
},
}
@ -1197,8 +1198,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.13.11",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
},
},
},
@ -1208,8 +1210,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.13.11",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
Components: []KubernetesComponent{
getUserConfiguredComponentMap()["user-configured kube-scheduler component"],
getUserConfiguredComponentMap()["user-configured controller-manager component"],
@ -1227,6 +1230,7 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorVersion: "1.13.11",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
UseCloudControllerManager: to.BoolPtr(true),
},
@ -1238,8 +1242,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.14.7",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
},
},
},
@ -1249,8 +1254,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.14.7",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
Components: []KubernetesComponent{
getUserConfiguredComponentMap()["user-configured kube-scheduler component"],
getUserConfiguredComponentMap()["user-configured controller-manager component"],
@ -1268,6 +1274,7 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorVersion: "1.14.7",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
UseCloudControllerManager: to.BoolPtr(true),
},
@ -1279,8 +1286,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.15.9",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
},
},
},
@ -1290,8 +1298,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.15.9",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
Components: []KubernetesComponent{
getUserConfiguredComponentMap()["user-configured kube-scheduler component"],
getUserConfiguredComponentMap()["user-configured controller-manager component"],
@ -1309,6 +1318,7 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorVersion: "1.15.9",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
UseCloudControllerManager: to.BoolPtr(true),
},
@ -1320,8 +1330,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.16.6",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
},
},
},
@ -1331,8 +1342,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.16.6",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
Components: []KubernetesComponent{
getUserConfiguredComponentMap()["user-configured kube-scheduler component"],
getUserConfiguredComponentMap()["user-configured controller-manager component"],
@ -1350,6 +1362,7 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorVersion: "1.16.6",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
UseCloudControllerManager: to.BoolPtr(true),
},
@ -1361,8 +1374,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.17.2",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
},
},
},
@ -1372,8 +1386,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.17.2",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
Components: []KubernetesComponent{
getUserConfiguredComponentMap()["user-configured kube-scheduler component"],
getUserConfiguredComponentMap()["user-configured controller-manager component"],
@ -1391,6 +1406,7 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorVersion: "1.17.2",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
UseCloudControllerManager: to.BoolPtr(true),
},
@ -1402,8 +1418,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.18.0-alpha.1",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
},
},
},
@ -1413,8 +1430,9 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorProfile: &OrchestratorProfile{
OrchestratorVersion: "1.18.0-alpha.1",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
Components: []KubernetesComponent{
getUserConfiguredComponentMap()["user-configured kube-scheduler component"],
getUserConfiguredComponentMap()["user-configured controller-manager component"],
@ -1432,6 +1450,7 @@ func getContainerServicesMap() map[string]*ContainerService {
OrchestratorVersion: "1.18.0-alpha.1",
KubernetesConfig: &KubernetesConfig{
KubernetesImageBase: specConfig.KubernetesImageBase,
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
MCRKubernetesImageBase: specConfig.MCRKubernetesImageBase,
UseCloudControllerManager: to.BoolPtr(true),
},

Просмотреть файл

@ -260,6 +260,7 @@ func convertDcosConfigToVLabs(api *DcosConfig, vl *vlabs.DcosConfig) {
func convertKubernetesConfigToVLabs(apiCfg *KubernetesConfig, vlabsCfg *vlabs.KubernetesConfig) {
vlabsCfg.KubernetesImageBase = apiCfg.KubernetesImageBase
vlabsCfg.KubernetesImageBaseType = apiCfg.KubernetesImageBaseType
vlabsCfg.MCRKubernetesImageBase = apiCfg.MCRKubernetesImageBase
vlabsCfg.ClusterSubnet = apiCfg.ClusterSubnet
vlabsCfg.DNSServiceIP = apiCfg.DNSServiceIP

Просмотреть файл

@ -274,6 +274,7 @@ func convertVLabsDcosConfig(vlabs *vlabs.DcosConfig, api *DcosConfig) {
func convertVLabsKubernetesConfig(vlabs *vlabs.KubernetesConfig, api *KubernetesConfig) {
api.KubernetesImageBase = vlabs.KubernetesImageBase
api.KubernetesImageBaseType = vlabs.KubernetesImageBaseType
api.MCRKubernetesImageBase = vlabs.MCRKubernetesImageBase
api.ClusterSubnet = vlabs.ClusterSubnet
api.DNSServiceIP = vlabs.DNSServiceIP

Просмотреть файл

@ -79,10 +79,10 @@ func (cs *ContainerService) setKubeletConfig(isUpgrade bool) {
defaultKubeletConfig := map[string]string{
"--cluster-domain": "cluster.local",
"--network-plugin": "cni",
"--pod-infra-container-image": o.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[o.OrchestratorVersion]["pause"],
"--pod-infra-container-image": o.KubernetesConfig.MCRKubernetesImageBase + GetK8sComponentsByVersionMap(o.KubernetesConfig)[o.OrchestratorVersion][common.PauseComponentName],
"--max-pods": strconv.Itoa(DefaultKubernetesMaxPods),
"--eviction-hard": DefaultKubernetesHardEvictionThreshold,
"--node-status-update-frequency": K8sComponentsByVersionMap[o.OrchestratorVersion]["nodestatusfreq"],
"--node-status-update-frequency": GetK8sComponentsByVersionMap(o.KubernetesConfig)[o.OrchestratorVersion]["nodestatusfreq"],
"--image-gc-high-threshold": strconv.Itoa(DefaultKubernetesGCHighThreshold),
"--image-gc-low-threshold": strconv.Itoa(DefaultKubernetesGCLowThreshold),
"--non-masquerade-cidr": DefaultNonMasqueradeCIDR,

Просмотреть файл

@ -23,6 +23,7 @@ func TestKubeletConfigDefaults(t *testing.T) {
winProfile.OSType = Windows
cs.Properties.AgentPoolProfiles = append(cs.Properties.AgentPoolProfiles, winProfile)
cs.setKubeletConfig(false)
k8sComponentsByVersionMap := GetK8sComponentsByVersionMap(&KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR})
kubeletConfig := cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
expected := map[string]string{
"--address": "0.0.0.0",
@ -47,10 +48,10 @@ func TestKubeletConfigDefaults(t *testing.T) {
"--kubeconfig": "/var/lib/kubelet/kubeconfig",
"--max-pods": strconv.Itoa(DefaultKubernetesMaxPods),
"--network-plugin": NetworkPluginKubenet,
"--node-status-update-frequency": K8sComponentsByVersionMap[cs.Properties.OrchestratorProfile.OrchestratorVersion]["nodestatusfreq"],
"--node-status-update-frequency": k8sComponentsByVersionMap[cs.Properties.OrchestratorProfile.OrchestratorVersion]["nodestatusfreq"],
"--non-masquerade-cidr": DefaultNonMasqueradeCIDR,
"--pod-manifest-path": "/etc/kubernetes/manifests",
"--pod-infra-container-image": cs.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[cs.Properties.OrchestratorProfile.OrchestratorVersion]["pause"],
"--pod-infra-container-image": cs.Properties.OrchestratorProfile.KubernetesConfig.MCRKubernetesImageBase + k8sComponentsByVersionMap[cs.Properties.OrchestratorProfile.OrchestratorVersion][common.PauseComponentName],
"--pod-max-pids": strconv.Itoa(DefaultKubeletPodMaxPIDs),
"--protect-kernel-defaults": "true",
"--rotate-certificates": "true",

Просмотреть файл

@ -127,6 +127,10 @@ func (cs *ContainerService) setOrchestratorDefaults(isUpgrade, isScale bool) {
o.KubernetesConfig.KubernetesImageBase = cloudSpecConfig.KubernetesSpecConfig.KubernetesImageBase
}
if o.KubernetesConfig.KubernetesImageBaseType == "" {
o.KubernetesConfig.KubernetesImageBaseType = common.KubernetesImageBaseTypeGCR
}
if o.KubernetesConfig.MCRKubernetesImageBase == "" {
o.KubernetesConfig.MCRKubernetesImageBase = cloudSpecConfig.KubernetesSpecConfig.MCRKubernetesImageBase
}

Просмотреть файл

@ -196,7 +196,7 @@ func TestAddonsIndexByName(t *testing.T) {
func TestAssignDefaultAddonImages(t *testing.T) {
kubernetesVersion := "1.13.11"
k8sComponents := K8sComponentsByVersionMap[kubernetesVersion]
k8sComponents := GetK8sComponentsByVersionMap(&KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR})[kubernetesVersion]
customImage := "myimage"
specConfig := AzureCloudSpecEnvMap["AzurePublicCloud"].KubernetesSpecConfig
defaultAddonImages := map[string]string{
@ -215,7 +215,7 @@ func TestAssignDefaultAddonImages(t *testing.T) {
common.AzureCNINetworkMonitorAddonName: specConfig.AzureCNIImageBase + k8sComponents[common.AzureCNINetworkMonitorAddonName],
common.DNSAutoscalerAddonName: specConfig.KubernetesImageBase + k8sComponents[common.DNSAutoscalerAddonName],
common.HeapsterAddonName: specConfig.KubernetesImageBase + k8sComponents[common.HeapsterAddonName],
common.CalicoAddonName: specConfig.CalicoImageBase + k8sComponents["calico-typha"],
common.CalicoAddonName: specConfig.CalicoImageBase + k8sComponents[common.CalicoTyphaComponentName],
common.AzureNetworkPolicyAddonName: k8sComponents[common.AzureNetworkPolicyAddonName],
common.AADPodIdentityAddonName: k8sComponents[common.NMIContainerName],
common.AzurePolicyAddonName: k8sComponents[common.AzurePolicyAddonName],
@ -285,7 +285,7 @@ func getFakeAddons(defaultAddonMap map[string]string, customImage string) []Kube
containerName = "omsagent"
}
if addonName == common.CalicoAddonName {
containerName = "calico-typha"
containerName = common.CalicoTyphaComponentName
}
if addonName == common.AADPodIdentityAddonName {
containerName = "nmi"

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -14,47 +14,48 @@ import (
func TestGetK8sVersionComponents(t *testing.T) {
g := NewGomegaWithT(t)
oneDotEighteenDotZero := getK8sVersionComponents("1.18.0", nil)
kubernetesImageBaseType := common.KubernetesImageBaseTypeGCR
oneDotEighteenDotZero := getK8sVersionComponents("1.18.0", kubernetesImageBaseType, nil)
if oneDotEighteenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent := k8sComponentVersions["1.18"]
k8sComponent := kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.18"]
expected := map[string]string{
"kube-scheduler": "kube-scheduler:v1.18.0",
"kube-controller-manager": "kube-controller-manager:v1.18.0",
"kube-apiserver": "kube-apiserver:v1.18.0",
common.SchedulerComponentName: "kube-scheduler:v1.18.0",
common.ControllerManagerComponentName: "kube-controller-manager:v1.18.0",
common.APIServerComponentName: "kube-apiserver:v1.18.0",
common.KubeProxyAddonName: "kube-proxy:v1.18.0",
common.CloudControllerManagerComponentName: azureCloudControllerManagerImageReference,
common.CloudNodeManagerAddonName: azureCloudNodeManagerImageReference,
"windowszip": "v1.18.0/windowszip/v1.18.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.18.0/windowszip/v1.18.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -99,47 +100,47 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotEighteenDotZero).To(Equal(expected))
oneDotSeventeenDotZero := getK8sVersionComponents("1.17.0", nil)
oneDotSeventeenDotZero := getK8sVersionComponents("1.17.0", kubernetesImageBaseType, nil)
if oneDotSeventeenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.17"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.17"]
expected = map[string]string{
"kube-scheduler": "kube-scheduler:v1.17.0",
"kube-controller-manager": "kube-controller-manager:v1.17.0",
"kube-apiserver": "kube-apiserver:v1.17.0",
common.SchedulerComponentName: "kube-scheduler:v1.17.0",
common.ControllerManagerComponentName: "kube-controller-manager:v1.17.0",
common.APIServerComponentName: "kube-apiserver:v1.17.0",
common.KubeProxyAddonName: "kube-proxy:v1.17.0",
common.CloudControllerManagerComponentName: azureCloudControllerManagerImageReference,
common.CloudNodeManagerAddonName: azureCloudNodeManagerImageReference,
"windowszip": "v1.17.0/windowszip/v1.17.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.17.0/windowszip/v1.17.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -184,39 +185,39 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotSeventeenDotZero).To(Equal(expected))
oneDotSixteenDotZero := getK8sVersionComponents("1.16.0", nil)
oneDotSixteenDotZero := getK8sVersionComponents("1.16.0", kubernetesImageBaseType, nil)
if oneDotSixteenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.16"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.16"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.16.0",
common.KubeProxyAddonName: "hyperkube-amd64:v1.16.0",
common.CloudControllerManagerComponentName: azureCloudControllerManagerImageReference,
common.CloudNodeManagerAddonName: azureCloudNodeManagerImageReference,
"windowszip": "v1.16.0/windowszip/v1.16.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.16.0/windowszip/v1.16.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
common.CSIProvisionerContainerName: csiProvisionerImageReference,
common.CSIAttacherContainerName: csiAttacherImageReference,
@ -227,11 +228,11 @@ func TestGetK8sVersionComponents(t *testing.T) {
common.CSIResizerContainerName: csiResizerImageReference,
common.CSIAzureDiskContainerName: csiAzureDiskImageReference,
common.CSIAzureFileContainerName: csiAzureFileImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -267,39 +268,39 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotSixteenDotZero).To(Equal(expected))
oneDotFifteenDotZero := getK8sVersionComponents("1.15.0", nil)
oneDotFifteenDotZero := getK8sVersionComponents("1.15.0", kubernetesImageBaseType, nil)
if oneDotFifteenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.15"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.15"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.15.0",
common.KubeProxyAddonName: "hyperkube-amd64:v1.15.0",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.15.0",
"windowszip": "v1.15.0/windowszip/v1.15.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.15.0/windowszip/v1.15.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.NVIDIADevicePluginAddonName: nvidiaDevicePluginImageReference,
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
common.CSIProvisionerContainerName: csiProvisionerImageReference,
common.CSIAttacherContainerName: csiAttacherImageReference,
@ -310,11 +311,11 @@ func TestGetK8sVersionComponents(t *testing.T) {
common.CSIResizerContainerName: csiResizerImageReference,
common.CSIAzureDiskContainerName: csiAzureDiskImageReference,
common.CSIAzureFileContainerName: csiAzureFileImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -349,39 +350,39 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotFifteenDotZero).To(Equal(expected))
oneDotFourteenDotZero := getK8sVersionComponents("1.14.0", nil)
oneDotFourteenDotZero := getK8sVersionComponents("1.14.0", kubernetesImageBaseType, nil)
if oneDotFourteenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.14"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.14"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.14.0",
common.KubeProxyAddonName: "hyperkube-amd64:v1.14.0",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.14.0",
"windowszip": "v1.14.0/windowszip/v1.14.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.14.0/windowszip/v1.14.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.NVIDIADevicePluginAddonName: nvidiaDevicePluginImageReference,
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
common.CSIProvisionerContainerName: csiProvisionerImageReference,
common.CSIAttacherContainerName: csiAttacherImageReference,
@ -392,11 +393,11 @@ func TestGetK8sVersionComponents(t *testing.T) {
common.CSIResizerContainerName: csiResizerImageReference,
common.CSIAzureDiskContainerName: csiAzureDiskImageReference,
common.CSIAzureFileContainerName: csiAzureFileImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -431,39 +432,39 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotFourteenDotZero).To(Equal(expected))
oneDotThirteenDotZero := getK8sVersionComponents("1.13.0", nil)
oneDotThirteenDotZero := getK8sVersionComponents("1.13.0", kubernetesImageBaseType, nil)
if oneDotThirteenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.13"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.13"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.13.0",
common.KubeProxyAddonName: "hyperkube-amd64:v1.13.0",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.13.0",
"windowszip": "v1.13.0/windowszip/v1.13.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.13.0/windowszip/v1.13.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.NVIDIADevicePluginAddonName: nvidiaDevicePluginImageReference,
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
common.CSIProvisionerContainerName: csiProvisionerImageReference,
common.CSIAttacherContainerName: csiAttacherImageReference,
@ -474,11 +475,11 @@ func TestGetK8sVersionComponents(t *testing.T) {
common.CSIResizerContainerName: csiResizerImageReference,
common.CSIAzureDiskContainerName: csiAzureDiskImageReference,
common.CSIAzureFileContainerName: csiAzureFileImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -513,45 +514,45 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotThirteenDotZero).To(Equal(expected))
oneDotTwelveDotZero := getK8sVersionComponents("1.12.0", nil)
oneDotTwelveDotZero := getK8sVersionComponents("1.12.0", kubernetesImageBaseType, nil)
if oneDotTwelveDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.12"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.12"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.12.0",
common.KubeProxyAddonName: "hyperkube-amd64:v1.12.0",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.12.0",
"windowszip": "v1.12.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
common.CoreDNSAddonName: coreDNSImageReference,
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.12.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.CoreDNSAddonName: getDefaultImage(common.CoreDNSAddonName, kubernetesImageBaseType),
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.NVIDIADevicePluginAddonName: nvidiaDevicePluginImageReference,
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -586,44 +587,44 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotTwelveDotZero).To(Equal(expected))
oneDotElevenDotZero := getK8sVersionComponents("1.11.0-alpha.1", nil)
oneDotElevenDotZero := getK8sVersionComponents("1.11.0-alpha.1", kubernetesImageBaseType, nil)
if oneDotElevenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.11"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.11"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.11.0-alpha.1",
common.KubeProxyAddonName: "hyperkube-amd64:v1.11.0-alpha.1",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.11.0-alpha.1",
"windowszip": "v1.11.0-alpha.1-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.11.0-alpha.1-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: reschedulerImageReference,
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: getDefaultImage(common.ReschedulerAddonName, kubernetesImageBaseType),
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.NVIDIADevicePluginAddonName: nvidiaDevicePluginImageReference,
"k8s-dns-sidecar": kubeDNSSidecarImageReference,
common.DNSSidecarComponentName: getDefaultImage(common.DNSSidecarComponentName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -658,44 +659,44 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotElevenDotZero).To(Equal(expected))
oneDotTenDotZero := getK8sVersionComponents("1.10.0", nil)
oneDotTenDotZero := getK8sVersionComponents("1.10.0", kubernetesImageBaseType, nil)
if oneDotTenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.10"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.10"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.10.0",
common.KubeProxyAddonName: "hyperkube-amd64:v1.10.0",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.10.0",
"windowszip": "v1.10.0-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.10.0-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: k8sComponent["rescheduler"],
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: k8sComponent[common.ReschedulerAddonName],
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
common.NVIDIADevicePluginAddonName: k8sComponent[common.NVIDIADevicePluginAddonName],
"k8s-dns-sidecar": k8sComponent["k8s-dns-sidecar"],
common.NVIDIADevicePluginAddonName: "k8s-device-plugin:1.10",
common.DNSSidecarComponentName: k8sComponent[common.DNSSidecarComponentName],
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -730,43 +731,43 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotTenDotZero).To(Equal(expected))
oneDotNineDotThree := getK8sVersionComponents("1.9.3", nil)
oneDotNineDotThree := getK8sVersionComponents("1.9.3", kubernetesImageBaseType, nil)
if oneDotNineDotThree == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.9"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.9"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.9.3",
common.KubeProxyAddonName: "hyperkube-amd64:v1.9.3",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.9.3",
"windowszip": "v1.9.3-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.9.3-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: k8sComponent["rescheduler"],
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: k8sComponent[common.ReschedulerAddonName],
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
"k8s-dns-sidecar": k8sComponent["k8s-dns-sidecar"],
common.DNSSidecarComponentName: k8sComponent[common.DNSSidecarComponentName],
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -801,41 +802,41 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotNineDotThree).To(Equal(expected))
oneDotEightDotEight := getK8sVersionComponents("1.8.8", nil)
oneDotEightDotEight := getK8sVersionComponents("1.8.8", kubernetesImageBaseType, nil)
if oneDotEightDotEight == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.8"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.8"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.8.8",
common.KubeProxyAddonName: "hyperkube-amd64:v1.8.8",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.8.8",
"windowszip": "v1.8.8-1int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": k8sComponent["heapster"],
common.MetricsServerAddonName: k8sComponent["metrics-server"],
"kube-dns": k8sComponent["kube-dns"],
common.WindowsArtifactComponentName: "v1.8.8-1int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: k8sComponent[common.HeapsterAddonName],
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.KubeDNSAddonName: k8sComponent[common.KubeDNSAddonName],
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": k8sComponent["dnsmasq"],
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: k8sComponent["rescheduler"],
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: k8sComponent[common.DNSMasqComponentName],
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: k8sComponent[common.ReschedulerAddonName],
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -869,28 +870,28 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotEightDotEight).To(Equal(expected))
oneDotSevenDotZero := getK8sVersionComponents("1.7.13", nil)
oneDotSevenDotZero := getK8sVersionComponents("1.7.13", kubernetesImageBaseType, nil)
if oneDotSevenDotZero == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.7"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.7"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.7.13",
common.KubeProxyAddonName: "hyperkube-amd64:v1.7.13",
common.DashboardAddonName: k8sComponent["dashboard"],
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": k8sComponent["heapster"],
common.MetricsServerAddonName: k8sComponent["metrics-server"],
"kube-dns": k8sComponent["kube-dns"],
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: k8sComponent[common.HeapsterAddonName],
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.KubeDNSAddonName: k8sComponent[common.KubeDNSAddonName],
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": k8sComponent["dnsmasq"],
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: k8sComponent["rescheduler"],
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: k8sComponent[common.DNSMasqComponentName],
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: k8sComponent[common.ReschedulerAddonName],
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
"nodestatusfreq": DefaultKubernetesNodeStatusUpdateFrequency,
"nodegraceperiod": DefaultKubernetesCtrlMgrNodeMonitorGracePeriod,
"podeviction": DefaultKubernetesCtrlMgrPodEvictionTimeout,
@ -908,43 +909,43 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(oneDotSevenDotZero).To(Equal(expected))
override := getK8sVersionComponents("1.9.3", map[string]string{"windowszip": "v1.9.3-2int.zip"})
override := getK8sVersionComponents("1.9.3", kubernetesImageBaseType, map[string]string{common.WindowsArtifactComponentName: "v1.9.3-2int.zip"})
if override == nil {
t.Fatalf("getK8sVersionComponents() should not return nil for valid version")
}
k8sComponent = k8sComponentVersions["1.9"]
k8sComponent = kubernetesImageBaseVersionedImages[kubernetesImageBaseType]["1.9"]
expected = map[string]string{
common.Hyperkube: "hyperkube-amd64:v1.9.3",
common.KubeProxyAddonName: "hyperkube-amd64:v1.9.3",
common.CloudControllerManagerComponentName: "cloud-controller-manager-amd64:v1.9.3",
"windowszip": "v1.9.3-2int.zip",
common.DashboardAddonName: dashboardImageReference,
"exechealthz": execHealthZImageReference,
"addonresizer": k8sComponent["addon-resizer"],
"heapster": heapsterImageReference,
common.MetricsServerAddonName: k8sComponent["metrics-server"],
"kube-dns": kubeDNSImageReference,
common.WindowsArtifactComponentName: "v1.9.3-2int.zip",
common.DashboardAddonName: getDefaultImage(common.DashboardAddonName, kubernetesImageBaseType),
common.ExecHealthZComponentName: getDefaultImage(common.ExecHealthZComponentName, kubernetesImageBaseType),
common.AddonResizerComponentName: k8sComponent[common.AddonResizerComponentName],
common.HeapsterAddonName: getDefaultImage(common.HeapsterAddonName, kubernetesImageBaseType),
common.MetricsServerAddonName: k8sComponent[common.MetricsServerAddonName],
common.KubeDNSAddonName: getDefaultImage(common.KubeDNSAddonName, kubernetesImageBaseType),
common.AddonManagerComponentName: k8sComponent[common.AddonManagerComponentName],
"dnsmasq": kubeDNSMasqNannyImageReference,
"pause": pauseImageReference,
common.TillerAddonName: tillerImageReference,
common.ReschedulerAddonName: k8sComponent["rescheduler"],
common.ACIConnectorAddonName: virtualKubeletImageReference,
common.ContainerMonitoringAddonName: omsImageReference,
common.AzureCNINetworkMonitorAddonName: azureCNINetworkMonitorImageReference,
common.DNSMasqComponentName: getDefaultImage(common.DNSMasqComponentName, kubernetesImageBaseType),
common.PauseComponentName: pauseImageReference,
common.TillerAddonName: getDefaultImage(common.TillerAddonName, kubernetesImageBaseType),
common.ReschedulerAddonName: k8sComponent[common.ReschedulerAddonName],
common.ACIConnectorAddonName: getDefaultImage(common.ACIConnectorAddonName, kubernetesImageBaseType),
common.ContainerMonitoringAddonName: getDefaultImage(common.ContainerMonitoringAddonName, kubernetesImageBaseType),
common.AzureCNINetworkMonitorAddonName: getDefaultImage(common.AzureCNINetworkMonitorAddonName, kubernetesImageBaseType),
common.ClusterAutoscalerAddonName: k8sComponent[common.ClusterAutoscalerAddonName],
"k8s-dns-sidecar": k8sComponent["k8s-dns-sidecar"],
common.DNSSidecarComponentName: k8sComponent[common.DNSSidecarComponentName],
common.BlobfuseFlexVolumeAddonName: blobfuseFlexVolumeImageReference,
common.SMBFlexVolumeAddonName: smbFlexVolumeImageReference,
common.KeyVaultFlexVolumeAddonName: keyvaultFlexVolumeImageReference,
common.IPMASQAgentAddonName: ipMasqAgentImageReference,
common.DNSAutoscalerAddonName: dnsAutoscalerImageReference,
common.IPMASQAgentAddonName: getDefaultImage(common.IPMASQAgentAddonName, kubernetesImageBaseType),
common.DNSAutoscalerAddonName: getDefaultImage(common.DNSAutoscalerAddonName, kubernetesImageBaseType),
common.AzureNetworkPolicyAddonName: azureNPMContainerImageReference,
"calico-typha": calicoTyphaImageReference,
"calico-cni": calicoCNIImageReference,
"calico-node": calicoNodeImageReference,
"calico-pod2daemon": calicoPod2DaemonImageReference,
"calico-cluster-proportional-autoscaler": calicoClusterProportionalAutoscalerImageReference,
common.CalicoTyphaComponentName: calicoTyphaImageReference,
common.CalicoCNIComponentName: calicoCNIImageReference,
common.CalicoNodeComponentName: calicoNodeImageReference,
common.CalicoPod2DaemonComponentName: calicoPod2DaemonImageReference,
common.CalicoClusterAutoscalerComponentName: calicoClusterProportionalAutoscalerImageReference,
common.CiliumAgentContainerName: ciliumAgentImageReference,
common.CiliumCleanStateContainerName: ciliumCleanStateImageReference,
common.CiliumOperatorContainerName: ciliumOperatorImageReference,
@ -979,7 +980,7 @@ func TestGetK8sVersionComponents(t *testing.T) {
}
g.Expect(override).To(Equal(expected))
unknown := getK8sVersionComponents("1.0.0", nil)
unknown := getK8sVersionComponents("1.0.0", kubernetesImageBaseType, nil)
if unknown != nil {
t.Fatalf("getK8sVersionComponents() should return nil for unknown k8s version")
}

Просмотреть файл

@ -418,6 +418,7 @@ const (
// Kubernetes specific configuration
type KubernetesConfig struct {
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
KubernetesImageBaseType string `json:"kubernetesImageBaseType,omitempty"`
MCRKubernetesImageBase string `json:"mcrKubernetesImageBase,omitempty"`
ClusterSubnet string `json:"clusterSubnet,omitempty"`
NetworkPolicy string `json:"networkPolicy,omitempty"`
@ -1790,7 +1791,7 @@ func (o *OrchestratorProfile) IsPrivateCluster() bool {
// GetPodInfraContainerSpec returns the sandbox image as a string (ex: k8s.gcr.io/pause-amd64:3.1)
func (o *OrchestratorProfile) GetPodInfraContainerSpec() string {
return o.KubernetesConfig.MCRKubernetesImageBase + K8sComponentsByVersionMap[o.OrchestratorVersion]["pause"]
return o.KubernetesConfig.MCRKubernetesImageBase + GetK8sComponentsByVersionMap(o.KubernetesConfig)[o.OrchestratorVersion][common.PauseComponentName]
}
// HasAadProfile returns true if the has aad profile
@ -2018,7 +2019,7 @@ func (p *Properties) GetKubernetesVersion() string {
// GetKubernetesHyperkubeSpec returns the string to use for the Kubernetes hyperkube image.
func (p *Properties) GetKubernetesHyperkubeSpec() string {
var kubernetesHyperkubeSpec string
k8sComponents := K8sComponentsByVersionMap[p.OrchestratorProfile.OrchestratorVersion]
k8sComponents := GetK8sComponentsByVersionMap(p.OrchestratorProfile.KubernetesConfig)[p.OrchestratorProfile.OrchestratorVersion]
kubernetesHyperkubeSpec = p.OrchestratorProfile.KubernetesConfig.KubernetesImageBase + k8sComponents["hyperkube"]
if p.IsAzureStackCloud() {
kubernetesHyperkubeSpec = kubernetesHyperkubeSpec + AzureStackSuffix

Просмотреть файл

@ -301,6 +301,7 @@ const (
// Kubernetes specific configuration
type KubernetesConfig struct {
KubernetesImageBase string `json:"kubernetesImageBase,omitempty"`
KubernetesImageBaseType string `json:"kubernetesImageBaseType,omitempty"`
MCRKubernetesImageBase string `json:"mcrKubernetesImageBase,omitempty"`
ClusterSubnet string `json:"clusterSubnet,omitempty"`
DNSServiceIP string `json:"dnsServiceIP,omitempty"`

Просмотреть файл

@ -35,8 +35,9 @@ var (
"3.1.0", "3.1.1", "3.1.2", "3.1.2", "3.1.3", "3.1.4", "3.1.5", "3.1.6", "3.1.7", "3.1.8", "3.1.9", "3.1.10",
"3.2.0", "3.2.1", "3.2.2", "3.2.3", "3.2.4", "3.2.5", "3.2.6", "3.2.7", "3.2.8", "3.2.9", "3.2.11", "3.2.12",
"3.2.13", "3.2.14", "3.2.15", "3.2.16", "3.2.23", "3.2.24", "3.2.25", "3.2.26", "3.3.0", "3.3.1", "3.3.8", "3.3.9", "3.3.10", "3.3.13", "3.3.15", "3.3.18"}
containerdValidVersions = [...]string{"1.1.5", "1.1.6", "1.2.4"}
networkPluginPlusPolicyAllowed = []k8sNetworkConfig{
containerdValidVersions = [...]string{"1.1.5", "1.1.6", "1.2.4"}
kubernetesImageBaseTypeValidVersions = [...]string{"", common.KubernetesImageBaseTypeGCR}
networkPluginPlusPolicyAllowed = []k8sNetworkConfig{
{
networkPlugin: "",
networkPolicy: "",
@ -756,7 +757,7 @@ func (a *Properties) validateAddons() error {
if a.ServicePrincipalProfile == nil || a.OrchestratorProfile.KubernetesConfig.UseManagedIdentity {
return errors.New("Azure Policy add-on requires service principal profile to be specified")
}
case "kube-dns":
case common.KubeDNSAddonName:
kubeDNSEnabled = true
case common.CoreDNSAddonName:
corednsEnabled = true
@ -1447,6 +1448,9 @@ func (k *KubernetesConfig) Validate(k8sVersion string, hasWindows, ipv6DualStack
if e := k.validateNetworkMode(); e != nil {
return e
}
if e := k.validateKubernetesImageBaseType(); e != nil {
return e
}
return nil
}
@ -1548,6 +1552,15 @@ func (k *KubernetesConfig) validateNetworkMode() error {
return nil
}
func (k *KubernetesConfig) validateKubernetesImageBaseType() error {
for _, valid := range kubernetesImageBaseTypeValidVersions {
if valid == k.KubernetesImageBaseType {
return nil
}
}
return errors.Errorf("Invalid kubernetesImageBaseType value \"%s\", please use one of the following versions: %s", k.KubernetesImageBaseType, kubernetesImageBaseTypeValidVersions)
}
func (k *KubernetesConfig) isUsingCustomKubeComponent() bool {
return k.CustomKubeAPIServerImage != "" || k.CustomKubeControllerManagerImage != "" || k.CustomKubeProxyImage != "" || k.CustomKubeSchedulerImage != "" || k.CustomKubeBinaryURL != ""
}

Просмотреть файл

@ -2451,7 +2451,7 @@ func Test_Properties_ValidateAddons(t *testing.T) {
p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: "kube-dns",
Name: common.KubeDNSAddonName,
Enabled: to.BoolPtr(true),
},
{
@ -4515,3 +4515,44 @@ func TestValidateAzureStackSupport(t *testing.T) {
})
}
}
func TestValidateKubernetesImageBaseType(t *testing.T) {
tests := map[string]struct {
k *KubernetesConfig
expectedError error
}{
"should not error for zero-value kubernetesImageBaseType value": {
k: &KubernetesConfig{},
expectedError: nil,
},
"should not error for empty kubernetesImageBaseType value": {
k: &KubernetesConfig{
KubernetesImageBaseType: "",
},
expectedError: nil,
},
"should not error for valid kubernetesImageBaseType value": {
k: &KubernetesConfig{
KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR,
},
expectedError: nil,
},
"should error on unknown kubernetesImageBaseType value": {
k: &KubernetesConfig{
KubernetesImageBaseType: common.KubernetesImageBaseTypeMCR, // TODO change this to "should not error" when MCR type is enabled
},
expectedError: errors.Errorf("Invalid kubernetesImageBaseType value \"%s\", please use one of the following versions: %s", "mcr", kubernetesImageBaseTypeValidVersions),
},
}
for testName, test := range tests {
test := test
t.Run(testName, func(t *testing.T) {
t.Parallel()
err := test.k.validateKubernetesImageBaseType()
if !helpers.EqualError(err, test.expectedError) {
t.Errorf("expected error: %v, got: %v", test.expectedError, err)
}
})
}
}

Просмотреть файл

@ -1791,6 +1791,7 @@ func TestWrapAsVariableObject(t *testing.T) {
func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
specConfig := api.AzureCloudSpecEnvMap["AzurePublicCloud"].KubernetesSpecConfig
k8sComponentsByVersionMap := api.GetK8sComponentsByVersionMap(&api.KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR})
cases := []struct {
name string
addon api.KubernetesAddon
@ -1828,7 +1829,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
Pools: []api.AddonNodePoolsConfig{
@ -1866,7 +1867,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -1899,7 +1900,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
Pools: []api.AddonNodePoolsConfig{
@ -1949,7 +1950,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -1982,7 +1983,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
},
@ -2016,7 +2017,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2049,7 +2050,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
Pools: []api.AddonNodePoolsConfig{
@ -2098,7 +2099,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2131,7 +2132,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
Pools: []api.AddonNodePoolsConfig{
@ -2181,7 +2182,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
Location: "chinanorth",
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2214,7 +2215,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
Pools: []api.AddonNodePoolsConfig{
@ -2264,7 +2265,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
Location: "germanynortheast",
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2297,7 +2298,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
},
},
Pools: []api.AddonNodePoolsConfig{
@ -2347,7 +2348,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
},
Location: "usgovnorth",
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.ClusterAutoscalerAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2456,6 +2457,7 @@ func TestGetClusterAutoscalerAddonFuncMap(t *testing.T) {
func TestGetAddonFuncMap(t *testing.T) {
specConfig := api.AzureCloudSpecEnvMap["AzurePublicCloud"].KubernetesSpecConfig
k8sComponentsByVersionMap := api.GetK8sComponentsByVersionMap(&api.KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR})
cases := []struct {
name string
addon api.KubernetesAddon
@ -2489,7 +2491,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2514,7 +2516,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2531,7 +2533,7 @@ func TestGetAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2560,7 +2562,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2585,7 +2587,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2606,7 +2608,7 @@ func TestGetAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2635,7 +2637,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2660,7 +2662,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2677,7 +2679,7 @@ func TestGetAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2706,7 +2708,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2732,7 +2734,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2749,7 +2751,7 @@ func TestGetAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2778,7 +2780,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2805,7 +2807,7 @@ func TestGetAddonFuncMap(t *testing.T) {
MemoryRequests: "300Mi",
CPULimits: "100m",
MemoryLimits: "300Mi",
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
},
},
},
@ -2826,7 +2828,7 @@ func TestGetAddonFuncMap(t *testing.T) {
},
},
},
expectedImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.4"][common.CoreDNSAddonName],
expectedCPUReqs: "100m",
expectedCPULimits: "100m",
expectedMemReqs: "300Mi",
@ -2912,6 +2914,7 @@ func TestGetAddonFuncMap(t *testing.T) {
func TestGetComponentFuncMap(t *testing.T) {
specConfig := api.AzureCloudSpecEnvMap["AzurePublicCloud"].KubernetesSpecConfig
k8sComponentsByVersionMap := api.GetK8sComponentsByVersionMap(&api.KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeGCR})
//specConfigAzureStack := api.AzureCloudSpecEnvMap["AzureStackCloud"].KubernetesSpecConfig
cases := []struct {
name string
@ -2946,7 +2949,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.APIServerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
},
},
Config: map[string]string{
@ -2959,7 +2962,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.ControllerManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
},
},
Config: map[string]string{
@ -2972,7 +2975,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.CloudControllerManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
},
},
Config: map[string]string{
@ -2985,7 +2988,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.SchedulerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
},
},
Config: map[string]string{
@ -2998,7 +3001,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.AddonManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
},
},
},
@ -3035,19 +3038,19 @@ func TestGetComponentFuncMap(t *testing.T) {
expectedMemLimits: "",
expectedIsAzureStackCloud: false,
expectedIsKubernetesVersionGeOneDotFifteenDotZero: true,
expectedAPIServerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedAPIServerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedAPIServerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-apiserver\""),
expectedAPIServerArgs: fmt.Sprintf("\"baz=bang\", \"foo=bar\""),
expectedControllerManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedControllerManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedControllerManagerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-controller-manager\""),
expectedControllerManagerArgs: fmt.Sprintf("\"quid=ergo\", \"this=that\""),
expectedCloudControllerManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
expectedCloudControllerManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
expectedCloudControllerManagerCommand: fmt.Sprintf("\"cloud-controller-manager\""),
expectedCloudControllerManagerArgs: fmt.Sprintf("\"bugs=bunny\""),
expectedSchedulerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedSchedulerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedSchedulerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-scheduler\""),
expectedSchedulerArgs: fmt.Sprintf("\"daffy=duck\", \"elmer=fudd\", \"porky=pig\""),
expectedAddonManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
expectedAddonManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
},
{
name: "Azure Stack",
@ -3058,7 +3061,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.APIServerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
},
},
Config: map[string]string{
@ -3071,7 +3074,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.ControllerManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
},
},
Config: map[string]string{
@ -3084,7 +3087,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.CloudControllerManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
},
},
Config: map[string]string{
@ -3097,7 +3100,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.SchedulerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
},
},
Config: map[string]string{
@ -3110,7 +3113,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.AddonManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
},
},
},
@ -3152,19 +3155,19 @@ func TestGetComponentFuncMap(t *testing.T) {
expectedMemLimits: "",
expectedIsAzureStackCloud: true,
expectedIsKubernetesVersionGeOneDotFifteenDotZero: true,
expectedAPIServerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
expectedAPIServerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
expectedAPIServerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-apiserver\""),
expectedAPIServerArgs: fmt.Sprintf("\"baz=bang\", \"foo=bar\""),
expectedControllerManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
expectedControllerManagerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-controller-manager\""),
expectedControllerManagerArgs: fmt.Sprintf("\"quid=ergo\", \"this=that\""),
expectedCloudControllerManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
expectedCloudControllerManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
expectedCloudControllerManagerCommand: fmt.Sprintf("\"cloud-controller-manager\""),
expectedCloudControllerManagerArgs: fmt.Sprintf("\"bugs=bunny\""),
expectedSchedulerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
expectedSchedulerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube] + common.AzureStackSuffix,
expectedSchedulerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-scheduler\""),
expectedSchedulerArgs: fmt.Sprintf("\"daffy=duck\", \"elmer=fudd\", \"porky=pig\""),
expectedAddonManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
expectedAddonManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
},
{
name: "1.14",
@ -3175,7 +3178,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.APIServerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
},
},
Config: map[string]string{
@ -3188,7 +3191,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.ControllerManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
},
},
Config: map[string]string{
@ -3201,7 +3204,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.CloudControllerManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
},
},
Config: map[string]string{
@ -3214,7 +3217,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.SchedulerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
},
},
Config: map[string]string{
@ -3227,7 +3230,7 @@ func TestGetComponentFuncMap(t *testing.T) {
Containers: []api.KubernetesContainerSpec{
{
Name: common.AddonManagerComponentName,
Image: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
Image: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
},
},
},
@ -3264,19 +3267,19 @@ func TestGetComponentFuncMap(t *testing.T) {
expectedMemLimits: "",
expectedIsAzureStackCloud: false,
expectedIsKubernetesVersionGeOneDotFifteenDotZero: false,
expectedAPIServerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedAPIServerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedAPIServerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-apiserver\""),
expectedAPIServerArgs: fmt.Sprintf("\"baz=bang\", \"foo=bar\""),
expectedControllerManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedControllerManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedControllerManagerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-controller-manager\""),
expectedControllerManagerArgs: fmt.Sprintf("\"quid=ergo\", \"this=that\""),
expectedCloudControllerManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
expectedCloudControllerManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.CloudControllerManagerComponentName],
expectedCloudControllerManagerCommand: fmt.Sprintf("\"cloud-controller-manager\""),
expectedCloudControllerManagerArgs: fmt.Sprintf("\"bugs=bunny\""),
expectedSchedulerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedSchedulerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.Hyperkube],
expectedSchedulerCommand: fmt.Sprintf("\"/hyperkube\", \"kube-scheduler\""),
expectedSchedulerArgs: fmt.Sprintf("\"daffy=duck\", \"elmer=fudd\", \"porky=pig\""),
expectedAddonManagerImage: specConfig.KubernetesImageBase + api.K8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
expectedAddonManagerImage: specConfig.KubernetesImageBase + k8sComponentsByVersionMap["1.15.7"][common.AddonManagerComponentName],
},
}

Просмотреть файл

@ -21,7 +21,7 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
if orchestratorProfile.IsKubernetes() {
k8sVersion := orchestratorProfile.OrchestratorVersion
k8sComponents := api.K8sComponentsByVersionMap[k8sVersion]
k8sComponents := api.GetK8sComponentsByVersionMap(properties.OrchestratorProfile.KubernetesConfig)[k8sVersion]
kubernetesConfig := orchestratorProfile.KubernetesConfig
kubernetesImageBase := kubernetesConfig.KubernetesImageBase
@ -99,9 +99,9 @@ func assignKubernetesParameters(properties *api.Properties, parametersMap params
kubeBinariesSASURL := kubernetesConfig.CustomWindowsPackageURL
if kubeBinariesSASURL == "" {
if properties.IsAzureStackCloud() {
kubeBinariesSASURL = cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase + common.AzureStackPrefix + k8sComponents["windowszip"]
kubeBinariesSASURL = cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase + common.AzureStackPrefix + k8sComponents[common.WindowsArtifactComponentName]
} else {
kubeBinariesSASURL = cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase + k8sComponents["windowszip"]
kubeBinariesSASURL = cloudSpecConfig.KubernetesSpecConfig.KubeBinariesSASURLBase + k8sComponents[common.WindowsArtifactComponentName]
}
}
addValue(parametersMap, "kubeBinariesSASURL", kubeBinariesSASURL)

Просмотреть файл

@ -701,7 +701,7 @@ func getContainerServiceFuncMap(cs *api.ContainerService) template.FuncMap {
},
"GetHyperkubeImageReference": func() string {
hyperkubeImageBase := cs.Properties.OrchestratorProfile.KubernetesConfig.KubernetesImageBase
k8sComponents := api.K8sComponentsByVersionMap[cs.Properties.OrchestratorProfile.OrchestratorVersion]
k8sComponents := api.GetK8sComponentsByVersionMap(cs.Properties.OrchestratorProfile.KubernetesConfig)[cs.Properties.OrchestratorProfile.OrchestratorVersion]
hyperkubeImage := hyperkubeImageBase + k8sComponents[common.Hyperkube]
if cs.Properties.IsAzureStackCloud() {
hyperkubeImage = hyperkubeImage + common.AzureStackSuffix

Просмотреть файл

@ -156,7 +156,7 @@ var _ = AfterSuite(func() {
pod.PrintPodsLogs("kube-addon-manager", "kube-system", 5*time.Second, 1*time.Minute)
pod.PrintPodsLogs("kube-proxy", "kube-system", 5*time.Second, 1*time.Minute)
pod.PrintPodsLogs("kube-scheduler", "kube-system", 5*time.Second, 1*time.Minute)
pod.PrintPodsLogs("kube-apiserver", "kube-system", 5*time.Second, 1*time.Minute)
pod.PrintPodsLogs(common.APIServerComponentName, "kube-system", 5*time.Second, 1*time.Minute)
pod.PrintPodsLogs("kube-controller-manager", "kube-system", 5*time.Second, 1*time.Minute)
}
})
@ -714,9 +714,9 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
It("should have DNS pod running", func() {
var err error
var running bool
if hasAddon, _ := eng.HasAddon("kube-dns"); hasAddon {
if hasAddon, _ := eng.HasAddon(common.KubeDNSAddonName); hasAddon {
By("Ensuring that kube-dns is running")
running, err = pod.WaitOnSuccesses("kube-dns", "kube-system", kubeSystemPodsReadinessChecks, sleepBetweenRetriesWhenWaitingForPodReady, cfg.Timeout)
running, err = pod.WaitOnSuccesses(common.KubeDNSAddonName, "kube-system", kubeSystemPodsReadinessChecks, sleepBetweenRetriesWhenWaitingForPodReady, cfg.Timeout)
}
if hasAddon, _ := eng.HasAddon("coredns"); hasAddon {
By("Ensuring that coredns is running")
@ -727,7 +727,7 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
})
It("should have core kube-system componentry running", func() {
coreComponents := []string{"kube-proxy", "kube-addon-manager", "kube-apiserver", "kube-controller-manager", "kube-scheduler"}
coreComponents := []string{"kube-proxy", "kube-addon-manager", common.APIServerComponentName, "kube-controller-manager", "kube-scheduler"}
if to.Bool(eng.ExpandedDefinition.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager) {
coreComponents = append(coreComponents, "cloud-controller-manager")
if common.IsKubernetesVersionGe(eng.ExpandedDefinition.Properties.OrchestratorProfile.OrchestratorVersion, "1.13.0") {
@ -767,7 +767,7 @@ var _ = Describe("Azure Container Cluster using the Kubernetes Orchestrator", fu
})
It("should have the correct IP address for the apiserver", func() {
pods, err := pod.GetAllRunningByPrefixWithRetry("kube-apiserver", "kube-system", 3*time.Second, cfg.Timeout)
pods, err := pod.GetAllRunningByPrefixWithRetry(common.APIServerComponentName, "kube-system", 3*time.Second, cfg.Timeout)
Expect(err).NotTo(HaveOccurred())
By("Ensuring that the correct IP address has been applied to the apiserver")
expectedIPAddress := eng.ExpandedDefinition.Properties.MasterProfile.FirstConsecutiveStaticIP