chore: deprecate support for creating new 1.16 clusters (#4256)

This commit is contained in:
Jack Francis 2021-02-11 10:30:09 -08:00 коммит произвёл GitHub
Родитель b9178286da
Коммит 6a8a5af4a6
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
73 изменённых файлов: 150 добавлений и 570 удалений

2
Jenkinsfile поставляемый
Просмотреть файл

@ -6,7 +6,7 @@ defaultEnv = [
VALIDATE_CPU_LOAD: false,
] + params
def k8sVersions = ["1.16", "1.17", "1.18", "1.19", "1.20", "1.21"]
def k8sVersions = ["1.17", "1.18", "1.19", "1.20", "1.21"]
def latestReleasedVersion = "1.20"
def tasks = [:]
def testConfigs = []

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

@ -577,11 +577,6 @@ func TestExampleAPIModels(t *testing.T) {
apiModelPath: "../examples/kubernetes-msi-userassigned/kube-vmss.json",
setArgs: defaultSet,
},
{
name: "1.16 example",
apiModelPath: "../examples/kubernetes-releases/kubernetes1.16.json",
setArgs: defaultSet,
},
{
name: "1.17 example",
apiModelPath: "../examples/kubernetes-releases/kubernetes1.17.json",

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

@ -232,7 +232,7 @@ func TestGetLogsInit(t *testing.T) {
glc: &getLogsCmd{
linuxScriptPath: "",
windowsScriptPath: "",
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
hasWindows: true,
isSSHEnabled: true,
@ -243,7 +243,7 @@ func TestGetLogsInit(t *testing.T) {
glc: &getLogsCmd{
linuxScriptPath: existingFile,
windowsScriptPath: existingFile,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
hasWindows: true,
isSSHEnabled: true,
@ -254,7 +254,7 @@ func TestGetLogsInit(t *testing.T) {
glc: &getLogsCmd{
linuxScriptPath: existingFile,
windowsScriptPath: existingFile,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
hasWindows: true,
isSSHEnabled: false,
@ -265,7 +265,7 @@ func TestGetLogsInit(t *testing.T) {
glc: &getLogsCmd{
linuxScriptPath: existingFile,
windowsScriptPath: existingFile,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
hasWindows: false,
isSSHEnabled: false,
@ -276,7 +276,7 @@ func TestGetLogsInit(t *testing.T) {
glc: &getLogsCmd{
linuxScriptPath: missingFile,
windowsScriptPath: existingFile,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
hasWindows: false,
isSSHEnabled: false,
@ -287,7 +287,7 @@ func TestGetLogsInit(t *testing.T) {
glc: &getLogsCmd{
linuxScriptPath: existingFile,
windowsScriptPath: missingFile,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
hasWindows: false,
isSSHEnabled: false,
@ -345,7 +345,7 @@ func TestGetLogsGetClusterNodes(t *testing.T) {
{
glc: &getLogsCmd{
controlPlaneOnly: false,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
isWindowsSSHEnabled: true,
nodeList: []string{"k8s-master-22998975-0", "k8s-agentpool1-22998975-0", "windows10"},
@ -356,7 +356,7 @@ func TestGetLogsGetClusterNodes(t *testing.T) {
{
glc: &getLogsCmd{
controlPlaneOnly: true,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
isWindowsSSHEnabled: true,
nodeList: []string{"k8s-master-22998975-0", "k8s-agentpool1-22998975-0", "windows10"},
@ -367,7 +367,7 @@ func TestGetLogsGetClusterNodes(t *testing.T) {
{
glc: &getLogsCmd{
controlPlaneOnly: false,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
isWindowsSSHEnabled: false,
nodeList: []string{"k8s-master-22998975-0", "k8s-agentpool1-22998975-0", "windows10"},
@ -378,7 +378,7 @@ func TestGetLogsGetClusterNodes(t *testing.T) {
{
glc: &getLogsCmd{
controlPlaneOnly: false,
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
},
isWindowsSSHEnabled: true,
nodeList: []string{"k8s-master-22998975-0", "k8s-agentpool1-22998975-0", "windows10"},
@ -426,7 +426,7 @@ func TestGetLogsGetClusterNodeScripts(t *testing.T) {
}{
{
glc: &getLogsCmd{
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
linuxVHDScript: linuxVHDScript,
linuxCustomScript: linuxCustomScript,
windowsVHDScript: windowsVHDScript,
@ -443,7 +443,7 @@ func TestGetLogsGetClusterNodeScripts(t *testing.T) {
},
{
glc: &getLogsCmd{
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
linuxVHDScript: linuxVHDScript,
linuxCustomScript: linuxCustomScript,
windowsVHDScript: windowsVHDScript,
@ -460,7 +460,7 @@ func TestGetLogsGetClusterNodeScripts(t *testing.T) {
},
{
glc: &getLogsCmd{
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
linuxVHDScript: linuxVHDScript,
windowsVHDScript: windowsVHDScript,
},
@ -475,7 +475,7 @@ func TestGetLogsGetClusterNodeScripts(t *testing.T) {
},
{
glc: &getLogsCmd{
cs: api.CreateMockContainerService("test", "1.11.11", 1, 1, false),
cs: api.CreateMockContainerService("test", "", 1, 1, false),
linuxVHDScript: linuxVHDScript,
windowsVHDScript: windowsVHDScript,
},

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

@ -587,7 +587,7 @@ func TestWriteArtifacts(t *testing.T) {
t.Parallel()
g := NewGomegaWithT(t)
cs := api.CreateMockContainerService("testcluster", "1.16.14", 3, 2, false)
cs := api.CreateMockContainerService("testcluster", "", 3, 2, false)
_, err := cs.SetPropertiesDefaults(api.PropertiesDefaultsParams{
IsScale: false,
IsUpgrade: false,

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

@ -4,6 +4,7 @@
package cmd
import (
"fmt"
"testing"
"github.com/Azure/aks-engine/pkg/api/common"
@ -150,14 +151,15 @@ func TestCreateUpgradeCommand(t *testing.T) {
}
func TestUpgradeShouldFailForSameVersion(t *testing.T) {
versionToUse := common.RationalizeReleaseAndVersion(api.Kubernetes, "", "", false, false, false)
setupValidVersions(map[string]bool{
"1.10.13": true,
versionToUse: true,
})
g := NewGomegaWithT(t)
upgradeCmd := &upgradeCmd{
resourceGroupName: "rg",
apiModelPath: "./not/used",
upgradeVersion: "1.10.13",
upgradeVersion: versionToUse,
location: "centralus",
timeoutInMinutes: 60,
cordonDrainTimeoutInMinutes: 60,
@ -165,12 +167,12 @@ func TestUpgradeShouldFailForSameVersion(t *testing.T) {
client: &armhelpers.MockAKSEngineClient{},
}
containerServiceMock := api.CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
containerServiceMock := api.CreateMockContainerService("testcluster", versionToUse, 3, 2, false)
containerServiceMock.Location = "centralus"
upgradeCmd.containerService = containerServiceMock
err := upgradeCmd.initialize()
g.Expect(err).To(HaveOccurred())
g.Expect(err.Error()).To(ContainSubstring("upgrading from Kubernetes version 1.10.13 to version 1.10.13 is not supported"))
g.Expect(err.Error()).To(ContainSubstring(fmt.Sprintf("upgrading from Kubernetes version %s to version %s is not supported", versionToUse, versionToUse)))
resetValidVersions()
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"addons": [
{

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

@ -7,7 +7,6 @@ This is the [NVIDIA Device Plugin](https://github.com/NVIDIA/k8s-device-plugin)
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"addons": [
{

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorVersion": "1.16.14",
"kubernetesConfig": {
"enableRbac" : true,
"enableAggregatedAPIs": true,

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

@ -55,4 +55,3 @@
}
}
}

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"addons": [
{

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 5,
"dnsPrefix": "",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true,
"userAssignedID": "aksenginetestid"

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true,
"userAssignedID": "aksenginetestid"

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true,
"userAssignedID": "aksenginetestid"

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"kubeletConfig" : {
"--feature-gates": "MountPropagation=true,DebugContainers=true"

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true,
"kubeProxyMode" : "ipvs"

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useCloudControllerManager": true
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.17",
"kubernetesConfig": {
"networkPlugin": "kubenet",
"containerRuntime": "containerd",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.17",
"kubernetesConfig": {
"containerRuntime": "docker",
"containerRuntimeConfig": {

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"enableEncryptionWithExternalKms": true,
"keyVaultSku": "Premium"

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.17",
"kubernetesConfig": {
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true,

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"loadBalancerSku": "Standard",
"excludeMasterFromStandardLB": true

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"networkPlugin": "kubenet",
"containerRuntime": "containerd"

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

@ -1,30 +0,0 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v3"
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v3"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
}
}
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true
}

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

@ -15,9 +15,6 @@ Here is an [example of a Kubernetes cluster with Availability Zones support](../
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.13"
},
"masterProfile": {
"count": 5,
"dnsPrefix": "",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"cloudProviderBackoff": true,
"cloudProviderBackoffRetries": 6,

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useManagedIdentity": true
}

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

@ -47,14 +47,13 @@ The kubernetes-cilium deployment template enables Cilium networking and policies
}
```
> Note: To execute the `cilium` command that is running inside of the pods, you will need remove the `DenyEscalatingExec` when specifying the Admission Control Values. If running Kubernetes with the `orchestratorRelease` newer than 1.9 use `--enable-admission-plugins` instead of `--admission-control` as illustrated below:
> Note: To execute the `cilium` command that is running inside of the pods, you will need remove the `DenyEscalatingExec` when specifying the Admission Control Values. In addition, use `--enable-admission-plugins` instead of `--admission-control` as illustrated below:
```json
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.10",
"kubernetesConfig": {
"networkPlugin": "cilium",
"networkPolicy": "cilium",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"networkPolicy": "antrea"
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"networkPolicy": "cilium"
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.17",
"kubernetesConfig": {
"apiServerConfig": {
"--service-account-api-audiences": "api,istio-ca",

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

@ -1,38 +0,0 @@
{
"apiVersion": "2016-09-30",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 1,
"dnsPrefix": ""
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v3"
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_D2_v3"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}

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

@ -1,43 +0,0 @@
{
"apiVersion": "2017-01-31",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes"
},
"masterProfile": {
"count": 1,
"dnsPrefix": ""
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 3,
"vmSize": "Standard_D2_v3"
},
{
"name": "agentpool2",
"count": 3,
"vmSize": "Standard_D2_v3",
"osType": "Windows"
}
],
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$"
},
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}

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

@ -1,45 +0,0 @@
{
"apiVersion": "2017-07-01",
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorVersion": "1.6.11"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",
"vmSize": "Standard_D2_v3"
},
"agentPoolProfiles": [
{
"name": "agentpool1",
"count": 1,
"vmSize": "Standard_D2_v3"
},
{
"name": "agentpool2",
"count": 1,
"vmSize": "Standard_D3_v2",
"osType": "Windows"
}
],
"linuxProfile": {
"adminUsername": "azureuser",
"ssh": {
"publicKeys": [
{
"keyData": ""
}
]
}
},
"windowsProfile": {
"adminUsername": "azureuser",
"adminPassword": "replacepassword1234$"
},
"servicePrincipalProfile": {
"clientId": "",
"secret": ""
}
}
}

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.18",
"kubernetesConfig": {
"networkPlugin": "azure",
"containerRuntime": "containerd",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.18",
"kubernetesConfig": {
"networkPlugin": "kubenet",
"containerRuntime": "containerd",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"networkPlugin": "azure",
"containerRuntime": "containerd",

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.18"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",

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

@ -5,7 +5,6 @@
"enableWinDSR": true
},
"orchestratorProfile": {
"orchestratorRelease": "1.19",
"kubernetesConfig": {
"networkPlugin": "azure",
"useManagedIdentity": false

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "",

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

@ -46,7 +46,6 @@ func TestLoadContainerServiceWithEmptyLocationCustomCloud(t *testing.T) {
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"kubernetesImageBase": "msazurestackqa/",
"useInstanceMetadata": false,
@ -136,7 +135,6 @@ func TestLoadContainerServiceWithEmptyLocationCustomCloud(t *testing.T) {
"properties": {
"orchestratorProfile": {
"orchestratorType": "Kubernetes",
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"kubernetesImageBase": "msazurestackqa/",
"useInstanceMetadata": false,

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

@ -172,8 +172,8 @@ var AllKubernetesSupportedVersions = map[string]bool{
"1.16.11": false,
"1.16.12": false,
"1.16.13": false,
"1.16.14": true,
"1.16.15": true,
"1.16.14": false,
"1.16.15": false,
"1.17.0-alpha.1": false,
"1.17.0-alpha.2": false,
"1.17.0-alpha.3": false,
@ -263,8 +263,8 @@ var AllKubernetesSupportedVersionsAzureStack = map[string]bool{
"1.16.10": false,
"1.16.11": false,
"1.16.13": false,
"1.16.14": true,
"1.16.15": true,
"1.16.14": false,
"1.16.15": false,
"1.17.4": false,
"1.17.5": false,
"1.17.6": false,
@ -285,8 +285,8 @@ var AllKubernetesWindowsSupportedVersionsAzureStack = map[string]bool{
"1.16.10": false,
"1.16.11": false,
"1.16.13": false,
"1.16.14": true,
"1.16.15": true,
"1.16.14": false,
"1.16.15": false,
"1.17.4": false,
"1.17.5": false,
"1.17.6": false,

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

@ -4,6 +4,9 @@
package common
import (
"fmt"
"strconv"
"strings"
"testing"
)
@ -668,11 +671,19 @@ func Test_IsSupportedKubernetesVersion(t *testing.T) {
}
func Test_IsValidMinVersion(t *testing.T) {
orchestratorRelease := "1.16"
defaultVersion := RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
verSlice := strings.Split(defaultVersion, ".")
minorVersionInt, err := strconv.Atoi(verSlice[1])
if err != nil {
t.Errorf("unexpected error during string to int conversion")
}
orchestratorRelease := verSlice[0] + "." + verSlice[1]
orchestratorReleaseNext := verSlice[0] + "." + strconv.Itoa(minorVersionInt+1)
orchestratorReleasePrior := verSlice[0] + "." + strconv.Itoa(minorVersionInt-1)
orchestratorVersion := ""
t.Run("Minimum version is valid", func(t *testing.T) {
minVersion := "1.16.0"
minVersion := orchestratorRelease + ".0"
_, err := IsValidMinVersion(Kubernetes, orchestratorRelease, orchestratorVersion, minVersion)
if err != nil {
t.Errorf("version should be valid: %v", err)
@ -680,7 +691,7 @@ func Test_IsValidMinVersion(t *testing.T) {
})
t.Run("Minimum version is invalid", func(t *testing.T) {
minVersion := "v1.16.0"
minVersion := "v" + orchestratorRelease + ".0"
_, err := IsValidMinVersion(Kubernetes, orchestratorRelease, orchestratorVersion, minVersion)
if err == nil {
t.Errorf("version should be invalid: %v", err)
@ -688,7 +699,7 @@ func Test_IsValidMinVersion(t *testing.T) {
})
t.Run("Kubernetes release is higher than required version", func(t *testing.T) {
minVersion := "1.13.0"
minVersion := orchestratorReleasePrior + ".0"
isValidVersion, _ := IsValidMinVersion(Kubernetes, orchestratorRelease, orchestratorVersion, minVersion)
if !isValidVersion {
t.Errorf("minimum version should be valid")
@ -696,7 +707,7 @@ func Test_IsValidMinVersion(t *testing.T) {
})
t.Run("Kubernetes release is lower than minimum required version", func(t *testing.T) {
minVersion := "1.17.0"
minVersion := orchestratorReleaseNext + ".0"
isValidVersion, _ := IsValidMinVersion(Kubernetes, orchestratorRelease, orchestratorVersion, minVersion)
if isValidVersion {
t.Errorf("version should be not valid")
@ -704,8 +715,10 @@ func Test_IsValidMinVersion(t *testing.T) {
})
t.Run("Kubernetes version is higher than required version", func(t *testing.T) {
orchestratorVersion = "1.16.14"
minVersion := "1.13.0"
orchestratorVersion = defaultVersion
minVersion := orchestratorReleasePrior + ".0"
fmt.Println(orchestratorVersion)
fmt.Println(minVersion)
isValidVersion, _ := IsValidMinVersion(Kubernetes, "", orchestratorVersion, minVersion)
if !isValidVersion {
t.Errorf("minimum version should be valid")
@ -713,8 +726,8 @@ func Test_IsValidMinVersion(t *testing.T) {
})
t.Run("Kubernetes version is lower than minimum required version", func(t *testing.T) {
orchestratorVersion = "1.15.2"
minVersion := "1.15.4"
orchestratorVersion = orchestratorRelease + ".2"
minVersion := orchestratorRelease + ".4"
isValidVersion, _ := IsValidMinVersion(Kubernetes, "", orchestratorVersion, minVersion)
if isValidVersion {
t.Errorf("version should be not valid")

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

@ -97,11 +97,7 @@ func (cs *ContainerService) setAPIServerConfig() {
// RBAC configuration
if to.Bool(o.KubernetesConfig.EnableRbac) {
if common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.7.0") {
defaultAPIServerConfig["--authorization-mode"] = "Node,RBAC"
} else {
defaultAPIServerConfig["--authorization-mode"] = "RBAC"
}
}
if common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.20.0-alpha.1") {
@ -113,12 +109,6 @@ func (cs *ContainerService) setAPIServerConfig() {
admissionControlKey, admissionControlValues := getDefaultAdmissionControls(cs)
defaultAPIServerConfig[admissionControlKey] = admissionControlValues
// Enable VolumeSnapshotDataSource feature gate for Azure Disk CSI Driver
// which is disabled from 1.13 to 1.16 by default
if !common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.17.0") {
addDefaultFeatureGates(defaultAPIServerConfig, o.OrchestratorVersion, "1.13.0", "VolumeSnapshotDataSource=true")
}
// If no user-configurable apiserver config values exists, use the defaults
if o.KubernetesConfig.APIServerConfig == nil {
o.KubernetesConfig.APIServerConfig = defaultAPIServerConfig

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

@ -166,7 +166,7 @@ func TestAPIServerConfigHasAadProfile(t *testing.T) {
}
// Test OIDC user overrides
cs = CreateMockContainerService("testcluster", "1.7.12", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.AADProfile = &AADProfile{
ServerAppID: "test-id",
TenantID: "test-tenant",
@ -261,16 +261,6 @@ func TestAPIServerConfigEnableRbac(t *testing.T) {
a["--authorization-mode"])
}
// Test EnableRbac = true with 1.6 cluster
cs = CreateMockContainerService("testcluster", "1.6.11", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig.EnableRbac = to.BoolPtr(true)
cs.setAPIServerConfig()
a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--authorization-mode"] != "RBAC" {
t.Fatalf("got unexpected '--authorization-mode' API server config value for 1.6 cluster with EnableRbac=true: %s",
a["--authorization-mode"])
}
// Test EnableRbac = false
cs = CreateMockContainerService("testcluster", defaultTestClusterVer, 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig.EnableRbac = to.BoolPtr(false)
@ -280,16 +270,6 @@ func TestAPIServerConfigEnableRbac(t *testing.T) {
t.Fatalf("got unexpected '--authorization-mode' API server config value for EnableRbac=false: %s",
a["--authorization-mode"])
}
// Test EnableRbac = false with 1.6 cluster
cs = CreateMockContainerService("testcluster", "1.6.11", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig.EnableRbac = to.BoolPtr(false)
cs.setAPIServerConfig()
a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if _, ok := a["--authorization-mode"]; ok {
t.Fatalf("got unexpected '--authorization-mode' API server config value for 1.6 cluster with EnableRbac=false: %s",
a["--authorization-mode"])
}
}
func TestAPIServerConfigDisableRbac(t *testing.T) {
@ -305,7 +285,7 @@ func TestAPIServerConfigDisableRbac(t *testing.T) {
}
func TestAPIServerServiceAccountFlags(t *testing.T) {
cs := CreateMockContainerService("testcluster", "1.20.0-alpha.3", 3, 2, false)
cs := CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "1.20", "", false, false, false), 3, 2, false)
cs.setAPIServerConfig()
a := cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--service-account-issuer"] != "kubernetes.default.svc" {
@ -317,7 +297,7 @@ func TestAPIServerServiceAccountFlags(t *testing.T) {
a["--service-account-signing-key-file"])
}
cs = CreateMockContainerService("testcluster", "1.19.0", 3, 2, false)
cs = CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "1.19", "", false, false, false), 3, 2, false)
cs.setAPIServerConfig()
a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--service-account-issuer"] != "" {
@ -418,7 +398,7 @@ func TestAPIServerConfigEnableProfiling(t *testing.T) {
func TestAPIServerConfigRepairMalformedUpdates(t *testing.T) {
// Test default
cs := CreateMockContainerService("testcluster", "1.18.2", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.setAPIServerConfig()
a := cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if _, ok := a["--repair-malformed-updates"]; ok {
@ -430,7 +410,7 @@ func TestAPIServerConfigRepairMalformedUpdates(t *testing.T) {
func TestAPIServerAuditPolicyBackCompatOverride(t *testing.T) {
// Validate that we statically override "--audit-policy-file" values of "/etc/kubernetes/manifests/audit-policy.yaml" for back-compat
auditPolicyKey := "--audit-policy-file"
cs := CreateMockContainerService("testcluster", "1.10.8", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig = map[string]string{}
cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig[auditPolicyKey] = "/etc/kubernetes/manifests/audit-policy.yaml"
cs.setAPIServerConfig()
@ -471,7 +451,7 @@ func TestAPIServerWeakCipherSuites(t *testing.T) {
func TestAPIServerCosmosEtcd(t *testing.T) {
// Test default
cs := CreateMockContainerService("testcluster", "1.18.2", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.setAPIServerConfig()
a := cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--etcd-cafile"] != "/etc/kubernetes/certs/ca.crt" {
@ -483,7 +463,7 @@ func TestAPIServerCosmosEtcd(t *testing.T) {
a["--etcd-servers"])
}
cs = CreateMockContainerService("testcluster", "1.18.2", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.CosmosEtcd = to.BoolPtr(true)
cs.Properties.MasterProfile.DNSPrefix = "my-cosmos"
cs.setAPIServerConfig()
@ -495,27 +475,17 @@ func TestAPIServerCosmosEtcd(t *testing.T) {
}
func TestAPIServerFeatureGates(t *testing.T) {
// Test 1.13 <= k8s <= 1.16
cs := CreateMockContainerService("testcluster", "1.15.12", 3, 2, false)
cs := CreateMockContainerService("testcluster", defaultTestClusterVer, 3, 2, false)
cs.setAPIServerConfig()
a := cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--feature-gates"] != "VolumeSnapshotDataSource=true" {
t.Fatalf("got unexpected '--feature-gates' API server config value for k8s v%s: %s",
"1.15.12", a["--feature-gates"])
}
// Test k8s >= 1.17
cs = CreateMockContainerService("testcluster", defaultTestClusterVer, 3, 2, false)
cs.setAPIServerConfig()
a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--feature-gates"] != "" {
t.Fatalf("got unexpected '--feature-gates' API server config value for k8s v%s: %s",
"1.17.0", a["--feature-gates"])
defaultTestClusterVer, a["--feature-gates"])
}
}
func TestAPIServerIPv6Only(t *testing.T) {
cs := CreateMockContainerService("testcluster", "1.18.0", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.FeatureFlags = &FeatureFlags{EnableIPv6Only: true}
cs.setAPIServerConfig()
@ -535,23 +505,23 @@ func TestAPIServerIPv6Only(t *testing.T) {
func TestAPIServerAnonymousAuth(t *testing.T) {
// Validate anonymous-auth default is false
cs := CreateMockContainerService("testcluster", "1.15.12", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.setAPIServerConfig()
a := cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--anonymous-auth"] != "false" {
t.Fatalf("got unexpected '--anonymous-auth' API server config value for k8s v%s: %s",
"1.15.12", a["--anonymous-auth"])
t.Fatalf("got unexpected '--anonymous-auth' API server config value: %s",
a["--anonymous-auth"])
}
// Validate anonymous-auth enabled
cs = CreateMockContainerService("testcluster", "1.15.12", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig = map[string]string{
"--anonymous-auth": "true",
}
cs.setAPIServerConfig()
a = cs.Properties.OrchestratorProfile.KubernetesConfig.APIServerConfig
if a["--anonymous-auth"] != "true" {
t.Fatalf("got unexpected '--anonymous-auth' API server config value for k8s v%s: %s",
"1.15.12", a["--anonymous-auth"])
t.Fatalf("got unexpected '--anonymous-auth' API server config value: %s",
a["--anonymous-auth"])
}
}

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

@ -6,8 +6,6 @@ package api
import (
"strconv"
"strings"
"github.com/Azure/aks-engine/pkg/api/common"
)
func (cs *ContainerService) setCloudControllerManagerConfig() {
@ -32,11 +30,8 @@ func (cs *ContainerService) setCloudControllerManagerConfig() {
"--v": "2",
}
// Add new arguments for Azure cloud-controller-manager component.
if common.IsKubernetesVersionGe(o.OrchestratorVersion, "1.16.0") {
// Disable cloud-node controller
staticCloudControllerManagerConfig["--controllers"] = "*,-cloud-node"
}
// Set --cluster-name based on appropriate DNS prefix
if cs.Properties.MasterProfile != nil {

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

@ -5,10 +5,12 @@ package api
import (
"testing"
"github.com/Azure/aks-engine/pkg/api/common"
)
func TestCloudControllerManagerConfig(t *testing.T) {
k8sVersion := "1.16.1"
k8sVersion := common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, true)
cs := CreateMockContainerService("testcluster", k8sVersion, 3, 2, false)
cs.setCloudControllerManagerConfig()
cm := cs.Properties.OrchestratorProfile.KubernetesConfig.CloudControllerManagerConfig
@ -16,13 +18,4 @@ func TestCloudControllerManagerConfig(t *testing.T) {
t.Fatalf("got unexpected '--controllers' Cloud Controller Manager config value for Kubernetes %s: %s",
k8sVersion, cm["--controllers"])
}
k8sVersion = "1.15.4"
cs = CreateMockContainerService("testcluster", k8sVersion, 3, 2, false)
cs.setCloudControllerManagerConfig()
cm = cs.Properties.OrchestratorProfile.KubernetesConfig.CloudControllerManagerConfig
if val, ok := cm["--controllers"]; ok {
t.Fatalf("got unexpected '--controllers' Cloud Controller Manager config value for Kubernetes %s: %s",
k8sVersion, val)
}
}

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

@ -171,7 +171,7 @@ func TestKubeletConfigDefaults(t *testing.T) {
}
}
cs = CreateMockContainerService("testcluster", "1.8.6", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
// TODO test all default overrides
overrideVal := "/etc/override"
cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig = map[string]string{
@ -186,7 +186,7 @@ func TestKubeletConfigDefaults(t *testing.T) {
}
}
cs = CreateMockContainerService("testcluster", "1.16.0", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.setKubeletConfig(false)
kubeletConfig = cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
expectedKeys := []string{
@ -245,7 +245,7 @@ func getDefaultLinuxKubeletConfig(cs *ContainerService) map[string]string {
}
func TestKubeletConfigAzureStackDefaults(t *testing.T) {
cs := CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "1.16", "", false, false, false), 3, 2, false)
cs := CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false), 3, 2, false)
cs.Properties.CustomCloudProfile = &CustomCloudProfile{}
winProfile := &AgentPoolProfile{}
winProfile.Count = 1
@ -362,7 +362,7 @@ func TestKubeletConfigAzureStackDefaults(t *testing.T) {
}
}
cs = CreateMockContainerService("testcluster", "1.8.6", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
// TODO test all default overrides
overrideVal := "/etc/override"
cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig = map[string]string{
@ -377,7 +377,7 @@ func TestKubeletConfigAzureStackDefaults(t *testing.T) {
}
}
cs = CreateMockContainerService("testcluster", "1.16.0", 3, 2, false)
cs = CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false), 3, 2, false)
cs.setKubeletConfig(false)
kubeletConfig = cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
expectedKeys := []string{
@ -391,7 +391,7 @@ func TestKubeletConfigAzureStackDefaults(t *testing.T) {
}
func TestKubeletConfigDefaultsRemovals(t *testing.T) {
cs := CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "1.16", "", false, false, false), 3, 2, false)
cs := CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false), 3, 2, false)
poolProfile := &AgentPoolProfile{}
poolProfile.Count = 1
poolProfile.Name = "agentpool2"
@ -409,7 +409,7 @@ func TestKubeletConfigDefaultsRemovals(t *testing.T) {
key)
}
}
cs = CreateMockContainerService("testcluster", "1.16.0-beta.1", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.AgentPoolProfiles = append(cs.Properties.AgentPoolProfiles, poolProfile)
cs.setKubeletConfig(false)
kubeletConfig = cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
@ -549,7 +549,7 @@ func TestKubeletConfigEnableSecureKubelet(t *testing.T) {
}
// Test default (EnableSecureKubelet = false) for Windows
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 1, false)
cs = CreateMockContainerService("testcluster", "", 3, 1, false)
p := GetK8sDefaultProperties(true)
cs.Properties = p
cs.Properties.OrchestratorProfile.KubernetesConfig.EnableSecureKubelet = to.BoolPtr(false)
@ -566,7 +566,7 @@ func TestKubeletConfigEnableSecureKubelet(t *testing.T) {
}
// Test explicit EnableSecureKubelet = false for Windows
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 1, false)
cs = CreateMockContainerService("testcluster", "", 3, 1, false)
p = GetK8sDefaultProperties(true)
cs.Properties = p
cs.Properties.OrchestratorProfile.KubernetesConfig.EnableSecureKubelet = to.BoolPtr(false)
@ -583,7 +583,7 @@ func TestKubeletConfigEnableSecureKubelet(t *testing.T) {
}
// Test EnableSecureKubelet = true for Windows
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 1, false)
cs = CreateMockContainerService("testcluster", "", 3, 1, false)
p = GetK8sDefaultProperties(true)
cs.Properties = p
cs.Properties.OrchestratorProfile.KubernetesConfig.EnableSecureKubelet = to.BoolPtr(true)
@ -712,7 +712,7 @@ func TestKubeletIPMasqAgentEnabledOrDisabled(t *testing.T) {
func TestEnforceNodeAllocatable(t *testing.T) {
// Validate default
cs := CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.setKubeletConfig(false)
k := cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
if k["--enforce-node-allocatable"] != "pods" {
@ -721,7 +721,7 @@ func TestEnforceNodeAllocatable(t *testing.T) {
}
// Validate that --enforce-node-allocatable is overridable
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
KubeletConfig: map[string]string{
"--enforce-node-allocatable": "kube-reserved/system-reserved",
@ -737,7 +737,7 @@ func TestEnforceNodeAllocatable(t *testing.T) {
func TestProtectKernelDefaults(t *testing.T) {
// Validate default
cs := CreateMockContainerService("testcluster", "1.12.7", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
_, err := cs.SetPropertiesDefaults(PropertiesDefaultsParams{
IsScale: false,
IsUpgrade: false,
@ -761,7 +761,7 @@ func TestProtectKernelDefaults(t *testing.T) {
for _, distro := range DistroValues {
switch distro {
case AKSUbuntu1604, AKSUbuntu1804:
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.Distro = distro
cs.Properties.AgentPoolProfiles[0].Distro = distro
_, err = cs.SetPropertiesDefaults(PropertiesDefaultsParams{
@ -785,7 +785,7 @@ func TestProtectKernelDefaults(t *testing.T) {
// Validate that --protect-kernel-defaults is not enabled for relevant distros
case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, ACC1604, Flatcar:
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
if distro == Flatcar {
cs.Properties.MasterProfile.Distro = Ubuntu1804
} else {
@ -814,7 +814,7 @@ func TestProtectKernelDefaults(t *testing.T) {
}
// Validate that --protect-kernel-defaults is not enabled for Windows
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.Distro = AKSUbuntu1604
cs.Properties.AgentPoolProfiles[0].OSType = Windows
_, err = cs.SetPropertiesDefaults(PropertiesDefaultsParams{
@ -840,7 +840,7 @@ func TestProtectKernelDefaults(t *testing.T) {
for _, distro := range DistroValues {
switch distro {
case Ubuntu, Ubuntu1804, Ubuntu1804Gen2, AKSUbuntu1604, AKSUbuntu1804:
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.Distro = "ubuntu"
cs.Properties.AgentPoolProfiles[0].Distro = "ubuntu"
cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
@ -967,7 +967,7 @@ func TestKubeletConfigDefaultFeatureGates(t *testing.T) {
}
// test user-overrides
cs = CreateMockContainerService("testcluster", "1.20.0", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
k = cs.Properties.OrchestratorProfile.KubernetesConfig.KubeletConfig
k["--feature-gates"] = "DynamicKubeletConfig=true,ExecProbeTimeout=true"
cs.setKubeletConfig(false)

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

@ -8,7 +8,7 @@ import (
)
func TestSchedulerDefaultConfig(t *testing.T) {
cs := CreateMockContainerService("testcluster", "1.9.6", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.setSchedulerConfig()
s := cs.Properties.OrchestratorProfile.KubernetesConfig.SchedulerConfig
for key, val := range staticSchedulerConfig {
@ -26,7 +26,7 @@ func TestSchedulerDefaultConfig(t *testing.T) {
}
func TestSchedulerUserConfig(t *testing.T) {
cs := CreateMockContainerService("testcluster", "1.9.6", 3, 2, true)
cs := CreateMockContainerService("testcluster", "", 3, 2, true)
assignmentMap := map[string]string{
"--scheduler-name": "my-custom-name",
"--feature-gates": "APIListChunking=true,APIResponseCompression=true,Accelerators=true,AdvancedAuditing=true",
@ -42,7 +42,7 @@ func TestSchedulerUserConfig(t *testing.T) {
}
func TestSchedulerStaticConfig(t *testing.T) {
cs := CreateMockContainerService("testcluster", "1.9.6", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.OrchestratorProfile.KubernetesConfig.SchedulerConfig = map[string]string{
"--kubeconfig": "user-override",
"--leader-elect": "user-override",

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

@ -231,7 +231,7 @@ func TestAddonsIndexByName(t *testing.T) {
}
func TestAssignDefaultAddonImages(t *testing.T) {
kubernetesVersion := "1.16.14"
kubernetesVersion := common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
k8sComponents := GetK8sComponentsByVersionMap(&KubernetesConfig{KubernetesImageBaseType: common.KubernetesImageBaseTypeMCR})[kubernetesVersion]
customImage := "myimage"
specConfig := AzureCloudSpecEnvMap["AzurePublicCloud"].KubernetesSpecConfig
@ -3161,15 +3161,8 @@ func TestEnableAggregatedAPIs(t *testing.T) {
}
func TestCloudControllerManagerEnabled(t *testing.T) {
// test that 1.16 defaults to false
cs := CreateMockContainerService("testcluster", "1.16.1", 3, 2, false)
cs.setOrchestratorDefaults(false, false)
if cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager == to.BoolPtr(true) {
t.Fatal("expected UseCloudControllerManager to default to false")
}
// test that 1.17 defaults to false
cs = CreateMockContainerService("testcluster", "1.17.0", 3, 2, false)
cs := CreateMockContainerService("testcluster", common.RationalizeReleaseAndVersion(Kubernetes, "1.17", "", false, false, false), 3, 2, false)
cs.setOrchestratorDefaults(false, false)
if cs.Properties.OrchestratorProfile.KubernetesConfig.UseCloudControllerManager == to.BoolPtr(true) {
t.Fatal("expected UseCloudControllerManager to default to false")
@ -4255,7 +4248,7 @@ func TestPreserveNodesProperties(t *testing.T) {
func TestUbuntu1804Flags(t *testing.T) {
// Validate --resolv-conf is missing with 16.04 distro and present with 18.04
cs := CreateMockContainerService("testcluster", "1.17.4", 3, 2, false)
cs := CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.Distro = AKSUbuntu1604
cs.Properties.AgentPoolProfiles[0].Distro = AKSUbuntu1804
cs.Properties.AgentPoolProfiles[0].OSType = Linux
@ -4278,7 +4271,7 @@ func TestUbuntu1804Flags(t *testing.T) {
ka["--resolv-conf"], "/run/systemd/resolve/resolv.conf")
}
cs = CreateMockContainerService("testcluster", "1.17.4", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.Distro = Ubuntu1804
cs.Properties.AgentPoolProfiles[0].Distro = Ubuntu
cs.Properties.AgentPoolProfiles[0].OSType = Linux
@ -4301,7 +4294,7 @@ func TestUbuntu1804Flags(t *testing.T) {
ka["--resolv-conf"])
}
cs = CreateMockContainerService("testcluster", "1.10.13", 3, 2, false)
cs = CreateMockContainerService("testcluster", "", 3, 2, false)
cs.Properties.MasterProfile.Distro = Ubuntu
cs.Properties.AgentPoolProfiles[0].Distro = ""
cs.Properties.AgentPoolProfiles[0].OSType = Windows

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

@ -53,7 +53,11 @@ func CreateMockContainerService(containerServiceName, orchestratorVersion string
cs.Properties.OrchestratorProfile = &OrchestratorProfile{}
cs.Properties.OrchestratorProfile.OrchestratorType = Kubernetes
if orchestratorVersion == "" {
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
} else {
cs.Properties.OrchestratorProfile.OrchestratorVersion = orchestratorVersion
}
cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
EnableSecureKubelet: to.BoolPtr(DefaultSecureKubeletEnabled),
EnableRbac: to.BoolPtr(DefaultRBACEnabled),

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

@ -6772,6 +6772,7 @@ func TestPropertiesIsIPMasqAgentDisabled(t *testing.T) {
}
func TestGetProvisionScriptParametersCommon(t *testing.T) {
k8sVersion := common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
cases := []struct {
name string
cs *ContainerService
@ -6780,7 +6781,7 @@ func TestGetProvisionScriptParametersCommon(t *testing.T) {
}{
{
name: "Default container service with no ARM variables",
cs: CreateMockContainerService("testcluster", "1.16.8", 1, 3, true),
cs: CreateMockContainerService("testcluster", k8sVersion, 1, 3, true),
input: ProvisionScriptParametersInput{
Location: "westus",
ResourceGroup: "fakerg",
@ -6792,11 +6793,11 @@ func TestGetProvisionScriptParametersCommon(t *testing.T) {
KubeletPrivateKey: "fakekubeletkey",
ClusterKeyVaultName: "",
},
expected: "ADMINUSER=azureuser APISERVER_PUBLIC_KEY=fakecert AUTHENTICATION_METHOD=client_secret CLOUDPROVIDER_BACKOFF=false CLOUDPROVIDER_BACKOFF_DURATION=0 CLOUDPROVIDER_BACKOFF_EXPONENT=0 CLOUDPROVIDER_BACKOFF_JITTER=0 CLOUDPROVIDER_BACKOFF_MODE= CLOUDPROVIDER_BACKOFF_RETRIES=0 CLOUDPROVIDER_RATELIMIT=false CLOUDPROVIDER_RATELIMIT_BUCKET=0 CLOUDPROVIDER_RATELIMIT_BUCKET_WRITE=0 CLOUDPROVIDER_RATELIMIT_QPS=0 CLOUDPROVIDER_RATELIMIT_QPS_WRITE=0 CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/cni-plugins/" + CNIPluginVer + "/binaries/cni-plugins-linux-amd64-" + CNIPluginVer + ".tgz CONTAINERD_DOWNLOAD_URL_BASE=https://storage.googleapis.com/cri-containerd-release/ CONTAINERD_VERSION=" + DefaultContainerdVersion + " CONTAINER_RUNTIME=docker CUSTOM_HYPERKUBE_IMAGE= ENABLE_MULTIPLE_STANDARD_LOAD_BALANCERS=false ETCD_DOWNLOAD_URL=mcr.microsoft.com/oss/etcd-io/ ETCD_VERSION=" + DefaultEtcdVersion + " EXCLUDE_MASTER_FROM_STANDARD_LB=false HYPERKUBE_URL=hyperkube-amd64:v1.16.8 IDENTITY_SYSTEM=azure_ad IS_IPV6_ENABLED=false KMS_PROVIDER_VAULT_NAME= KUBELET_PRIVATE_KEY=fakekubeletkey KUBERNETES_VERSION=1.16.8 KUBE_BINARY_URL= LOAD_BALANCER_DISABLE_OUTBOUND_SNAT=false LOAD_BALANCER_SKU=Basic LOCATION=westus MAXIMUM_LOADBALANCER_RULE_COUNT=0 MOBY_VERSION=" + DefaultMobyVersion + " MS_APT_REPO=" + DefaultMicrosoftAptRepositoryURL + " NETWORK_API_VERSION=2018-08-01 NETWORK_MODE= NETWORK_PLUGIN=kubenet NETWORK_POLICY= NETWORK_SECURITY_GROUP=" + common.LegacyControlPlaneVMPrefix + "-22998975-nsg PRIMARY_AVAILABILITY_SET=agentpool1-availabilitySet-22998975 PRIMARY_SCALE_SET= RESOURCE_GROUP=fakerg ROUTE_TABLE=" + common.LegacyControlPlaneVMPrefix + "-22998975-routetable SERVICE_PRINCIPAL_CLIENT_ID=fakeclientID SERVICE_PRINCIPAL_CLIENT_SECRET=fakeclientSecret SUBNET=k8s-subnet SUBSCRIPTION_ID=fakesubID TAGS= TENANT_ID=faketenantID USE_INSTANCE_METADATA=false USE_MANAGED_IDENTITY_EXTENSION=false VIRTUAL_NETWORK=k8s-vnet-22998975 VIRTUAL_NETWORK_RESOURCE_GROUP= VM_TYPE=standard VNET_CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/azure-cni/" + AzureCniPluginVerLinux + "/binaries/azure-vnet-cni-linux-amd64-" + AzureCniPluginVerLinux + ".tgz ",
expected: "ADMINUSER=azureuser APISERVER_PUBLIC_KEY=fakecert AUTHENTICATION_METHOD=client_secret CLOUDPROVIDER_BACKOFF=false CLOUDPROVIDER_BACKOFF_DURATION=0 CLOUDPROVIDER_BACKOFF_EXPONENT=0 CLOUDPROVIDER_BACKOFF_JITTER=0 CLOUDPROVIDER_BACKOFF_MODE= CLOUDPROVIDER_BACKOFF_RETRIES=0 CLOUDPROVIDER_RATELIMIT=false CLOUDPROVIDER_RATELIMIT_BUCKET=0 CLOUDPROVIDER_RATELIMIT_BUCKET_WRITE=0 CLOUDPROVIDER_RATELIMIT_QPS=0 CLOUDPROVIDER_RATELIMIT_QPS_WRITE=0 CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/cni-plugins/" + CNIPluginVer + "/binaries/cni-plugins-linux-amd64-" + CNIPluginVer + ".tgz CONTAINERD_DOWNLOAD_URL_BASE=https://storage.googleapis.com/cri-containerd-release/ CONTAINERD_VERSION=" + DefaultContainerdVersion + " CONTAINER_RUNTIME=docker CUSTOM_HYPERKUBE_IMAGE= ENABLE_MULTIPLE_STANDARD_LOAD_BALANCERS=false ETCD_DOWNLOAD_URL=mcr.microsoft.com/oss/etcd-io/ ETCD_VERSION=" + DefaultEtcdVersion + " EXCLUDE_MASTER_FROM_STANDARD_LB=false HYPERKUBE_URL= IDENTITY_SYSTEM=azure_ad IS_IPV6_ENABLED=false KMS_PROVIDER_VAULT_NAME= KUBELET_PRIVATE_KEY=fakekubeletkey KUBERNETES_VERSION=" + k8sVersion + " KUBE_BINARY_URL= LOAD_BALANCER_DISABLE_OUTBOUND_SNAT=false LOAD_BALANCER_SKU=Basic LOCATION=westus MAXIMUM_LOADBALANCER_RULE_COUNT=0 MOBY_VERSION=" + DefaultMobyVersion + " MS_APT_REPO=" + DefaultMicrosoftAptRepositoryURL + " NETWORK_API_VERSION=2018-08-01 NETWORK_MODE= NETWORK_PLUGIN=kubenet NETWORK_POLICY= NETWORK_SECURITY_GROUP=" + common.LegacyControlPlaneVMPrefix + "-22998975-nsg PRIMARY_AVAILABILITY_SET=agentpool1-availabilitySet-22998975 PRIMARY_SCALE_SET= RESOURCE_GROUP=fakerg ROUTE_TABLE=" + common.LegacyControlPlaneVMPrefix + "-22998975-routetable SERVICE_PRINCIPAL_CLIENT_ID=fakeclientID SERVICE_PRINCIPAL_CLIENT_SECRET=fakeclientSecret SUBNET=k8s-subnet SUBSCRIPTION_ID=fakesubID TAGS= TENANT_ID=faketenantID USE_INSTANCE_METADATA=false USE_MANAGED_IDENTITY_EXTENSION=false VIRTUAL_NETWORK=k8s-vnet-22998975 VIRTUAL_NETWORK_RESOURCE_GROUP= VM_TYPE=standard VNET_CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/azure-cni/" + AzureCniPluginVerLinux + "/binaries/azure-vnet-cni-linux-amd64-" + AzureCniPluginVerLinux + ".tgz ",
},
{
name: "With ARM variables",
cs: CreateMockContainerService("testcluster", "1.16.8", 1, 3, true),
cs: CreateMockContainerService("testcluster", k8sVersion, 1, 3, true),
input: ProvisionScriptParametersInput{
Location: common.WrapAsARMVariable("location"),
ResourceGroup: common.WrapAsARMVariable("resourceGroup"),
@ -6808,7 +6809,7 @@ func TestGetProvisionScriptParametersCommon(t *testing.T) {
KubeletPrivateKey: common.WrapAsParameter("clientPrivateKey"),
ClusterKeyVaultName: common.WrapAsARMVariable("clusterKeyvaultName"),
},
expected: "ADMINUSER=azureuser APISERVER_PUBLIC_KEY=',parameters('apiServerCertificate'),' AUTHENTICATION_METHOD=client_secret CLOUDPROVIDER_BACKOFF=false CLOUDPROVIDER_BACKOFF_DURATION=0 CLOUDPROVIDER_BACKOFF_EXPONENT=0 CLOUDPROVIDER_BACKOFF_JITTER=0 CLOUDPROVIDER_BACKOFF_MODE= CLOUDPROVIDER_BACKOFF_RETRIES=0 CLOUDPROVIDER_RATELIMIT=false CLOUDPROVIDER_RATELIMIT_BUCKET=0 CLOUDPROVIDER_RATELIMIT_BUCKET_WRITE=0 CLOUDPROVIDER_RATELIMIT_QPS=0 CLOUDPROVIDER_RATELIMIT_QPS_WRITE=0 CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/cni-plugins/" + CNIPluginVer + "/binaries/cni-plugins-linux-amd64-" + CNIPluginVer + ".tgz CONTAINERD_DOWNLOAD_URL_BASE=https://storage.googleapis.com/cri-containerd-release/ CONTAINERD_VERSION=" + DefaultContainerdVersion + " CONTAINER_RUNTIME=docker CUSTOM_HYPERKUBE_IMAGE= ENABLE_MULTIPLE_STANDARD_LOAD_BALANCERS=false ETCD_DOWNLOAD_URL=mcr.microsoft.com/oss/etcd-io/ ETCD_VERSION=" + DefaultEtcdVersion + " EXCLUDE_MASTER_FROM_STANDARD_LB=false HYPERKUBE_URL=hyperkube-amd64:v1.16.8 IDENTITY_SYSTEM=azure_ad IS_IPV6_ENABLED=false KMS_PROVIDER_VAULT_NAME=',variables('clusterKeyvaultName'),' KUBELET_PRIVATE_KEY=',parameters('clientPrivateKey'),' KUBERNETES_VERSION=1.16.8 KUBE_BINARY_URL= LOAD_BALANCER_DISABLE_OUTBOUND_SNAT=false LOAD_BALANCER_SKU=Basic LOCATION=',variables('location'),' MAXIMUM_LOADBALANCER_RULE_COUNT=0 MOBY_VERSION=" + DefaultMobyVersion + " MS_APT_REPO=" + DefaultMicrosoftAptRepositoryURL + " NETWORK_API_VERSION=2018-08-01 NETWORK_MODE= NETWORK_PLUGIN=kubenet NETWORK_POLICY= NETWORK_SECURITY_GROUP=" + common.LegacyControlPlaneVMPrefix + "-22998975-nsg PRIMARY_AVAILABILITY_SET=agentpool1-availabilitySet-22998975 PRIMARY_SCALE_SET= RESOURCE_GROUP=',variables('resourceGroup'),' ROUTE_TABLE=" + common.LegacyControlPlaneVMPrefix + "-22998975-routetable SERVICE_PRINCIPAL_CLIENT_ID=',variables('servicePrincipalClientId'),' SERVICE_PRINCIPAL_CLIENT_SECRET=',variables('singleQuote'),'',variables('servicePrincipalClientSecret'),'',variables('singleQuote'),' SUBNET=k8s-subnet SUBSCRIPTION_ID=',variables('subscriptionId'),' TAGS= TENANT_ID=',variables('tenantID'),' USE_INSTANCE_METADATA=false USE_MANAGED_IDENTITY_EXTENSION=false VIRTUAL_NETWORK=k8s-vnet-22998975 VIRTUAL_NETWORK_RESOURCE_GROUP= VM_TYPE=standard VNET_CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/azure-cni/" + AzureCniPluginVerLinux + "/binaries/azure-vnet-cni-linux-amd64-" + AzureCniPluginVerLinux + ".tgz ",
expected: "ADMINUSER=azureuser APISERVER_PUBLIC_KEY=',parameters('apiServerCertificate'),' AUTHENTICATION_METHOD=client_secret CLOUDPROVIDER_BACKOFF=false CLOUDPROVIDER_BACKOFF_DURATION=0 CLOUDPROVIDER_BACKOFF_EXPONENT=0 CLOUDPROVIDER_BACKOFF_JITTER=0 CLOUDPROVIDER_BACKOFF_MODE= CLOUDPROVIDER_BACKOFF_RETRIES=0 CLOUDPROVIDER_RATELIMIT=false CLOUDPROVIDER_RATELIMIT_BUCKET=0 CLOUDPROVIDER_RATELIMIT_BUCKET_WRITE=0 CLOUDPROVIDER_RATELIMIT_QPS=0 CLOUDPROVIDER_RATELIMIT_QPS_WRITE=0 CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/cni-plugins/" + CNIPluginVer + "/binaries/cni-plugins-linux-amd64-" + CNIPluginVer + ".tgz CONTAINERD_DOWNLOAD_URL_BASE=https://storage.googleapis.com/cri-containerd-release/ CONTAINERD_VERSION=" + DefaultContainerdVersion + " CONTAINER_RUNTIME=docker CUSTOM_HYPERKUBE_IMAGE= ENABLE_MULTIPLE_STANDARD_LOAD_BALANCERS=false ETCD_DOWNLOAD_URL=mcr.microsoft.com/oss/etcd-io/ ETCD_VERSION=" + DefaultEtcdVersion + " EXCLUDE_MASTER_FROM_STANDARD_LB=false HYPERKUBE_URL= IDENTITY_SYSTEM=azure_ad IS_IPV6_ENABLED=false KMS_PROVIDER_VAULT_NAME=',variables('clusterKeyvaultName'),' KUBELET_PRIVATE_KEY=',parameters('clientPrivateKey'),' KUBERNETES_VERSION=" + k8sVersion + " KUBE_BINARY_URL= LOAD_BALANCER_DISABLE_OUTBOUND_SNAT=false LOAD_BALANCER_SKU=Basic LOCATION=',variables('location'),' MAXIMUM_LOADBALANCER_RULE_COUNT=0 MOBY_VERSION=" + DefaultMobyVersion + " MS_APT_REPO=" + DefaultMicrosoftAptRepositoryURL + " NETWORK_API_VERSION=2018-08-01 NETWORK_MODE= NETWORK_PLUGIN=kubenet NETWORK_POLICY= NETWORK_SECURITY_GROUP=" + common.LegacyControlPlaneVMPrefix + "-22998975-nsg PRIMARY_AVAILABILITY_SET=agentpool1-availabilitySet-22998975 PRIMARY_SCALE_SET= RESOURCE_GROUP=',variables('resourceGroup'),' ROUTE_TABLE=" + common.LegacyControlPlaneVMPrefix + "-22998975-routetable SERVICE_PRINCIPAL_CLIENT_ID=',variables('servicePrincipalClientId'),' SERVICE_PRINCIPAL_CLIENT_SECRET=',variables('singleQuote'),'',variables('servicePrincipalClientSecret'),'',variables('singleQuote'),' SUBNET=k8s-subnet SUBSCRIPTION_ID=',variables('subscriptionId'),' TAGS= TENANT_ID=',variables('tenantID'),' USE_INSTANCE_METADATA=false USE_MANAGED_IDENTITY_EXTENSION=false VIRTUAL_NETWORK=k8s-vnet-22998975 VIRTUAL_NETWORK_RESOURCE_GROUP= VM_TYPE=standard VNET_CNI_PLUGINS_URL=https://kubernetesartifacts.azureedge.net/azure-cni/" + AzureCniPluginVerLinux + "/binaries/azure-vnet-cni-linux-amd64-" + AzureCniPluginVerLinux + ".tgz ",
},
}

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

@ -229,10 +229,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
if err != nil {
return err
}
minVersion, err := semver.Make("1.7.0")
if err != nil {
return errors.New("could not validate version")
}
if o.KubernetesConfig.EnableAggregatedAPIs {
if !o.KubernetesConfig.IsRBACEnabled() {
@ -241,10 +237,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
}
if to.Bool(o.KubernetesConfig.EnableDataEncryptionAtRest) {
if sv.LT(minVersion) {
return errors.Errorf("enableDataEncryptionAtRest is only available in Kubernetes version %s or greater; unable to validate for Kubernetes version %s",
minVersion.String(), o.OrchestratorVersion)
}
if o.KubernetesConfig.EtcdEncryptionKey != "" {
_, err = base64.StdEncoding.DecodeString(o.KubernetesConfig.EtcdEncryptionKey)
if err != nil {
@ -254,30 +246,11 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
}
if to.Bool(o.KubernetesConfig.EnableEncryptionWithExternalKms) {
minVersion, err := semver.Make("1.10.0")
if err != nil {
return errors.Errorf("could not validate version")
}
if sv.LT(minVersion) {
return errors.Errorf("enableEncryptionWithExternalKms is only available in Kubernetes version %s or greater; unable to validate for Kubernetes version %s",
minVersion.String(), o.OrchestratorVersion)
}
if to.Bool(a.OrchestratorProfile.KubernetesConfig.UseManagedIdentity) && a.OrchestratorProfile.KubernetesConfig.UserAssignedID == "" {
log.Warnf("Clusters with enableEncryptionWithExternalKms=true and system-assigned identity are not upgradable! You will not be able to upgrade your cluster using `aks-engine upgrade`")
}
}
if o.KubernetesConfig.EnableRbac != nil && !o.KubernetesConfig.IsRBACEnabled() {
minVersionNotAllowed, err := semver.Make("1.15.0")
if err != nil {
return errors.Errorf("could not validate version")
}
if !sv.LT(minVersionNotAllowed) {
return errors.Errorf("RBAC support is required for Kubernetes version %s or greater; unable to build Kubernetes v%s cluster with enableRbac=false",
minVersionNotAllowed.String(), o.OrchestratorVersion)
}
}
if to.Bool(o.KubernetesConfig.EnablePodSecurityPolicy) {
log.Warnf("EnablePodSecurityPolicy is deprecated in favor of the addon pod-security-policy.")
if !o.KubernetesConfig.IsRBACEnabled() {
@ -295,14 +268,6 @@ func (a *Properties) ValidateOrchestratorProfile(isUpdate bool) error {
}
if o.KubernetesConfig.LoadBalancerSku == StandardLoadBalancerSku {
minVersion, err := semver.Make("1.11.0")
if err != nil {
return errors.Errorf("could not validate version")
}
if sv.LT(minVersion) {
return errors.Errorf("loadBalancerSku is only available in Kubernetes version %s or greater; unable to validate for Kubernetes version %s",
minVersion.String(), o.OrchestratorVersion)
}
if !to.Bool(a.OrchestratorProfile.KubernetesConfig.ExcludeMasterFromStandardLB) {
return errors.Errorf("standard loadBalancerSku should exclude master nodes. Please set KubernetesConfig \"ExcludeMasterFromStandardLB\" to \"true\"")
}
@ -663,7 +628,6 @@ func (a *Properties) validateLinuxProfile() error {
func (a *Properties) validateAddons(isUpdate bool) error {
if a.OrchestratorProfile.KubernetesConfig != nil && a.OrchestratorProfile.KubernetesConfig.Addons != nil {
var isAvailabilitySets bool
var hasNSeriesSKU bool
var kubeDNSEnabled bool
var corednsEnabled bool
var keyvaultFlexvolumeEnabled, csiSecretsStoreEnabled bool
@ -672,10 +636,6 @@ func (a *Properties) validateAddons(isUpdate bool) error {
if agentPool.IsAvailabilitySets() {
isAvailabilitySets = true
}
if agentPool.IsNSeriesSKU() {
hasNSeriesSKU = true
}
}
for _, addon := range a.OrchestratorProfile.KubernetesConfig.Addons {
if addon.Data != "" {
@ -727,14 +687,6 @@ func (a *Properties) validateAddons(isUpdate bool) error {
}
}
}
case "nvidia-device-plugin":
isValidVersion, err := common.IsValidMinVersion(a.OrchestratorProfile.OrchestratorType, a.OrchestratorProfile.OrchestratorRelease, a.OrchestratorProfile.OrchestratorVersion, "1.10.0")
if err != nil {
return err
}
if hasNSeriesSKU && !isValidVersion {
return errors.New("NVIDIA Device Plugin add-on can only be used Kubernetes 1.10 or above. Please specify \"orchestratorRelease\": \"1.10\"")
}
case "aad":
if !a.HasAADAdminGroupID() {
return errors.New("aad addon can't be enabled without a valid aadProfile w/ adminGroupID")
@ -801,14 +753,6 @@ func (a *Properties) validateAddons(isUpdate bool) error {
} 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")
if err != nil {
return err
}
if !isValidVersion {
return errors.New("Azure Policy add-on can only be used with Kubernetes v1.14 and above. Please specify a compatible version")
}
case common.KubeDNSAddonName:
kubeDNSEnabled = true
case common.CoreDNSAddonName:

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

@ -83,7 +83,7 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
EnableAggregatedAPIs: true,
EnableRbac: &falseVal,
@ -92,35 +92,11 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
},
expectedError: "enableAggregatedAPIs requires the enableRbac feature as a prerequisite",
},
"should error when KubernetesConfig has enableRBAC disabled for >= 1.15": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: common.GetLatestPatchVersion("1.15", common.GetAllSupportedKubernetesVersions(false, false, false)),
KubernetesConfig: &KubernetesConfig{
EnableRbac: &falseVal,
},
},
},
expectedError: fmt.Sprintf("RBAC support is required for Kubernetes version 1.15.0 or greater; unable to build Kubernetes v%s cluster with enableRbac=false", common.GetLatestPatchVersion("1.15", common.GetAllSupportedKubernetesVersions(false, false, false))),
},
"should error when KubernetesConfig has enableDataEncryptionAtRest enabled with invalid version": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.6.9",
KubernetesConfig: &KubernetesConfig{
EnableDataEncryptionAtRest: &trueVal,
},
},
},
expectedError: "enableDataEncryptionAtRest is only available in Kubernetes version 1.7.0 or greater; unable to validate for Kubernetes version 1.6.9",
},
"should error when KubernetesConfig has enableDataEncryptionAtRest enabled with invalid encryption key": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
EnableDataEncryptionAtRest: &trueVal,
EtcdEncryptionKey: "fakeEncryptionKey",
@ -129,35 +105,11 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
},
expectedError: "etcdEncryptionKey must be base64 encoded. Please provide a valid base64 encoded value or leave the etcdEncryptionKey empty to auto-generate the value",
},
"should error when KubernetesConfig has enableEncryptionWithExternalKms enabled with invalid version": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.6.9",
KubernetesConfig: &KubernetesConfig{
EnableEncryptionWithExternalKms: &trueVal,
},
},
},
expectedError: "enableEncryptionWithExternalKms is only available in Kubernetes version 1.10.0 or greater; unable to validate for Kubernetes version 1.6.9",
},
"should error when KubernetesConfig has Standard loadBalancerSku with invalid version": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.6.9",
KubernetesConfig: &KubernetesConfig{
LoadBalancerSku: StandardLoadBalancerSku,
},
},
},
expectedError: "loadBalancerSku is only available in Kubernetes version 1.11.0 or greater; unable to validate for Kubernetes version 1.6.9",
},
"should error when KubernetesConfig has Basic loadBalancerSku with loadBalancerOutboundIPs config": {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.18.15",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
LoadBalancerSku: BasicLoadBalancerSku,
ExcludeMasterFromStandardLB: to.BoolPtr(true),
@ -171,7 +123,7 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.18.15",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
LoadBalancerOutboundIPs: to.IntPtr(17),
},
@ -183,7 +135,7 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
EnablePodSecurityPolicy: &trueVal,
},
@ -220,7 +172,7 @@ func Test_OrchestratorProfile_Validate(t *testing.T) {
properties: &Properties{
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: "Kubernetes",
OrchestratorVersion: "v1.16.14",
OrchestratorVersion: "v" + common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
},
},
},
@ -2335,20 +2287,6 @@ func Test_Properties_ValidateAddons(t *testing.T) {
)
}
p.OrchestratorProfile.OrchestratorRelease = "1.12"
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(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(false); err != nil {
t.Errorf(
@ -2524,32 +2462,6 @@ func Test_Properties_ValidateAddons(t *testing.T) {
)
}
p.AgentPoolProfiles = []*AgentPoolProfile{
{
VMSize: "Standard_NC6",
},
}
p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
Addons: []KubernetesAddon{
{
Name: "nvidia-device-plugin",
Enabled: to.BoolPtr(true),
},
},
}
p.OrchestratorProfile.OrchestratorRelease = "1.9"
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(false); err != nil {
t.Errorf(
"should not error on nvidia-device-plugin with k8s >= 1.12",
)
}
p.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
Addons: []KubernetesAddon{
{
@ -3073,7 +2985,7 @@ func TestValidateImageNameAndGroup(t *testing.T) {
func TestProperties_ValidateManagedIdentity(t *testing.T) {
tests := []struct {
name string
orchestratorRelease string
orchestratorVersion string
useManagedIdentity bool
userAssignedID string
masterProfile MasterProfile
@ -3082,7 +2994,7 @@ func TestProperties_ValidateManagedIdentity(t *testing.T) {
}{
{
name: "use managed identity with master vmas",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
useManagedIdentity: true,
masterProfile: MasterProfile{
DNSPrefix: "dummy",
@ -3098,7 +3010,7 @@ func TestProperties_ValidateManagedIdentity(t *testing.T) {
},
{
name: "use master VMSS with empty user assigned ID",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
useManagedIdentity: true,
masterProfile: MasterProfile{
DNSPrefix: "dummy",
@ -3124,7 +3036,7 @@ func TestProperties_ValidateManagedIdentity(t *testing.T) {
cs.Properties.MasterProfile = &test.masterProfile
cs.Properties.MasterProfile.VMSize = "Standard_DS2_v2"
cs.Properties.OrchestratorProfile = &OrchestratorProfile{
OrchestratorRelease: test.orchestratorRelease,
OrchestratorVersion: test.orchestratorVersion,
OrchestratorType: Kubernetes,
KubernetesConfig: &KubernetesConfig{
UseManagedIdentity: to.BoolPtr(test.useManagedIdentity),
@ -3146,7 +3058,6 @@ func TestMasterProfileValidate(t *testing.T) {
name string
orchestratorType string
orchestratorVersion string
orchestratorRelease string
useInstanceMetadata bool
masterProfile MasterProfile
agentPoolProfiles []*AgentPoolProfile
@ -3189,7 +3100,7 @@ func TestMasterProfileValidate(t *testing.T) {
{
name: "Master Profile with VMSS and storage account",
orchestratorType: Kubernetes,
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
masterProfile: MasterProfile{
DNSPrefix: "dummy",
Count: 3,
@ -3201,7 +3112,7 @@ func TestMasterProfileValidate(t *testing.T) {
{
name: "Master Profile with VMSS and agent profiles with VMAS",
orchestratorType: Kubernetes,
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
masterProfile: MasterProfile{
DNSPrefix: "dummy",
Count: 3,
@ -3262,7 +3173,6 @@ func TestMasterProfileValidate(t *testing.T) {
cs.Properties.OrchestratorProfile = &OrchestratorProfile{
OrchestratorType: test.orchestratorType,
OrchestratorVersion: test.orchestratorVersion,
OrchestratorRelease: test.orchestratorRelease,
KubernetesConfig: &KubernetesConfig{
UseInstanceMetadata: to.BoolPtr(test.useInstanceMetadata),
},
@ -3280,7 +3190,7 @@ func TestMasterProfileValidate(t *testing.T) {
func TestProperties_ValidateZones(t *testing.T) {
tests := []struct {
name string
orchestratorRelease string
orchestratorVersion string
loadBalancerSku string
excludeMasterFromStandardLB bool
masterProfile *MasterProfile
@ -3290,7 +3200,7 @@ func TestProperties_ValidateZones(t *testing.T) {
}{
{
name: "Agent profile with zones vmas",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
masterProfile: &MasterProfile{
Count: 5,
DNSPrefix: "foo",
@ -3312,7 +3222,7 @@ func TestProperties_ValidateZones(t *testing.T) {
},
{
name: "Master profile with zones and Agent profile without zones",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
masterProfile: &MasterProfile{
Count: 5,
DNSPrefix: "foo",
@ -3333,7 +3243,7 @@ func TestProperties_ValidateZones(t *testing.T) {
},
{
name: "Master profile without zones and Agent profile with zones",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
masterProfile: &MasterProfile{
Count: 3,
DNSPrefix: "foo",
@ -3354,7 +3264,7 @@ func TestProperties_ValidateZones(t *testing.T) {
},
{
name: "all zones and basic loadbalancer",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: BasicLoadBalancerSku,
masterProfile: &MasterProfile{
Count: 5,
@ -3377,7 +3287,7 @@ func TestProperties_ValidateZones(t *testing.T) {
},
{
name: "all zones with standard loadbalancer and false excludeMasterFromStandardLB",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: StandardLoadBalancerSku,
excludeMasterFromStandardLB: false,
masterProfile: &MasterProfile{
@ -3408,7 +3318,7 @@ func TestProperties_ValidateZones(t *testing.T) {
cs := getK8sDefaultContainerService(true)
cs.Properties.MasterProfile = test.masterProfile
cs.Properties.AgentPoolProfiles = test.agentProfiles
cs.Properties.OrchestratorProfile.OrchestratorRelease = test.orchestratorRelease
cs.Properties.OrchestratorProfile.OrchestratorVersion = test.orchestratorVersion
cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
LoadBalancerSku: test.loadBalancerSku,
ExcludeMasterFromStandardLB: to.BoolPtr(test.excludeMasterFromStandardLB),
@ -3579,7 +3489,7 @@ func ExampleProperties_validateZones() {
func TestProperties_ValidateLoadBalancer(t *testing.T) {
tests := []struct {
name string
orchestratorRelease string
orchestratorVersion string
loadBalancerSku string
masterProfile *MasterProfile
agentProfiles []*AgentPoolProfile
@ -3589,7 +3499,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
}{
{
name: "lowercase basic LB",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: "basic",
masterProfile: &MasterProfile{
Count: 3,
@ -3609,7 +3519,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
},
{
name: "Basic LB",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: BasicLoadBalancerSku,
masterProfile: &MasterProfile{
Count: 3,
@ -3620,7 +3530,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
},
{
name: "lowercase standard LB",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: "standard",
masterProfile: &MasterProfile{
Count: 3,
@ -3631,7 +3541,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
},
{
name: "Standard LB without master excluded",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: StandardLoadBalancerSku,
masterProfile: &MasterProfile{
Count: 3,
@ -3644,7 +3554,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
},
{
name: "Standard LB",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: StandardLoadBalancerSku,
masterProfile: &MasterProfile{
Count: 3,
@ -3656,7 +3566,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
},
{
name: "empty string LB value",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: "",
masterProfile: &MasterProfile{
Count: 3,
@ -3667,7 +3577,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
},
{
name: "invalid LB string value",
orchestratorRelease: "1.16",
orchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
loadBalancerSku: "foo",
masterProfile: &MasterProfile{
Count: 3,
@ -3687,7 +3597,7 @@ func TestProperties_ValidateLoadBalancer(t *testing.T) {
cs := getK8sDefaultContainerService(true)
cs.Properties.MasterProfile = test.masterProfile
cs.Properties.AgentPoolProfiles = test.agentProfiles
cs.Properties.OrchestratorProfile.OrchestratorRelease = test.orchestratorRelease
cs.Properties.OrchestratorProfile.OrchestratorVersion = test.orchestratorVersion
cs.Properties.OrchestratorProfile.KubernetesConfig = &KubernetesConfig{
LoadBalancerSku: test.loadBalancerSku,
ExcludeMasterFromStandardLB: to.BoolPtr(test.excludeMasterFromStandardLB),
@ -3774,7 +3684,7 @@ func TestProperties_ValidateSinglePlacementGroup(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
cs := getK8sDefaultContainerService(true)
cs.Properties.OrchestratorProfile.OrchestratorRelease = "1.16"
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
cs.Properties.MasterProfile = test.masterProfile
cs.Properties.AgentPoolProfiles = test.agentPoolProfiles
err := cs.Validate(true)
@ -4063,7 +3973,7 @@ func TestProperties_ValidateVNET(t *testing.T) {
t.Run(test.name, func(t *testing.T) {
t.Parallel()
cs := getK8sDefaultContainerService(true)
cs.Properties.OrchestratorProfile.OrchestratorRelease = "1.16"
cs.Properties.OrchestratorProfile.OrchestratorVersion = common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false)
cs.Properties.MasterProfile = test.masterProfile
cs.Properties.AgentPoolProfiles = test.agentPoolProfiles
err := cs.Validate(true)
@ -4683,7 +4593,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
UseInstanceMetadata: to.BoolPtr(trueVal),
},
@ -4704,7 +4614,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
EtcdDiskSizeGB: "1024",
},
@ -4725,7 +4635,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
KubernetesConfig: &KubernetesConfig{
EtcdDiskSizeGB: "1024GB",
},
@ -4746,7 +4656,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
},
AgentPoolProfiles: []*AgentPoolProfile{
{
@ -4772,7 +4682,7 @@ func TestValidateLocation(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
},
AgentPoolProfiles: []*AgentPoolProfile{
{
@ -4838,7 +4748,7 @@ func TestValidateAcceleratedNetworkingEnabledWindows(t *testing.T) {
},
OrchestratorProfile: &OrchestratorProfile{
OrchestratorType: Kubernetes,
OrchestratorVersion: "1.16.14",
OrchestratorVersion: common.RationalizeReleaseAndVersion(Kubernetes, "", "", false, false, false),
},
AgentPoolProfiles: []*AgentPoolProfile{
{

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

@ -655,7 +655,7 @@ func TestTemplateGenerator_GetKubernetesLinuxNodeCustomDataJSONObject(t *testing
{
Name: "VMSSWithNoAgentPool",
CSFactory: func() api.ContainerService {
cs := api.CreateMockContainerService("VMSSWithNoAgentPool", "1.10.13", 3, 0, false)
cs := api.CreateMockContainerService("VMSSWithNoAgentPool", "", 3, 0, false)
cs.Properties.AgentPoolProfiles = []*api.AgentPoolProfile{
{
Name: "pool1",
@ -672,7 +672,7 @@ func TestTemplateGenerator_GetKubernetesLinuxNodeCustomDataJSONObject(t *testing
{
Name: "VMSSWithNoLinuxProfile",
CSFactory: func() api.ContainerService {
cs := api.CreateMockContainerService("VMSSWithNoLinuxProfile", "1.10.13", 3, 0, false)
cs := api.CreateMockContainerService("VMSSWithNoLinuxProfile", "", 3, 0, false)
cs.Properties.AgentPoolProfiles = []*api.AgentPoolProfile{
{
Name: "pool1",

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

@ -18,7 +18,7 @@ import (
func TestWriteTLSArtifacts(t *testing.T) {
cs := api.CreateMockContainerService("testcluster", "1.7.12", 1, 2, true)
cs := api.CreateMockContainerService("testcluster", "", 1, 2, true)
writer := &ArtifactWriter{
Translator: &i18n.Translator{
Locale: nil,
@ -76,7 +76,7 @@ func TestWriteTLSArtifacts(t *testing.T) {
os.RemoveAll(defaultDir)
// Generate files with custom cloud profile in configuration
csCustom := api.CreateMockContainerService("testcluster", "1.11.6", 1, 2, false)
csCustom := api.CreateMockContainerService("testcluster", "", 1, 2, false)
csCustom.Location = "customlocation"
csCustom.Properties.CustomCloudProfile = &api.CustomCloudProfile{
Environment: &azure.Environment{

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

@ -4,7 +4,6 @@
"properties": {
"provisioningState": "",
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"enablePodSecurityPolicy": true,
"enableRbac": true,

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

@ -4,7 +4,6 @@
"properties": {
"provisioningState": "",
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"addons": [
{

1
pkg/engine/testdata/addons/kubernetes.json поставляемый
Просмотреть файл

@ -4,7 +4,6 @@
"properties": {
"provisioningState": "",
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"addons": [
{

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

@ -3,7 +3,6 @@
"location": "local",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"kubernetesImageBase": "k8s.gcr.io/",
"useInstanceMetadata": false,

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

@ -3,7 +3,6 @@
"location": "westus",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"kubernetesImageBase": "k8s.gcr.io/",
"useInstanceMetadata": false,

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

@ -3,9 +3,6 @@
"plan": {},
"properties": {
"provisioningState": "",
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "masterdns1",

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

@ -2,8 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"orchestratorVersion": "1.16.14",
"kubernetesConfig": {
"kubernetesImageBase": "k8s.gcr.io/",
"clusterSubnet": "10.240.0.0/12",

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "masterdns1",

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 1,
"dnsPrefix": "masterdns1",

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

@ -1,9 +1,6 @@
{
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16"
},
"masterProfile": {
"count": 3,
"dnsPrefix": "prefix",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useInstanceMetadata": false,
"windowsNodeBinariesURL": "http://test/test.tar.gz",

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

@ -2,7 +2,6 @@
"apiVersion": "vlabs",
"properties": {
"orchestratorProfile": {
"orchestratorRelease": "1.16",
"kubernetesConfig": {
"useInstanceMetadata": false
}

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

@ -291,10 +291,6 @@ K8S_VERSIONS="
1.17.17
1.17.17-azs
1.17.16
1.16.15
1.16.15-azs
1.16.14
1.16.14-azs
"
for KUBERNETES_VERSION in ${K8S_VERSIONS}; do
if (( $(echo ${KUBERNETES_VERSION} | cut -d"." -f2) < 17 )); then