From 0959a1e4858378cdf626a56866d16fe0d642e165 Mon Sep 17 00:00:00 2001 From: QxBytes Date: Wed, 19 Feb 2025 17:41:02 -0800 Subject: [PATCH 1/3] cleanup makefile --- .pipelines/cni/pipeline.yaml | 4 ++-- .../cni/singletenancy/cniv1-template.yaml | 1 + .pipelines/pipeline.yaml | 4 ++-- .../aks-swift/e2e-job-template.yaml | 2 ++ hack/aks/Makefile | 24 +++++-------------- hack/aks/README.md | 3 +-- 6 files changed, 14 insertions(+), 24 deletions(-) diff --git a/.pipelines/cni/pipeline.yaml b/.pipelines/cni/pipeline.yaml index 08e6474be4..941cc4cf1b 100644 --- a/.pipelines/cni/pipeline.yaml +++ b/.pipelines/cni/pipeline.yaml @@ -164,7 +164,7 @@ stages: - template: singletenancy/cniv1-template.yaml parameters: name: win22_cniv1 - clusterType: windows-cniv1-up + clusterType: cniv1-up clusterName: "win22-cniv1" nodeCount: ${NODE_COUNT_WINCLUSTER_SYSTEMPOOL} nodeCountWin: ${NODE_COUNT_WIN} @@ -229,7 +229,7 @@ stages: - template: singletenancy/cniv1-template.yaml parameters: name: linux_cniv1 - clusterType: linux-cniv1-up + clusterType: cniv1-up clusterName: "linux-cniv1" nodeCount: ${NODE_COUNT_LINUX} vmSize: ${VM_SIZE} diff --git a/.pipelines/cni/singletenancy/cniv1-template.yaml b/.pipelines/cni/singletenancy/cniv1-template.yaml index e8b9c3ff8c..0001402dbc 100644 --- a/.pipelines/cni/singletenancy/cniv1-template.yaml +++ b/.pipelines/cni/singletenancy/cniv1-template.yaml @@ -57,6 +57,7 @@ stages: vmSizeWin: ${{ parameters.vmSizeWin }} region: $(location) osSKU: ${{ parameters.osSKU }} + os: ${{ parameters.os }} # If ensures that only windows template calls are compared against the below condition # Condition confirms that: diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 9603020072..3ae62fe499 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -347,7 +347,7 @@ stages: displayName: AKS Ubuntu 22 arch: "amd64" os: "linux" - clusterType: linux-cniv1-up + clusterType: cniv1-up clusterName: "ubuntu22e2e" vmSize: Standard_B2s k8sVersion: 1.25 @@ -360,7 +360,7 @@ stages: displayName: AKS Windows 2022 arch: amd64 os: windows - clusterType: windows-cniv1-up + clusterType: cniv1-up clusterName: "win22e2e" vmSize: Standard_B2ms os_version: "ltsc2022" diff --git a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml index 126b56d766..64b612da45 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml @@ -5,6 +5,7 @@ parameters: clusterName: "" vmSize: "" k8sVersion: "" + os: "" dependsOn: "" stages: @@ -27,6 +28,7 @@ stages: vmSize: ${{ parameters.vmSize }} k8sVersion: ${{ parameters.k8sVersion }} dependsOn: ${{ parameters.dependsOn }} + os: ${{ parameters.os }} region: $(REGION_AKS_CLUSTER_TEST) - stage: ${{ parameters.name }} diff --git a/hack/aks/Makefile b/hack/aks/Makefile index 055bbc9e00..6228400b16 100644 --- a/hack/aks/Makefile +++ b/hack/aks/Makefile @@ -131,7 +131,6 @@ overlay-byocni-up: rg-up overlay-net-up ## Brings up a Linux Overlay BYO CNI clu --yes @$(MAKE) set-kubeconf ifeq ($(OS),windows) - AZCLI="az" GROUP="$(GROUP)" CLUSTER="$(CLUSTER)" sh ../scripts/wait-cluster-update.sh $(MAKE) windows-nodepool-up endif @@ -343,36 +342,25 @@ vnetscale-swift-up: rg-up vnetscale-swift-net-up ## Bring up a Vnet Scale SWIFT --yes @$(MAKE) set-kubeconf -windows-cniv1-up: rg-up overlay-net-up ## Bring up a Windows CNIv1 cluster +cniv1-up: rg-up overlay-net-up ## Bring up a CNIv1 cluster $(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \ --auto-upgrade-channel $(AUTOUPGRADE) \ --node-os-upgrade-channel $(NODEUPGRADE) \ --kubernetes-version $(K8S_VER) \ --node-count $(NODE_COUNT) \ --node-vm-size $(VM_SIZE) \ + --max-pods 250 \ --network-plugin azure \ --windows-admin-password $(WINDOWS_PASSWORD) \ --windows-admin-username $(WINDOWS_USERNAME) \ --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ - --no-ssh-key \ - --yes - @$(MAKE) windows-nodepool-up - @$(MAKE) set-kubeconf - -linux-cniv1-up: rg-up overlay-net-up ## Bring up a Linux CNIv1 cluster - $(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \ - --auto-upgrade-channel $(AUTOUPGRADE) \ - --node-os-upgrade-channel $(NODEUPGRADE) \ - --kubernetes-version $(K8S_VER) \ - --node-count $(NODE_COUNT) \ - --node-vm-size $(VM_SIZE) \ - --max-pods 250 \ - --network-plugin azure \ - --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ --os-sku $(OS_SKU) \ --no-ssh-key \ --yes @$(MAKE) set-kubeconf +ifeq ($(OS),windows) + $(MAKE) windows-nodepool-up +endif dualstack-overlay-up: rg-up overlay-net-up ## Brings up an dualstack Overlay cluster with Linux node only $(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \ @@ -406,7 +394,6 @@ dualstack-overlay-byocni-up: rg-up overlay-net-up ## Brings up an dualstack Over --yes @$(MAKE) set-kubeconf ifeq ($(OS),windows) - AZCLI="az" GROUP="$(GROUP)" CLUSTER="$(CLUSTER)" sh ../scripts/wait-cluster-update.sh $(MAKE) windows-nodepool-up endif @@ -445,6 +432,7 @@ dualstack-byocni-nokubeproxy-up: rg-up overlay-net-up ## Brings up a Dualstack o @$(MAKE) set-kubeconf windows-nodepool-up: ## Add windows node pool + AZCLI="az" GROUP="$(GROUP)" CLUSTER="$(CLUSTER)" sh ../scripts/wait-cluster-update.sh $(AZCLI) aks nodepool add -g $(GROUP) -n npwin \ --node-count $(NODE_COUNT_WIN) \ --node-vm-size $(VM_SIZE_WIN) \ diff --git a/hack/aks/README.md b/hack/aks/README.md index 0ff3ed4811..abe8bb7876 100644 --- a/hack/aks/README.md +++ b/hack/aks/README.md @@ -37,8 +37,7 @@ AKS Clusters vnetscale-swift-byocni-nokubeproxy-up Bring up a Vnet Scale SWIFT BYO CNI cluster without kube-proxy vnetscale-swift-cilium-up Bring up a Vnet Scale SWIFT Cilium cluster vnetscale-swift-up Bring up a Vnet Scale SWIFT AzCNI cluster - windows-cniv1-up Bring up a Windows AzCNIv1 cluster - linux-cniv1-up Bring up a Linux AzCNIv1 cluster + cniv1-up Bring up a AzCNIv1 cluster dualstack-overlay-byocni-up Bring up an dualstack overlay cluster without CNS and CNI installed cilium-dualstack-up Brings up a Cilium Dualstack Overlay cluster with Linux node only dualstack-byocni-nokubeproxy-up Brings up a Dualstack overlay BYOCNI cluster with Linux node only and no kube-proxy From cfee408b3db4b0b0ee04f849a93d878501b047fa Mon Sep 17 00:00:00 2001 From: QxBytes Date: Wed, 19 Feb 2025 17:48:03 -0800 Subject: [PATCH 2/3] remove windows user and password from cniv1 cluster --- .../cni/load-test-templates/create-cluster-template.yaml | 1 - .pipelines/templates/create-cluster.yaml | 3 +-- hack/aks/Makefile | 2 -- 3 files changed, 1 insertion(+), 5 deletions(-) diff --git a/.pipelines/cni/load-test-templates/create-cluster-template.yaml b/.pipelines/cni/load-test-templates/create-cluster-template.yaml index 006f2bc32d..bcdce8f643 100644 --- a/.pipelines/cni/load-test-templates/create-cluster-template.yaml +++ b/.pipelines/cni/load-test-templates/create-cluster-template.yaml @@ -23,7 +23,6 @@ steps: AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \ CLUSTER=${{ parameters.clusterName }} NODE_COUNT=${{ parameters.nodeCount }} NODE_COUNT_WIN=${{ parameters.nodeCountWin }} \ VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \ - WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} \ OS_SKU=${{ parameters.osSKU }} OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{ parameters.os }} echo "Cluster successfully created" diff --git a/.pipelines/templates/create-cluster.yaml b/.pipelines/templates/create-cluster.yaml index 534c486a2d..61df0f0c88 100644 --- a/.pipelines/templates/create-cluster.yaml +++ b/.pipelines/templates/create-cluster.yaml @@ -38,8 +38,7 @@ jobs: AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \ CLUSTER=${{ parameters.clusterName }} \ VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \ - OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{parameters.os}} \ - WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} + OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{parameters.os}} echo "Cluster successfully created" displayName: Cluster - ${{ parameters.clusterType }} diff --git a/hack/aks/Makefile b/hack/aks/Makefile index 6228400b16..7f4513cae2 100644 --- a/hack/aks/Makefile +++ b/hack/aks/Makefile @@ -351,8 +351,6 @@ cniv1-up: rg-up overlay-net-up ## Bring up a CNIv1 cluster --node-vm-size $(VM_SIZE) \ --max-pods 250 \ --network-plugin azure \ - --windows-admin-password $(WINDOWS_PASSWORD) \ - --windows-admin-username $(WINDOWS_USERNAME) \ --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ --os-sku $(OS_SKU) \ --no-ssh-key \ From bf07aa968f8f6d7d8e1cfae8b8422af2b74451e7 Mon Sep 17 00:00:00 2001 From: QxBytes Date: Thu, 20 Feb 2025 08:10:04 -0800 Subject: [PATCH 3/3] fix windows variable not propagating --- .pipelines/pipeline.yaml | 2 +- .pipelines/singletenancy/aks/e2e-job-template.yaml | 1 + .pipelines/templates/create-cluster.yaml | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.pipelines/pipeline.yaml b/.pipelines/pipeline.yaml index 3ae62fe499..2303749772 100644 --- a/.pipelines/pipeline.yaml +++ b/.pipelines/pipeline.yaml @@ -359,7 +359,7 @@ stages: name: "aks_windows_22_e2e" displayName: AKS Windows 2022 arch: amd64 - os: windows + os: "windows" clusterType: cniv1-up clusterName: "win22e2e" vmSize: Standard_B2ms diff --git a/.pipelines/singletenancy/aks/e2e-job-template.yaml b/.pipelines/singletenancy/aks/e2e-job-template.yaml index 56690db446..5a8c3c28b5 100644 --- a/.pipelines/singletenancy/aks/e2e-job-template.yaml +++ b/.pipelines/singletenancy/aks/e2e-job-template.yaml @@ -32,6 +32,7 @@ stages: vmSizeWin: ${{ parameters.vmSize }} # Matching linux vmSize k8sVersion: ${{ parameters.k8sVersion }} dependsOn: ${{ parameters.dependsOn }} + os: ${{ parameters.os }} region: $(REGION_AKS_CLUSTER_TEST) - stage: ${{ parameters.name }} diff --git a/.pipelines/templates/create-cluster.yaml b/.pipelines/templates/create-cluster.yaml index 61df0f0c88..4d4e106568 100644 --- a/.pipelines/templates/create-cluster.yaml +++ b/.pipelines/templates/create-cluster.yaml @@ -38,7 +38,7 @@ jobs: AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \ CLUSTER=${{ parameters.clusterName }} \ VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \ - OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{parameters.os}} + OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{ parameters.os }} echo "Cluster successfully created" displayName: Cluster - ${{ parameters.clusterType }}