Skip to content

Commit 9d3d3b7

Browse files
authored
ci: unify windows and linux cluster creation methods (#3436)
* cleanup makefile * remove windows user and password from cniv1 cluster * fix windows variable not propagating
1 parent c0bacc1 commit 9d3d3b7

File tree

9 files changed

+16
-29
lines changed

9 files changed

+16
-29
lines changed

.pipelines/cni/load-test-templates/create-cluster-template.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ steps:
2323
AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \
2424
CLUSTER=${{ parameters.clusterName }} NODE_COUNT=${{ parameters.nodeCount }} NODE_COUNT_WIN=${{ parameters.nodeCountWin }} \
2525
VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \
26-
WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} \
2726
OS_SKU=${{ parameters.osSKU }} OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{ parameters.os }}
2827
echo "Cluster successfully created"
2928

.pipelines/cni/pipeline.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ stages:
164164
- template: singletenancy/cniv1-template.yaml
165165
parameters:
166166
name: win22_cniv1
167-
clusterType: windows-cniv1-up
167+
clusterType: cniv1-up
168168
clusterName: "win22-cniv1"
169169
nodeCount: ${NODE_COUNT_WINCLUSTER_SYSTEMPOOL}
170170
nodeCountWin: ${NODE_COUNT_WIN}
@@ -229,7 +229,7 @@ stages:
229229
- template: singletenancy/cniv1-template.yaml
230230
parameters:
231231
name: linux_cniv1
232-
clusterType: linux-cniv1-up
232+
clusterType: cniv1-up
233233
clusterName: "linux-cniv1"
234234
nodeCount: ${NODE_COUNT_LINUX}
235235
vmSize: ${VM_SIZE}

.pipelines/cni/singletenancy/cniv1-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ stages:
5757
vmSizeWin: ${{ parameters.vmSizeWin }}
5858
region: $(location)
5959
osSKU: ${{ parameters.osSKU }}
60+
os: ${{ parameters.os }}
6061

6162
# If ensures that only windows template calls are compared against the below condition
6263
# Condition confirms that:

.pipelines/pipeline.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ stages:
347347
displayName: AKS Ubuntu 22
348348
arch: "amd64"
349349
os: "linux"
350-
clusterType: linux-cniv1-up
350+
clusterType: cniv1-up
351351
clusterName: "ubuntu22e2e"
352352
vmSize: Standard_B2s
353353
k8sVersion: 1.25
@@ -359,8 +359,8 @@ stages:
359359
name: "aks_windows_22_e2e"
360360
displayName: AKS Windows 2022
361361
arch: amd64
362-
os: windows
363-
clusterType: windows-cniv1-up
362+
os: "windows"
363+
clusterType: cniv1-up
364364
clusterName: "win22e2e"
365365
vmSize: Standard_B2ms
366366
os_version: "ltsc2022"

.pipelines/singletenancy/aks-swift/e2e-job-template.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ parameters:
55
clusterName: ""
66
vmSize: ""
77
k8sVersion: ""
8+
os: ""
89
dependsOn: ""
910

1011
stages:
@@ -27,6 +28,7 @@ stages:
2728
vmSize: ${{ parameters.vmSize }}
2829
k8sVersion: ${{ parameters.k8sVersion }}
2930
dependsOn: ${{ parameters.dependsOn }}
31+
os: ${{ parameters.os }}
3032
region: $(REGION_AKS_CLUSTER_TEST)
3133

3234
- stage: ${{ parameters.name }}

.pipelines/singletenancy/aks/e2e-job-template.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ stages:
3232
vmSizeWin: ${{ parameters.vmSize }} # Matching linux vmSize
3333
k8sVersion: ${{ parameters.k8sVersion }}
3434
dependsOn: ${{ parameters.dependsOn }}
35+
os: ${{ parameters.os }}
3536
region: $(REGION_AKS_CLUSTER_TEST)
3637

3738
- stage: ${{ parameters.name }}

.pipelines/templates/create-cluster.yaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ jobs:
3838
AZCLI=az REGION=${{ parameters.region }} SUB=$(SUB_AZURE_NETWORK_AGENT_BUILD_VALIDATIONS) \
3939
CLUSTER=${{ parameters.clusterName }} \
4040
VM_SIZE=${{ parameters.vmSize }} VM_SIZE_WIN=${{ parameters.vmSizeWin }} \
41-
OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{parameters.os}} \
42-
WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD}
41+
OS_SKU_WIN=${{ parameters.osSkuWin }} OS=${{ parameters.os }}
4342
4443
echo "Cluster successfully created"
4544
displayName: Cluster - ${{ parameters.clusterType }}

