diff --git a/templates/cluster-template-aks-aad.yaml b/templates/cluster-template-aks-aad.yaml deleted file mode 100644 index 382ae136aa0..00000000000 --- a/templates/cluster-template-aks-aad.yaml +++ /dev/null @@ -1,123 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} - namespace: default -spec: - clusterNetwork: - services: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AzureManagedControlPlane - name: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AzureManagedCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AzureManagedControlPlane -metadata: - name: ${CLUSTER_NAME} - namespace: default -spec: - identityRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AzureClusterIdentity - name: ${CLUSTER_IDENTITY_NAME} - location: ${AZURE_LOCATION} - resourceGroupName: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}} - sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} - subscriptionID: ${AZURE_SUBSCRIPTION_ID} - version: ${KUBERNETES_VERSION} - aadProfile: - managed: ${AZURE_AAD_MANAGED} - adminGroupObjectIDs: - - ${ADMIN_GROUP_OBJECT_ID} - ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AzureManagedCluster -metadata: - name: ${CLUSTER_NAME} - namespace: default ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachinePool -metadata: - name: agentpool0 - namespace: default -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AzureManagedMachinePool - name: agentpool0 - namespace: default - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AzureManagedMachinePool -metadata: - name: agentpool0 - namespace: default -spec: - mode: System - osDiskSizeGB: 512 - sku: ${AZURE_NODE_MACHINE_TYPE} ---- -apiVersion: cluster.x-k8s.io/v1alpha4 -kind: MachinePool -metadata: - name: agentpool1 - namespace: default -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 - kind: AzureManagedMachinePool - name: agentpool1 - namespace: default - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AzureManagedMachinePool -metadata: - name: agentpool1 - namespace: default -spec: - mode: User - osDiskSizeGB: 1024 - sku: ${AZURE_NODE_MACHINE_TYPE} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1alpha4 -kind: AzureClusterIdentity -metadata: - labels: - clusterctl.cluster.x-k8s.io/move-hierarchy: "true" - name: ${CLUSTER_IDENTITY_NAME} - namespace: default -spec: - allowedNamespaces: {} - clientID: ${AZURE_CLIENT_ID} - clientSecret: - name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME} - namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE} - tenantID: ${AZURE_TENANT_ID} - type: ServicePrincipal diff --git a/templates/cluster-template-aks-multi-tenancy.yaml b/templates/cluster-template-aks-multi-tenancy.yaml deleted file mode 100644 index 6b4dce3c1ca..00000000000 --- a/templates/cluster-template-aks-multi-tenancy.yaml +++ /dev/null @@ -1,147 +0,0 @@ -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} - namespace: default -spec: - clusterNetwork: - services: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedControlPlane - name: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedCluster - name: ${CLUSTER_NAME} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedControlPlane -metadata: - name: ${CLUSTER_NAME} - namespace: default -spec: - addonProfiles: - - enabled: true - name: azurepolicy - identityRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureClusterIdentity - name: ${CLUSTER_IDENTITY_NAME} - namespace: ${CLUSTER_IDENTITY_NAMESPACE} - location: ${AZURE_LOCATION} - resourceGroupName: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}} - sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} - subscriptionID: ${AZURE_SUBSCRIPTION_ID} - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedCluster -metadata: - name: ${CLUSTER_NAME} - namespace: default ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: agentpool0 - namespace: default -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedMachinePool - name: agentpool0 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedMachinePool -metadata: - name: agentpool0 - namespace: default -spec: - mode: System - osDiskSizeGB: 30 - sku: ${AZURE_NODE_MACHINE_TYPE} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: agentpool1 - namespace: default -spec: - clusterName: ${CLUSTER_NAME} - replicas: ${WORKER_MACHINE_COUNT} - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedMachinePool - name: agentpool1 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedMachinePool -metadata: - name: agentpool1 - namespace: default -spec: - mode: User - osDiskSizeGB: 40 - sku: ${AZURE_NODE_MACHINE_TYPE} ---- -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: agentpool2 - namespace: default -spec: - clusterName: ${CLUSTER_NAME} - replicas: 1 - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedMachinePool - name: agentpool2 - version: ${KUBERNETES_VERSION} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedMachinePool -metadata: - name: agentpool2 - namespace: default -spec: - mode: User - sku: ${AZURE_NODE_MACHINE_TYPE} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureClusterIdentity -metadata: - name: ${CLUSTER_IDENTITY_NAME} - namespace: default -spec: - allowedNamespaces: {} - clientID: ${AZURE_CLIENT_ID} - clientSecret: - name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME} - namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE} - tenantID: ${AZURE_TENANT_ID} - type: ServicePrincipal diff --git a/templates/flavors/aks-multi-tenancy/azure-cluster-identity.yaml b/templates/flavors/aks-multi-tenancy/azure-cluster-identity.yaml deleted file mode 100644 index 7f39d32f0a7..00000000000 --- a/templates/flavors/aks-multi-tenancy/azure-cluster-identity.yaml +++ /dev/null @@ -1,11 +0,0 @@ ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureClusterIdentity -metadata: - name: "${CLUSTER_IDENTITY_NAME}" -spec: - type: ServicePrincipal - allowedNamespaces: {} - tenantID: "${AZURE_TENANT_ID}" - clientID: "${AZURE_CLIENT_ID}" - clientSecret: {"name":"${AZURE_CLUSTER_IDENTITY_SECRET_NAME}","namespace":"${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE}"} diff --git a/templates/flavors/aks-multi-tenancy/cluster-template.yaml b/templates/flavors/aks-multi-tenancy/cluster-template.yaml deleted file mode 100644 index 6427ab3b24b..00000000000 --- a/templates/flavors/aks-multi-tenancy/cluster-template.yaml +++ /dev/null @@ -1,138 +0,0 @@ ---- -# The Cluster object is the top level owner of all resources. -# It coordinates between the control plane and the infrastructure/machines. -apiVersion: cluster.x-k8s.io/v1beta1 -kind: Cluster -metadata: - name: ${CLUSTER_NAME} - namespace: default -spec: - clusterNetwork: - services: - cidrBlocks: - - 192.168.0.0/16 - controlPlaneRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedControlPlane - name: ${CLUSTER_NAME} - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedCluster - name: ${CLUSTER_NAME} ---- -# The control plane abstracts readiness and provisioning of an AKS cluster. -# Because AKS requires a default pool, this also requires a reference to the -# default machine pool. -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedControlPlane -metadata: - name: ${CLUSTER_NAME} -spec: - subscriptionID: ${AZURE_SUBSCRIPTION_ID} - resourceGroupName: "${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}}" - location: "${AZURE_LOCATION}" - sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} - version: "${KUBERNETES_VERSION}" - addonProfiles: - - name: "azurepolicy" - enabled: true ---- -# Due to the nature of managed Kubernetes and the control plane implementation, -# the infrastructure provider for AKS cluster is basically a no-op. -# It sets itself to ready as soon as it sees the control plane ready. -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedCluster -metadata: - name: ${CLUSTER_NAME} ---- -# We provision a default machine pool with no boostrap data (AKS will provide it). -# We specify an AzureManagedMachinePool as the infrastructure machine it, which -# will be reflected in Azure as VMSS node pools attached to an AKS cluster. -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: "agentpool0" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: ${WORKER_MACHINE_COUNT} - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: "${CLUSTER_NAME}" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedMachinePool - name: "agentpool0" - version: "${KUBERNETES_VERSION}" ---- -# The Azure-specific machine pool implementation drives the configuration of the -# VMSS instances backing the pool. -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedMachinePool -metadata: - name: "agentpool0" -spec: - mode: System - osDiskSizeGB: 30 - sku: "${AZURE_NODE_MACHINE_TYPE}" ---- -# Deploy a second agent pool with the same number of machines, but using potentially different infrastructure. -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: "agentpool1" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: ${WORKER_MACHINE_COUNT} - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: "${CLUSTER_NAME}" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedMachinePool - name: "agentpool1" - version: "${KUBERNETES_VERSION}" ---- -# The infrastructure backing the second pool will use the same VM sku, but a larger OS disk. -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedMachinePool -metadata: - name: "agentpool1" -spec: - mode: User - osDiskSizeGB: 40 - sku: "${AZURE_NODE_MACHINE_TYPE}" ---- -# Deploy a third agent pool with one machine in order to test a AzureManagedMachinePool with only required configuration -apiVersion: cluster.x-k8s.io/v1beta1 -kind: MachinePool -metadata: - name: "agentpool2" -spec: - clusterName: "${CLUSTER_NAME}" - replicas: 1 - template: - metadata: {} - spec: - bootstrap: - dataSecretName: "" - clusterName: "${CLUSTER_NAME}" - infrastructureRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureManagedMachinePool - name: "agentpool2" - version: "${KUBERNETES_VERSION}" ---- -# The infrastructure backing the third pool will use the same VM SKU, which is the only required configuration -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedMachinePool -metadata: - name: "agentpool2" -spec: - mode: User - sku: "${AZURE_NODE_MACHINE_TYPE}" diff --git a/templates/flavors/aks-multi-tenancy/kustomization.yaml b/templates/flavors/aks-multi-tenancy/kustomization.yaml deleted file mode 100644 index b9de811d10b..00000000000 --- a/templates/flavors/aks-multi-tenancy/kustomization.yaml +++ /dev/null @@ -1,6 +0,0 @@ -namespace: default -resources: - - cluster-template.yaml - - azure-cluster-identity.yaml -patchesStrategicMerge: - - patches/azurecluster-identity-ref.yaml diff --git a/templates/flavors/aks-multi-tenancy/patches/azurecluster-identity-ref.yaml b/templates/flavors/aks-multi-tenancy/patches/azurecluster-identity-ref.yaml deleted file mode 100644 index 295b6ff32cb..00000000000 --- a/templates/flavors/aks-multi-tenancy/patches/azurecluster-identity-ref.yaml +++ /dev/null @@ -1,12 +0,0 @@ ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureManagedControlPlane -metadata: - name: ${CLUSTER_NAME} -spec: - identityRef: - apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 - kind: AzureClusterIdentity - name: "${CLUSTER_IDENTITY_NAME}" - namespace: "${CLUSTER_IDENTITY_NAMESPACE}" - diff --git a/templates/test/ci/cluster-template-prow-aks-multi-tenancy.yaml b/templates/test/ci/cluster-template-prow-aks.yaml similarity index 98% rename from templates/test/ci/cluster-template-prow-aks-multi-tenancy.yaml rename to templates/test/ci/cluster-template-prow-aks.yaml index faa132b5824..6c65c125472 100644 --- a/templates/test/ci/cluster-template-prow-aks-multi-tenancy.yaml +++ b/templates/test/ci/cluster-template-prow-aks.yaml @@ -34,7 +34,6 @@ spec: apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 kind: AzureClusterIdentity name: ${CLUSTER_IDENTITY_NAME} - namespace: ${CLUSTER_IDENTITY_NAMESPACE} location: ${AZURE_LOCATION} resourceGroupName: ${AZURE_RESOURCE_GROUP:=${CLUSTER_NAME}} sshPublicKey: ${AZURE_SSH_PUBLIC_KEY_B64:=""} @@ -117,6 +116,22 @@ spec: key: type value: shared --- +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureClusterIdentity +metadata: + labels: + clusterctl.cluster.x-k8s.io/move-hierarchy: "true" + name: ${CLUSTER_IDENTITY_NAME} + namespace: default +spec: + allowedNamespaces: {} + clientID: ${AZURE_CLIENT_ID} + clientSecret: + name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME} + namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE} + tenantID: ${AZURE_TENANT_ID} + type: ServicePrincipal +--- apiVersion: cluster.x-k8s.io/v1beta1 kind: MachinePool metadata: @@ -145,17 +160,3 @@ metadata: spec: mode: User sku: ${AZURE_NODE_MACHINE_TYPE} ---- -apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 -kind: AzureClusterIdentity -metadata: - name: ${CLUSTER_IDENTITY_NAME} - namespace: default -spec: - allowedNamespaces: {} - clientID: ${AZURE_CLIENT_ID} - clientSecret: - name: ${AZURE_CLUSTER_IDENTITY_SECRET_NAME} - namespace: ${AZURE_CLUSTER_IDENTITY_SECRET_NAMESPACE} - tenantID: ${AZURE_TENANT_ID} - type: ServicePrincipal diff --git a/templates/test/ci/prow-aks-multi-tenancy/kustomization.yaml b/templates/test/ci/prow-aks/kustomization.yaml similarity index 71% rename from templates/test/ci/prow-aks-multi-tenancy/kustomization.yaml rename to templates/test/ci/prow-aks/kustomization.yaml index 8e88f9079e1..66aa7830ccf 100644 --- a/templates/test/ci/prow-aks-multi-tenancy/kustomization.yaml +++ b/templates/test/ci/prow-aks/kustomization.yaml @@ -2,8 +2,11 @@ apiVersion: kustomize.config.k8s.io/v1beta1 kind: Kustomization namespace: default resources: - - ../../../flavors/aks-multi-tenancy + - ../../../flavors/aks + - patches/aks-agentpool2.yaml patchesStrategicMerge: - ../patches/tags-aks.yaml - patches/aks-agentpool0.yaml - patches/aks-agentpool1.yaml + - patches/addons.yaml + diff --git a/templates/test/ci/prow-aks/patches/addons.yaml b/templates/test/ci/prow-aks/patches/addons.yaml new file mode 100644 index 00000000000..fb5f35239f6 --- /dev/null +++ b/templates/test/ci/prow-aks/patches/addons.yaml @@ -0,0 +1,9 @@ +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedControlPlane +metadata: + name: ${CLUSTER_NAME} + namespace: default +spec: + addonProfiles: + - enabled: true + name: azurepolicy diff --git a/templates/test/ci/prow-aks-multi-tenancy/patches/aks-agentpool0.yaml b/templates/test/ci/prow-aks/patches/aks-agentpool0.yaml similarity index 100% rename from templates/test/ci/prow-aks-multi-tenancy/patches/aks-agentpool0.yaml rename to templates/test/ci/prow-aks/patches/aks-agentpool0.yaml diff --git a/templates/test/ci/prow-aks-multi-tenancy/patches/aks-agentpool1.yaml b/templates/test/ci/prow-aks/patches/aks-agentpool1.yaml similarity index 100% rename from templates/test/ci/prow-aks-multi-tenancy/patches/aks-agentpool1.yaml rename to templates/test/ci/prow-aks/patches/aks-agentpool1.yaml diff --git a/templates/test/ci/prow-aks/patches/aks-agentpool2.yaml b/templates/test/ci/prow-aks/patches/aks-agentpool2.yaml new file mode 100644 index 00000000000..952076c6583 --- /dev/null +++ b/templates/test/ci/prow-aks/patches/aks-agentpool2.yaml @@ -0,0 +1,28 @@ +# Deploy a third agent pool with one machine in order to test a AzureManagedMachinePool with only required configuration +apiVersion: cluster.x-k8s.io/v1beta1 +kind: MachinePool +metadata: + name: "agentpool2" +spec: + clusterName: "${CLUSTER_NAME}" + replicas: 1 + template: + metadata: {} + spec: + bootstrap: + dataSecretName: "" + clusterName: "${CLUSTER_NAME}" + infrastructureRef: + apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 + kind: AzureManagedMachinePool + name: "agentpool2" + version: "${KUBERNETES_VERSION}" +--- +# The infrastructure backing the third pool will use the same VM SKU, which is the only required configuration +apiVersion: infrastructure.cluster.x-k8s.io/v1beta1 +kind: AzureManagedMachinePool +metadata: + name: "agentpool2" +spec: + mode: User + sku: "${AZURE_NODE_MACHINE_TYPE}" \ No newline at end of file diff --git a/test/e2e/azure_test.go b/test/e2e/azure_test.go index 7513e9c932b..7c03b2cfed5 100644 --- a/test/e2e/azure_test.go +++ b/test/e2e/azure_test.go @@ -475,7 +475,7 @@ var _ = Describe("Workload cluster creation", func() { ClusterctlConfigPath: clusterctlConfigPath, KubeconfigPath: bootstrapClusterProxy.GetKubeconfigPath(), InfrastructureProvider: clusterctl.DefaultInfrastructureProvider, - Flavor: "aks-multi-tenancy", + Flavor: "aks", Namespace: namespace.Name, ClusterName: clusterName, KubernetesVersion: kubernetesVersion, diff --git a/test/e2e/config/azure-dev.yaml b/test/e2e/config/azure-dev.yaml index b4b17108674..0423c7a7516 100644 --- a/test/e2e/config/azure-dev.yaml +++ b/test/e2e/config/azure-dev.yaml @@ -171,8 +171,8 @@ providers: targetName: "cluster-template-windows.yaml" - sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-external-cloud-provider.yaml" targetName: "cluster-template-external-cloud-provider.yaml" - - sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-aks-multi-tenancy.yaml" - targetName: "cluster-template-aks-multi-tenancy.yaml" + - sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-aks.yaml" + targetName: "cluster-template-aks.yaml" - sourcePath: "${PWD}/templates/test/ci/cluster-template-prow-custom-vnet.yaml" targetName: "cluster-template-custom-vnet.yaml" replacements: