diff --git a/cmd/generate_test.go b/cmd/generate_test.go index df4f131df0..3c088b462d 100644 --- a/cmd/generate_test.go +++ b/cmd/generate_test.go @@ -797,11 +797,6 @@ func TestExampleAPIModels(t *testing.T) { apiModelPath: "../examples/custom-shared-image.json", setArgs: defaultSet, }, - { - name: "containerd", - apiModelPath: "../examples/kubernetes-containerd.json", - setArgs: defaultSet, - }, { name: "Standard_D2", apiModelPath: "../examples/kubernetes-D2.json", diff --git a/docs/topics/clusterdefinitions.md b/docs/topics/clusterdefinitions.md index f9b460206b..71d558e89b 100644 --- a/docs/topics/clusterdefinitions.md +++ b/docs/topics/clusterdefinitions.md @@ -72,7 +72,7 @@ $ aks-engine get-versions | kubernetesImageBase | no | Specifies the default image base URL (everything preceding the actual image filename) to be used for all kubernetes-related containers such as hyperkube, cloud-controller-manager, kube-addon-manager, etc. e.g., `k8s.gcr.io/` | | loadBalancerSku | no | Sku of Load Balancer and Public IP. Candidate values are: `basic` and `standard`. If not set, it will be default to "standard". NOTE: Because VMs behind standard SKU load balancer will not be able to access the internet without an outbound rule configured with at least one frontend IP, AKS Engine creates a Load Balancer with an outbound rule and with agent nodes added to the backend pool during cluster creation, as described in the [Outbound NAT for internal Standard Load Balancer scenarios doc](https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-rules-overview#outbound-nat-for-internal-standard-load-balancer-scenarios) | | loadBalancerOutboundIPs | no | Number of outbound IP addresses (e.g., 3) to use in Standard LoadBalancer configuration. If not set, AKS Engine will configure a single outbound IP address. You may want more than one outbound IP address if you are running a large cluster that is processing lots of connections. See [here](https://docs.microsoft.com/en-us/azure/load-balancer/load-balancer-outbound-connections#multifesnat) for more documentation about how adding more outbound IP addresses can increase the number of SNAT ports available for use by the Standard Load Balancer in your cluster. Note: this value is only configurable at cluster creation time, it can not be changed using `aks-engine upgrade`.| -| networkPlugin | no | Specifies the network plugin implementation for the cluster. Valid values are:
`"azure"` (default), which provides an Azure native networking experience
`"kubenet"` for k8s software networking implementation.
`"flannel"` for using CoreOS Flannel
`"cilium"` for using the default Cilium CNI IPAM (requires the `"cilium"` networkPolicy as well)
`"antrea"` for using the Antrea network plugin (requires the `"antrea"` networkPolicy as well) | +| networkPlugin | no | Specifies the network plugin implementation for the cluster. Valid values are:
`"azure"` (default), which provides an Azure native networking experience
`"kubenet"` for k8s software networking implementation.
`"cilium"` for using the default Cilium CNI IPAM (requires the `"cilium"` networkPolicy as well)
`"antrea"` for using the Antrea network plugin (requires the `"antrea"` networkPolicy as well) | | networkPolicy | no | Specifies the network policy enforcement tool for the cluster (currently Linux-only). Valid values are:
`"calico"` for Calico network policy.
`"cilium"` for cilium network policy (uses the `"cilium"` networkPlugin exclusively).
`"antrea"` for Antrea network policy (uses the `"antrea"` networkPlugin exclusively).
`"azure"` (experimental) for Azure CNI-compliant network policy (note: Azure CNI-compliant network policy requires explicit `"networkPlugin": "azure"` configuration as well).
See [network policy examples](../../examples/networkpolicy) for more information. | | privateCluster | no | Build a cluster without public addresses assigned. See `privateClusters` [below](#feat-private-cluster). | | schedulerConfig | no | Configure various runtime configuration for scheduler. See `schedulerConfig` [below](#feat-scheduler-config) | @@ -131,7 +131,6 @@ $ aks-engine get-versions | aad | true if adminGroupID is specified in the aadProfile configuration | 0 | ClusterRoleBinding specification that adds an admin group matching the adminGroupID | | [calico](https://docs.projectcalico.org/archive/v3.8/introduction/) | true if networkPolicy is "calico"; | 6 | A NetworkPolicy implementation by the Calico project (currently supports v3.8) | | [cilium](https://docs.cilium.io/en/v1.4/kubernetes/policy/#ciliumnetworkpolicy) | true if networkPolicy is "cilium"; currently validated against Kubernetes v1.13, v1.14, and v1.15 | 0 | A NetworkPolicy CRD implementation by the Cilium project (currently supports v1.4) | -| [flannel](https://coreos.com/flannel/docs/0.8.0/index.html) | false | 0 | An addon that delivers flannel: a virtual network that gives a subnet to each host for use with container runtimes. The current implementation is v0.8.0. If `networkPlugin` is set to `"flannel"` this addon will be enabled automatically. Not compatible with any other `networkPlugin` or `networkPolicy`. This addon **requires** containerd (`"containerRuntime": "containerd"`)| | [csi-secrets-store](../../examples/addons/csi-secrets-store/README.md) | true (for 1.16+ clusters) | as many as linux agent nodes | Integrates secrets stores (Azure keyvault) via a [Container Storage Interface (CSI)](https://kubernetes-csi.github.io/docs/) volume. | | [azure-arc-onboarding](../../examples/addons/azure-arc-onboarding/README.md) | false | 7 | Attaches the cluster to Azure Arc enabled Kubernetes. | diff --git a/examples/kubernetes-containerd.json b/examples/kubernetes-containerd.json deleted file mode 100644 index 1e08803ebd..0000000000 --- a/examples/kubernetes-containerd.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "apiVersion": "vlabs", - "properties": { - "orchestratorProfile": { - "orchestratorRelease": "1.16", - "kubernetesConfig": { - "networkPlugin": "flannel", - "containerRuntime": "containerd", - "addons": [ - { - "name": "tiller", - "enabled" : false - }, - { - "name": "kubernetes-dashboard", - "enabled" : false - } - ] - } - }, - "masterProfile": { - "count": 1, - "dnsPrefix": "", - "vmSize": "Standard_D2_v3" - }, - "agentPoolProfiles": [ - { - "name": "agentpool1", - "count": 3, - "vmSize": "Standard_D4s_v3", - "availabilityProfile": "AvailabilitySet" - } - ], - "linuxProfile": { - "adminUsername": "azureuser", - "ssh": { - "publicKeys": [ - { - "keyData": "" - } - ] - } - } - } -} diff --git a/examples/networkplugin/README.md b/examples/networkplugin/README.md index 760895c840..bb5b019377 100644 --- a/examples/networkplugin/README.md +++ b/examples/networkplugin/README.md @@ -4,7 +4,6 @@ There are 5 different Network Plugin options : - Azure Container Networking (default) - Kubenet -- Flannel (docs are //TODO) - Cilium (CNI IPAM implementation that pairs w/ cilium NetworkPolicy addon; only works w/ `"networkPolicy": "cilium"`) - Antrea (CNI IPAM implementation that pairs w/ antrea NetworkPolicy addon; only works w/ `"networkPolicy": "antrea"`) diff --git a/pkg/api/addons.go b/pkg/api/addons.go index 9ce32d58f6..925bdc5431 100644 --- a/pkg/api/addons.go +++ b/pkg/api/addons.go @@ -812,7 +812,7 @@ func (cs *ContainerService) setAddonsConfig(isUpgrade bool) { defaultFlannelAddonsConfig := KubernetesAddon{ Name: common.FlannelAddonName, - Enabled: to.BoolPtr(o.KubernetesConfig.NetworkPlugin == NetworkPluginFlannel), + Enabled: to.BoolPtr(false), Containers: []KubernetesContainerSpec{ { Name: common.KubeFlannelContainerName, diff --git a/pkg/api/convertertoapi.go b/pkg/api/convertertoapi.go index aae3c3c9c6..d578a0e874 100644 --- a/pkg/api/convertertoapi.go +++ b/pkg/api/convertertoapi.go @@ -353,11 +353,7 @@ func setVlabsKubernetesDefaults(vp *vlabs.Properties, api *OrchestratorProfile) if vp.HasWindows() { api.KubernetesConfig.NetworkPlugin = vlabs.DefaultNetworkPluginWindows } else { - if vp.OrchestratorProfile.KubernetesConfig.IsAddonEnabled(common.FlannelAddonName) { - api.KubernetesConfig.NetworkPlugin = NetworkPluginFlannel - } else { - api.KubernetesConfig.NetworkPlugin = vlabs.DefaultNetworkPlugin - } + api.KubernetesConfig.NetworkPlugin = vlabs.DefaultNetworkPlugin } } } diff --git a/pkg/api/convertertoapi_test.go b/pkg/api/convertertoapi_test.go index b4f4db4443..27661c2041 100644 --- a/pkg/api/convertertoapi_test.go +++ b/pkg/api/convertertoapi_test.go @@ -6,7 +6,6 @@ package api import ( "testing" - "github.com/Azure/aks-engine/pkg/api/common" "github.com/Azure/go-autorest/autorest/to" "github.com/davecgh/go-spew/spew" @@ -1002,24 +1001,6 @@ func TestSetVlabsKubernetesDefaults(t *testing.T) { expectedNetworkPlugin: "", expectedNetworkPolicy: "antrea", }, - { - name: "flannel addon", - p: &vlabs.Properties{ - OrchestratorProfile: &vlabs.OrchestratorProfile{ - KubernetesConfig: &vlabs.KubernetesConfig{ - NetworkPlugin: "", - Addons: []vlabs.KubernetesAddon{ - { - Name: common.FlannelAddonName, - Enabled: to.BoolPtr(true), - }, - }, - }, - }, - }, - expectedNetworkPlugin: NetworkPluginFlannel, - expectedNetworkPolicy: "", - }, } for _, test := range tests { diff --git a/pkg/api/defaults.go b/pkg/api/defaults.go index 6ea13ef9c1..d182a609b1 100644 --- a/pkg/api/defaults.go +++ b/pkg/api/defaults.go @@ -194,11 +194,7 @@ func (cs *ContainerService) setOrchestratorDefaults(isUpgrade, isScale bool) { } } else { if o.KubernetesConfig.NetworkPlugin == "" { - if o.KubernetesConfig.IsAddonEnabled(common.FlannelAddonName) { - o.KubernetesConfig.NetworkPlugin = NetworkPluginFlannel - } else { - o.KubernetesConfig.NetworkPlugin = DefaultNetworkPlugin - } + o.KubernetesConfig.NetworkPlugin = DefaultNetworkPlugin } } diff --git a/pkg/api/defaults_test.go b/pkg/api/defaults_test.go index 237ddffb63..1bc00828ff 100644 --- a/pkg/api/defaults_test.go +++ b/pkg/api/defaults_test.go @@ -1061,20 +1061,6 @@ func TestNetworkPluginDefaults(t *testing.T) { properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin, DefaultNetworkPlugin) } - mockCS = getMockBaseContainerService("1.15.7") - properties = mockCS.Properties - properties.OrchestratorProfile.KubernetesConfig.Addons = []KubernetesAddon{ - { - Name: common.FlannelAddonName, - Enabled: to.BoolPtr(true), - }, - } - mockCS.setOrchestratorDefaults(true, true) - if properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin != NetworkPluginFlannel { - t.Fatalf("NetworkPlugin did not have the expected value, got %s, expected %s", - properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin, NetworkPluginFlannel) - } - mockCS = getMockBaseContainerService("1.19.2") properties = mockCS.Properties properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = NetworkPluginAzure diff --git a/pkg/api/vlabs/const.go b/pkg/api/vlabs/const.go index 89094ac980..1f1ed18a5f 100644 --- a/pkg/api/vlabs/const.go +++ b/pkg/api/vlabs/const.go @@ -129,8 +129,8 @@ const ( NetworkPolicyAntrea = "antrea" // NetworkPluginAntrea is the string expression for antrea network plugin config option NetworkPluginAntrea = NetworkPolicyAntrea - // NetworkPluginFlannel is the string expression for flannel network plugin config option - NetworkPluginFlannel = "flannel" + // NetworkPluginFlannel is the string expression for flannel network plugin config option // Deprecated + NetworkPluginFlannel = "flannel" // Deprecated // NetworkModeBridge is the string expression for bridge network mode config option NetworkModeBridge = "bridge" // NetworkModeTransparent is the string expression for transparent network mode config option diff --git a/pkg/api/vlabs/validate.go b/pkg/api/vlabs/validate.go index 131c0bd162..fdf648f4ea 100644 --- a/pkg/api/vlabs/validate.go +++ b/pkg/api/vlabs/validate.go @@ -145,7 +145,7 @@ func (a *Properties) validate(isUpdate bool) error { if e := a.validateLinuxProfile(); e != nil { return e } - if e := a.validateAddons(); e != nil { + if e := a.validateAddons(isUpdate); e != nil { return e } if e := a.validateExtensions(); e != nil { @@ -225,7 +225,7 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error { } if o.KubernetesConfig != nil { - err := o.KubernetesConfig.Validate(version, a.HasWindows(), a.FeatureFlags.IsIPv6DualStackEnabled(), a.FeatureFlags.IsIPv6OnlyEnabled()) + err := o.KubernetesConfig.Validate(version, a.HasWindows(), a.FeatureFlags.IsIPv6DualStackEnabled(), a.FeatureFlags.IsIPv6OnlyEnabled(), isUpdate) if err != nil { return err } @@ -660,7 +660,7 @@ func (a *Properties) validateLinuxProfile() error { return validateKeyVaultSecrets(a.LinuxProfile.Secrets, false) } -func (a *Properties) validateAddons() error { +func (a *Properties) validateAddons(isUpdate bool) error { if a.OrchestratorProfile.KubernetesConfig != nil && a.OrchestratorProfile.KubernetesConfig.Addons != nil { var isAvailabilitySets bool var hasNSeriesSKU bool @@ -785,17 +785,21 @@ func (a *Properties) validateAddons() error { return errors.Errorf("%s addon may only be enabled if the networkPolicy=%s", common.AntreaAddonName, NetworkPolicyAntrea) } case common.FlannelAddonName: - if a.OrchestratorProfile.KubernetesConfig.NetworkPolicy != "" { - return errors.Errorf("%s addon does not support NetworkPolicy, replace %s with \"\"", common.FlannelAddonName, a.OrchestratorProfile.KubernetesConfig.NetworkPolicy) - } - networkPlugin := a.OrchestratorProfile.KubernetesConfig.NetworkPlugin - if networkPlugin != "" { - if networkPlugin != NetworkPluginFlannel { - return errors.Errorf("%s addon is not supported with networkPlugin=%s, please use networkPlugin=%s", common.FlannelAddonName, networkPlugin, NetworkPluginFlannel) + if isUpdate { + if a.OrchestratorProfile.KubernetesConfig.NetworkPolicy != "" { + return errors.Errorf("%s addon does not support NetworkPolicy, replace %s with \"\"", common.FlannelAddonName, a.OrchestratorProfile.KubernetesConfig.NetworkPolicy) } - } - if a.OrchestratorProfile.KubernetesConfig.ContainerRuntime != Containerd { - return errors.Errorf("%s addon is only supported with containerRuntime=%s", common.FlannelAddonName, Containerd) + networkPlugin := a.OrchestratorProfile.KubernetesConfig.NetworkPlugin + if networkPlugin != "" { + if networkPlugin != NetworkPluginFlannel { + return errors.Errorf("%s addon is not supported with networkPlugin=%s, please use networkPlugin=%s", common.FlannelAddonName, networkPlugin, NetworkPluginFlannel) + } + } + if a.OrchestratorProfile.KubernetesConfig.ContainerRuntime != Containerd { + return errors.Errorf("%s addon is only supported with containerRuntime=%s", common.FlannelAddonName, Containerd) + } + } else { + return errors.Errorf("%s addon is deprecated for new clusters", common.FlannelAddonName) } case "azure-policy": isValidVersion, err := common.IsValidMinVersion(a.OrchestratorProfile.OrchestratorType, a.OrchestratorProfile.OrchestratorRelease, a.OrchestratorProfile.OrchestratorVersion, "1.14.0") @@ -1264,7 +1268,7 @@ func validatePasswordComplexity(name string, password string) (out bool) { } // Validate validates the KubernetesConfig -func (k *KubernetesConfig) Validate(k8sVersion string, hasWindows, ipv6DualStackEnabled, isIPv6 bool) error { +func (k *KubernetesConfig) Validate(k8sVersion string, hasWindows, ipv6DualStackEnabled, isIPv6, isUpdate bool) error { // number of minimum retries allowed for kubelet to post node status const minKubeletRetries = 4 @@ -1501,7 +1505,7 @@ func (k *KubernetesConfig) Validate(k8sVersion string, hasWindows, ipv6DualStack } } - if e := k.validateNetworkPlugin(hasWindows); e != nil { + if e := k.validateNetworkPlugin(hasWindows, isUpdate); e != nil { return e } if e := k.validateNetworkPolicy(k8sVersion, hasWindows); e != nil { @@ -1552,7 +1556,7 @@ func (k *KubernetesConfig) validateContainerRuntimeConfig() error { return nil } -func (k *KubernetesConfig) validateNetworkPlugin(hasWindows bool) error { +func (k *KubernetesConfig) validateNetworkPlugin(hasWindows, isUpdate bool) error { networkPlugin := k.NetworkPlugin @@ -1560,11 +1564,20 @@ func (k *KubernetesConfig) validateNetworkPlugin(hasWindows bool) error { valid := false for _, plugin := range NetworkPluginValues { if networkPlugin == plugin { - valid = true + if plugin == NetworkPluginFlannel { + if isUpdate { + valid = true + } + } else { + valid = true + } break } } if !valid { + if networkPlugin == NetworkPluginFlannel { + return errors.Errorf("networkPlugin '%s' has been deprecated and is no longer supported for new cluster creation", networkPlugin) + } return errors.Errorf("unknown networkPlugin '%s' specified", networkPlugin) } diff --git a/pkg/api/vlabs/validate_test.go b/pkg/api/vlabs/validate_test.go index 26ced7c0bf..2317c5624b 100644 --- a/pkg/api/vlabs/validate_test.go +++ b/pkg/api/vlabs/validate_test.go @@ -360,7 +360,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { // Tests that should pass across all versions for _, k8sVersion := range common.GetAllSupportedKubernetesVersions(true, false, false) { c := KubernetesConfig{} - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Errorf("should not error on empty KubernetesConfig: %v, version %s", err, k8sVersion) } @@ -385,21 +385,21 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--route-reconciliation-period": ValidKubernetesCtrlMgrRouteReconciliationPeriod, }, } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Errorf("should not error on a KubernetesConfig with valid param values: %v", err) } c = KubernetesConfig{ ClusterSubnet: "10.16.x.0/invalid", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid ClusterSubnet") } c = KubernetesConfig{ DockerBridgeSubnet: "10.120.1.0/invalid", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid DockerBridgeSubnet") } @@ -408,7 +408,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--non-masquerade-cidr": "10.120.1.0/24", }, } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Error("should not error on valid --non-masquerade-cidr") } @@ -425,7 +425,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { c = KubernetesConfig{ MaxPods: KubernetesMinMaxPods - 1, } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid MaxPods") } @@ -434,7 +434,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--node-status-update-frequency": "invalid", }, } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid --node-status-update-frequency kubelet config") } @@ -443,7 +443,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--node-monitor-grace-period": "invalid", }, } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid --node-monitor-grace-period") } @@ -455,7 +455,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--node-status-update-frequency": "10s", }, } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when --node-monitor-grace-period is not sufficiently larger than --node-status-update-frequency kubelet config") } @@ -464,7 +464,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--pod-eviction-timeout": "invalid", }, } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid --pod-eviction-timeout") } @@ -473,21 +473,21 @@ func Test_KubernetesConfig_Validate(t *testing.T) { "--route-reconciliation-period": "invalid", }, } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error on invalid --route-reconciliation-period") } c = KubernetesConfig{ DNSServiceIP: "192.168.0.10", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when DNSServiceIP but not ServiceCidr") } c = KubernetesConfig{ ServiceCidr: "192.168.0.10/24", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when ServiceCidr but not DNSServiceIP") } @@ -495,7 +495,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "invalid", ServiceCidr: "192.168.0.0/24", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when DNSServiceIP is invalid") } @@ -503,7 +503,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "192.168.1.10", ServiceCidr: "192.168.0.0/not-a-len", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when ServiceCidr is invalid") } @@ -511,7 +511,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "192.168.1.10", ServiceCidr: "192.168.0.0/24", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when DNSServiceIP is outside of ServiceCidr") } @@ -519,7 +519,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "172.99.255.255", ServiceCidr: "172.99.0.1/16", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when DNSServiceIP is broadcast address of ServiceCidr") } @@ -527,7 +527,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "172.99.0.1", ServiceCidr: "172.99.0.1/16", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when DNSServiceIP is first IP of ServiceCidr") } @@ -535,7 +535,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "172.99.255.10", ServiceCidr: "172.99.0.1/16", } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Error("should not error when DNSServiceIP and ServiceCidr are valid") } @@ -544,7 +544,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { NetworkPlugin: "azure", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when ClusterSubnet has a mask of 24 bits or higher") } @@ -553,7 +553,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { NetworkPlugin: "azure", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when ClusterSubnet has a mask of 24 bits or higher") } @@ -561,7 +561,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ProxyMode: KubeProxyMode("invalid"), } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when ProxyMode has an invalid string value") } @@ -570,7 +570,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ProxyMode: validProxyModeValue, } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Error("should error when ProxyMode has a valid string value") } @@ -578,7 +578,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ProxyMode: validProxyModeValue, } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Error("should error when ProxyMode has a valid string value") } } @@ -590,7 +590,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { CloudProviderBackoff: to.BoolPtr(true), CloudProviderRateLimit: to.BoolPtr(true), } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Error("should not error when basic backoff and rate limiting are set to true with no options") } } @@ -600,7 +600,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { c := KubernetesConfig{ UseCloudControllerManager: to.BoolPtr(true), } - if err := c.Validate(k8sVersion, false, false, false); err != nil { + if err := c.Validate(k8sVersion, false, false, false, false); err != nil { t.Error("should not error because UseCloudControllerManager is available since v1.8") } } @@ -612,7 +612,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ClusterSubnet: "10.244.0.0/16,ace:cab:deca::/8", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when more than 1 cluster subnet provided with ipv6dualstack feature disabled") } @@ -621,7 +621,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ClusterSubnet: "10.244.0.0/16,ace:cab:deca::/8,fec0::/7", } - if err := c.Validate(k8sVersion, false, true, false); err == nil { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil { t.Error("should error when more than 2 cluster subnets provided") } @@ -631,7 +631,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ProxyMode: "iptables", } - if err := c.Validate(k8sVersion, false, true, false); err == nil && !common.IsKubernetesVersionGe(k8sVersion, "1.18.0") { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil && !common.IsKubernetesVersionGe(k8sVersion, "1.18.0") { t.Errorf("should error with ipv6 dual stack feature enabled as iptables mode not supported in %s", k8sVersion) } @@ -639,7 +639,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { ServiceCidr: "10.0.0.0/16,fe80:20d::/112", } - if err := c.Validate(k8sVersion, false, false, false); err == nil { + if err := c.Validate(k8sVersion, false, false, false, false); err == nil { t.Error("should error when more than 1 service cidr provided with ipv6dualstack feature disabled") } @@ -651,7 +651,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "10.0.0.10", } - if err := c.Validate(k8sVersion, false, true, false); err == nil { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil { t.Error("should error when more than 2 service cidr provided with ipv6dualstack feature enabled") } @@ -663,7 +663,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "10.0.0.10", } - if err := c.Validate(k8sVersion, false, true, false); err == nil { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil { t.Error("should error when secondary cidr is invalid with ipv6dualstack feature enabled") } @@ -675,7 +675,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "10.0.0.10", } - if err := c.Validate(k8sVersion, false, true, false); err != nil { + if err := c.Validate(k8sVersion, false, true, false, false); err != nil { t.Error("shouldn't have errored with ipv6 dual stack feature enabled") } @@ -686,7 +686,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { NetworkPolicy: "azure", } - if err := c.Validate(k8sVersion, false, true, false); err == nil { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil { t.Errorf("should error when network policy defined for azure cni dual stack: %v", err) } @@ -700,7 +700,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "10.0.0.10", } - if err := c.Validate(k8sVersion, false, true, false); err != nil { + if err := c.Validate(k8sVersion, false, true, false, false); err != nil { t.Errorf("shouldn't have errored with azure cni ipv6 dual stack feature enabled: %v", err) } @@ -713,7 +713,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "10.0.0.10", } - if err := c.Validate(k8sVersion, false, true, false); err == nil { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil { t.Errorf("should error when Azure CNI + dual stack without bridge network mode") } @@ -727,7 +727,7 @@ func Test_KubernetesConfig_Validate(t *testing.T) { DNSServiceIP: "10.0.0.10", } - if err := c.Validate(k8sVersion, false, true, false); err == nil { + if err := c.Validate(k8sVersion, false, true, false, false); err == nil { t.Errorf("should error when Azure CNI + dual stack without bridge network mode") } } @@ -737,10 +737,10 @@ func Test_KubernetesConfig_Validate(t *testing.T) { c := KubernetesConfig{ NetworkPlugin: "azure", } - if err := c.Validate(k8sVersion, false, false, true); err == nil { + if err := c.Validate(k8sVersion, false, false, true, false); err == nil { t.Error("should error when network plugin is not kubenet for single stack IPv6") } - if err := c.Validate(k8sVersion, false, true, true); err == nil { + if err := c.Validate(k8sVersion, false, true, true, false); err == nil { t.Error("should error when dual stack and single stack IPv6 enabled simultaneously") } } @@ -983,7 +983,7 @@ func ExampleKubernetesConfig_validateNetworkPlugin() { cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{} cs.Properties.OrchestratorProfile.KubernetesConfig.NetworkPlugin = NetworkPluginKubenet - if err := cs.Properties.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(true); err != nil { + if err := cs.Properties.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(true, false); err != nil { fmt.Printf("error in ValidateNetworkPlugin: %s", err) } @@ -996,26 +996,35 @@ func Test_Properties_ValidateNetworkPlugin(t *testing.T) { p.OrchestratorProfile = &OrchestratorProfile{} p.OrchestratorProfile.OrchestratorType = Kubernetes - for _, policy := range NetworkPluginValues { + for _, plugin := range NetworkPluginValues { p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{} - p.OrchestratorProfile.KubernetesConfig.NetworkPlugin = policy - if err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(false); err != nil { - t.Errorf( - "should not error on networkPolicy=\"%s\"", - policy, - ) + p.OrchestratorProfile.KubernetesConfig.NetworkPlugin = plugin + err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(false, false) + if plugin == NetworkPluginFlannel { + if err == nil { + t.Errorf("flannel should not be allowed for new clusters") + } + } else { + if err != nil { + t.Errorf("should not error on networkPolicy=\"%s\"", plugin) + } } } + p.OrchestratorProfile.KubernetesConfig.NetworkPlugin = NetworkPluginFlannel + if err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(false, true); err != nil { + t.Errorf("flannel should be permitted for upgrade scenarios") + } + p.OrchestratorProfile.KubernetesConfig.NetworkPlugin = "not-existing" - if err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(false); err == nil { + if err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(false, false); err == nil { t.Errorf( "should error on invalid networkPlugin", ) } p.OrchestratorProfile.KubernetesConfig.NetworkPlugin = NetworkPluginAntrea - if err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(true); err == nil { + if err := p.OrchestratorProfile.KubernetesConfig.validateNetworkPlugin(true, false); err == nil { t.Errorf( "should error on antrea for windows clusters", ) @@ -1820,6 +1829,7 @@ func TestValidateAddons(t *testing.T) { tests := []struct { name string p *Properties + isUpdate bool expectedErr error }{ { @@ -2077,10 +2087,28 @@ func TestValidateAddons(t *testing.T) { }, }, }, + expectedErr: errors.Errorf("%s addon is deprecated for new clusters", common.FlannelAddonName), + }, + { + name: "flannel addon enabled - upgrade", + p: &Properties{ + OrchestratorProfile: &OrchestratorProfile{ + KubernetesConfig: &KubernetesConfig{ + ContainerRuntime: Containerd, + Addons: []KubernetesAddon{ + { + Name: common.FlannelAddonName, + Enabled: to.BoolPtr(true), + }, + }, + }, + }, + }, + isUpdate: true, expectedErr: nil, }, { - name: "flannel addon enabled but no containerRuntime", + name: "flannel addon enabled but no containerRuntime - upgrade", p: &Properties{ OrchestratorProfile: &OrchestratorProfile{ KubernetesConfig: &KubernetesConfig{ @@ -2093,10 +2121,11 @@ func TestValidateAddons(t *testing.T) { }, }, }, + isUpdate: true, expectedErr: errors.Errorf("%s addon is only supported with containerRuntime=%s", common.FlannelAddonName, Containerd), }, { - name: "flannel addon enabled with docker", + name: "flannel addon enabled with docker - upgrade", p: &Properties{ OrchestratorProfile: &OrchestratorProfile{ KubernetesConfig: &KubernetesConfig{ @@ -2110,10 +2139,11 @@ func TestValidateAddons(t *testing.T) { }, }, }, + isUpdate: true, expectedErr: errors.Errorf("%s addon is only supported with containerRuntime=%s", common.FlannelAddonName, Containerd), }, { - name: "flannel addon enabled w/ NetworkPlugin=flannel", + name: "flannel addon enabled w/ NetworkPlugin=flannel - upgrade", p: &Properties{ OrchestratorProfile: &OrchestratorProfile{ KubernetesConfig: &KubernetesConfig{ @@ -2128,10 +2158,11 @@ func TestValidateAddons(t *testing.T) { }, }, }, + isUpdate: true, expectedErr: nil, }, { - name: "flannel addon enabled w/ NetworkPlugin=azure", + name: "flannel addon enabled w/ NetworkPlugin=azure - upgrade", p: &Properties{ OrchestratorProfile: &OrchestratorProfile{ KubernetesConfig: &KubernetesConfig{ @@ -2146,10 +2177,11 @@ func TestValidateAddons(t *testing.T) { }, }, }, + isUpdate: true, expectedErr: errors.Errorf("%s addon is not supported with networkPlugin=%s, please use networkPlugin=%s", common.FlannelAddonName, DefaultNetworkPlugin, NetworkPluginFlannel), }, { - name: "flannel addon enabled w/ NetworkPlugin=kubenet", + name: "flannel addon enabled w/ NetworkPlugin=kubenet - upgrade", p: &Properties{ OrchestratorProfile: &OrchestratorProfile{ KubernetesConfig: &KubernetesConfig{ @@ -2164,10 +2196,11 @@ func TestValidateAddons(t *testing.T) { }, }, }, + isUpdate: true, expectedErr: errors.Errorf("%s addon is not supported with networkPlugin=%s, please use networkPlugin=%s", common.FlannelAddonName, "kubenet", NetworkPluginFlannel), }, { - name: "flannel addon enabled w/ NetworkPolicy=calico", + name: "flannel addon enabled w/ NetworkPolicy=calico - upgrade", p: &Properties{ OrchestratorProfile: &OrchestratorProfile{ KubernetesConfig: &KubernetesConfig{ @@ -2182,6 +2215,7 @@ func TestValidateAddons(t *testing.T) { }, }, }, + isUpdate: true, expectedErr: errors.Errorf("%s addon does not support NetworkPolicy, replace %s with \"\"", common.FlannelAddonName, "calico"), }, { @@ -2245,7 +2279,7 @@ func TestValidateAddons(t *testing.T) { test := test t.Run(test.name, func(t *testing.T) { t.Parallel() - gotErr := test.p.validateAddons() + gotErr := test.p.validateAddons(test.isUpdate) if !helpers.EqualError(gotErr, test.expectedErr) { t.Logf("scenario %q", test.name) t.Errorf("expected error: %v, got: %v", test.expectedErr, gotErr) @@ -2273,7 +2307,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: AvailabilitySet, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error on cluster-autoscaler with availability sets", ) @@ -2287,7 +2321,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error on azure-policy when ServicePrincipalProfile is empty", ) @@ -2295,28 +2329,28 @@ func Test_Properties_ValidateAddons(t *testing.T) { p.ServicePrincipalProfile = &ServicePrincipalProfile{ ClientID: "123", } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error on azure-policy when ServicePrincipalProfile is not empty", ) } p.OrchestratorProfile.OrchestratorRelease = "1.12" - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error on azure-policy with k8s < 1.14", ) } p.OrchestratorProfile.OrchestratorRelease = "1.18" - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error on azure-policy with k8s >= 1.14", ) } p.OrchestratorProfile.KubernetesConfig.UseManagedIdentity = to.BoolPtr(true) - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error on azure-policy with managed identity", ) @@ -2343,7 +2377,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: VirtualMachineScaleSets, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "cluster-autoscaler addon pools configuration must have a 'name' property that correlates with a pool name in the agentPoolProfiles array", ) @@ -2371,7 +2405,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: VirtualMachineScaleSets, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "addon cluster-autoscaler has a mode configuration 'foo', must be either EnsureExists or Reconcile", ) @@ -2399,7 +2433,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: VirtualMachineScaleSets, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "cluster-autoscaler addon pool 'name' foo has invalid 'min-nodes' config, must be a string int, got baz", ) @@ -2427,7 +2461,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: VirtualMachineScaleSets, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "cluster-autoscaler addon pool 'name' foo has invalid 'max-nodes' config, must be a string int, got baz", ) @@ -2455,7 +2489,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: VirtualMachineScaleSets, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "cluster-autoscaler addon pool 'name' foo has invalid config, 'max-nodes' 1 must be greater than 'min-nodes' 5", ) @@ -2484,7 +2518,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { AvailabilityProfile: VirtualMachineScaleSets, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "cluster-autoscaler addon pool 'name' foo does not match any agentPoolProfiles nodepool name", ) @@ -2504,14 +2538,14 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } p.OrchestratorProfile.OrchestratorRelease = "1.9" - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error on nvidia-device-plugin with k8s < 1.10", ) } p.OrchestratorProfile.OrchestratorRelease = "1.16" - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error on nvidia-device-plugin with k8s >= 1.12", ) @@ -2527,7 +2561,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "expected error for non-empty Config with non-empty Data", ) @@ -2545,7 +2579,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "expected error for non-empty Containers with non-empty Data", ) @@ -2558,7 +2592,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "expected error for invalid base64", ) @@ -2571,7 +2605,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error on providing valid addon.Data", ) @@ -2594,7 +2628,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Error( "should not error for correct config.", err, @@ -2618,7 +2652,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Error( "should not error for correct config.", err, @@ -2640,7 +2674,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Error( "should error as objectID not provided or UseManagedIdentity not true", err, @@ -2661,7 +2695,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error using when not using 'azure' for Network Plugin", ) @@ -2679,7 +2713,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when missing the subnet for Application Gateway", ) @@ -2696,7 +2730,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when useCloudControllerManager is disabled for azuredisk-csi-driver", ) @@ -2713,7 +2747,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error when useCloudControllerManager is enabled and k8s version is >= 1.13 for azuredisk-csi-driver", ) @@ -2730,7 +2764,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when useCloudControllerManager is disabled for azurefile-csi-driver", ) @@ -2747,7 +2781,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error when useCloudControllerManager is enabled and k8s version is >= 1.13 for azurefile-csi-driver", ) @@ -2765,7 +2799,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when the orchestrator version is less than 1.16.0 for cloud-node-manager", ) @@ -2782,7 +2816,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when useCloudControllerManager is disabled for cloud-node-manager", ) @@ -2799,7 +2833,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when useCloudControllerManager is enabled and cloud-node-manager isn't", ) @@ -2816,7 +2850,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err != nil { + if err := p.validateAddons(false); err != nil { t.Errorf( "should not error when useCloudControllerManager is enabled and k8s version is >= 1.16 for cloud-node-manager", ) @@ -2838,7 +2872,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when using Windows cluster and k8s version is < 1.18 for cloud-node-manager", ) @@ -2860,7 +2894,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when using Windows cluster and k8s version is >= 1.18 with cloud-node-manager disabled", ) @@ -2878,7 +2912,7 @@ func Test_Properties_ValidateAddons(t *testing.T) { }, }, } - if err := p.validateAddons(); err == nil { + if err := p.validateAddons(false); err == nil { t.Errorf( "should error when both kube-dns and coredns are enabled", ) diff --git a/test/e2e/test_cluster_configs/flannel/containerd.json b/test/e2e/test_cluster_configs/flannel/containerd.json deleted file mode 100644 index 3052fc3c02..0000000000 --- a/test/e2e/test_cluster_configs/flannel/containerd.json +++ /dev/null @@ -1,45 +0,0 @@ -{ - "options": { - "allowedOrchestratorVersions": ["1.16", "1.17", "1.18", "1.19"] - }, - "apiModel": { - "apiVersion": "vlabs", - "properties": { - "orchestratorProfile": { - "kubernetesConfig": { - "containerRuntime": "containerd", - "addons": [ - { - "name": "flannel", - "enabled": true - } - ] - } - }, - "masterProfile": { - "count": 1, - "dnsPrefix": "", - "vmSize": "Standard_D2_v3" - }, - "agentPoolProfiles": [ - { - "name": "agent1", - "count": 3, - "vmSize": "Standard_D2_v3", - "availabilityProfile": "VirtualMachineScaleSets", - "scalesetPriority": "Spot" - } - ], - "linuxProfile": { - "adminUsername": "azureuser", - "ssh": { - "publicKeys": [ - { - "keyData": "" - } - ] - } - } - } - } -}