hack/aks/Makefile

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,6 @@ overlay-byocni-up: rg-up overlay-net-up ## Brings up a Linux Overlay BYO CNI clu
131131
--yes
132132
@$(MAKE) set-kubeconf
133133
ifeq ($(OS),windows)
134-
AZCLI="az" GROUP="$(GROUP)" CLUSTER="$(CLUSTER)" sh ../scripts/wait-cluster-update.sh
135134
$(MAKE) windows-nodepool-up
136135
endif
137136

@@ -343,23 +342,7 @@ vnetscale-swift-up: rg-up vnetscale-swift-net-up ## Bring up a Vnet Scale SWIFT
343342
--yes
344343
@$(MAKE) set-kubeconf
345344

346-
windows-cniv1-up: rg-up overlay-net-up ## Bring up a Windows CNIv1 cluster
347-
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
348-
--auto-upgrade-channel $(AUTOUPGRADE) \
349-
--node-os-upgrade-channel $(NODEUPGRADE) \
350-
--kubernetes-version $(K8S_VER) \
351-
--node-count $(NODE_COUNT) \
352-
--node-vm-size $(VM_SIZE) \
353-
--network-plugin azure \
354-
--windows-admin-password $(WINDOWS_PASSWORD) \
355-
--windows-admin-username $(WINDOWS_USERNAME) \
356-
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
357-
--no-ssh-key \
358-
--yes
359-
@$(MAKE) windows-nodepool-up
360-
@$(MAKE) set-kubeconf
361-
362-
linux-cniv1-up: rg-up overlay-net-up ## Bring up a Linux CNIv1 cluster
345+
cniv1-up: rg-up overlay-net-up ## Bring up a CNIv1 cluster
363346
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
364347
--auto-upgrade-channel $(AUTOUPGRADE) \
365348
--node-os-upgrade-channel $(NODEUPGRADE) \
@@ -373,6 +356,9 @@ linux-cniv1-up: rg-up overlay-net-up ## Bring up a Linux CNIv1 cluster
373356
--no-ssh-key \
374357
--yes
375358
@$(MAKE) set-kubeconf
359+
ifeq ($(OS),windows)
360+
$(MAKE) windows-nodepool-up
361+
endif
376362

377363
dualstack-overlay-up: rg-up overlay-net-up ## Brings up an dualstack Overlay cluster with Linux node only
378364
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
@@ -406,7 +392,6 @@ dualstack-overlay-byocni-up: rg-up overlay-net-up ## Brings up an dualstack Over
406392
--yes
407393
@$(MAKE) set-kubeconf
408394
ifeq ($(OS),windows)
409-
AZCLI="az" GROUP="$(GROUP)" CLUSTER="$(CLUSTER)" sh ../scripts/wait-cluster-update.sh
410395
$(MAKE) windows-nodepool-up
411396
endif
412397

@@ -445,6 +430,7 @@ dualstack-byocni-nokubeproxy-up: rg-up overlay-net-up ## Brings up a Dualstack o
445430
@$(MAKE) set-kubeconf
446431

447432
windows-nodepool-up: ## Add windows node pool
433+
AZCLI="az" GROUP="$(GROUP)" CLUSTER="$(CLUSTER)" sh ../scripts/wait-cluster-update.sh
448434
$(AZCLI) aks nodepool add -g $(GROUP) -n npwin \
449435
--node-count $(NODE_COUNT_WIN) \
450436
--node-vm-size $(VM_SIZE_WIN) \

hack/aks/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,7 @@ AKS Clusters
3737
vnetscale-swift-byocni-nokubeproxy-up Bring up a Vnet Scale SWIFT BYO CNI cluster without kube-proxy
3838
vnetscale-swift-cilium-up Bring up a Vnet Scale SWIFT Cilium cluster
3939
vnetscale-swift-up Bring up a Vnet Scale SWIFT AzCNI cluster
40-
windows-cniv1-up Bring up a Windows AzCNIv1 cluster
41-
linux-cniv1-up Bring up a Linux AzCNIv1 cluster
40+
cniv1-up Bring up a AzCNIv1 cluster
4241
dualstack-overlay-byocni-up Bring up an dualstack overlay cluster without CNS and CNI installed
4342
cilium-dualstack-up Brings up a Cilium Dualstack Overlay cluster with Linux node only
4443
dualstack-byocni-nokubeproxy-up Brings up a Dualstack overlay BYOCNI cluster with Linux node only and no kube-proxy

0 commit comments

Comments
 (0)