-
Notifications
You must be signed in to change notification settings - Fork 242
/
Copy pathwindows-cni-load-test-template.yaml
163 lines (162 loc) · 5.62 KB
/
windows-cni-load-test-template.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
parameters:
dependsOn: ""
name: ""
clusterType: ""
clusterName: ""
nodeCount: ""
vmSize: ""
windowsVMSize: ""
os: ""
cni: ""
stages:
- stage: createAKSclusterWindows
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
dependsOn: ${{ parameters.dependsOn }}
displayName: "Windows AKS Cluster ${{ parameters.cni }}"
jobs:
- job: create_aks_cluster_with_${{ parameters.name }}
steps:
- template: ../load-test-templates/create-cluster-template.yaml
parameters:
clusterType: ${{ parameters.clusterType }}
clusterName: ${{ parameters.clusterName }}
nodeCount: ${{ parameters.nodeCount }}
vmSize: ${{ parameters.vmSize }}
windowsVMSize: ${{ parameters.windowsVMSize }}
- stage: build_images
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
dependsOn: ${{ parameters.dependsOn }}
displayName: "Build CNI Images"
jobs:
- job: build_cni_images
pool:
name: "$(BUILD_POOL_NAME_LINUX_AMD64)"
strategy:
matrix:
windows_cniv1_amd64:
os: windows
name: cni-plugin
arch: amd64
os_version: ltsc2022
steps:
- template: ../../containers/container-template.yaml
parameters:
arch: $(arch)
name: $(name)
os: $(os)
os_version: $(os_version)
- stage: update_cni
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
dependsOn:
- createAKSclusterWindows
- build_images
displayName: "Update CNI on Cluster"
jobs:
- job: deploy_pods
strategy:
matrix:
windows_cniv1_amd64:
os: windows
arch: amd64
os_version: ltsc2022
steps:
- task: AzureCLI@1
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
addSpnToEnvironment: true
inlineScript: |
set -ex
export CNI_IMAGE=$(make cni-plugin-image-name-and-tag OS=$(os) ARCH=$(arch) OS_VERSION=$(os_version))
az extension add --name aks-preview
clusterName=${{ parameters.clusterName }}-$(make revision)
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${clusterName}
make -C ./hack/aks azcfg AZCLI=az REGION=$(LOCATION)
envsubst < ./hack/manifests/windows-update.yaml | kubectl apply -f -
name: "UploadCNI"
displayName: "Upload CNI"
- script: |
set -ex
kubectl rollout status daemonset/azure-cni-windows -n kube-system
kubectl get pods -A
name: "WaitForCNI"
displayName: "Wait For CNI"
- stage: datapath_tests
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
dependsOn: update_cni
displayName: "Datapath Test - Windows"
jobs:
- template: ../k8s-e2e/k8s-e2e-job-template.yaml
parameters:
sub: $(TEST_SUB_SERVICE_CONNECTION)
clusterName: ${{ parameters.clusterName }}
os: ${{ parameters.os }}
datapath: true
dns: true
portforward: true
hybridWin: true
service: true
hostport: true
- stage: pod_deployment_windows
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
dependsOn: datapath_tests
displayName: "Pod Deployment"
jobs:
- job: deploy_pods
steps:
- template: ../load-test-templates/pod-deployment-template.yaml
parameters:
clusterName: ${{ parameters.clusterName }}
scaleup: ${WINDOWS_SCALEUP}
os: ${{ parameters.os }}
cni: ${{ parameters.cni }}
iterations: ${WINDOWS_ITERATIONS}
- stage: validate_state_windows
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
dependsOn: pod_deployment_windows
displayName: "Validate State"
jobs:
- job: validate_state
steps:
- template: ../load-test-templates/validate-state-template.yaml
parameters:
clusterName: ${{ parameters.clusterName }}
os: ${{ parameters.os }}
cni: ${{ parameters.cni }}
- stage: delete_resources
pool:
name: $(BUILD_POOL_NAME_DEFAULT)
displayName: "Delete Resources"
dependsOn:
- validate_state_windows
jobs:
- job: delete_resources
steps:
- task: AzureCLI@1
inputs:
azureSubscription: $(TEST_SUB_SERVICE_CONNECTION)
scriptLocation: "inlineScript"
scriptType: "bash"
addSpnToEnvironment: true
inlineScript: |
set -ex
if [ "$(DELETE_RESOURCES)" ]
then
echo "Deleting Cluster and resource group"
make -C ./hack/aks set-kubeconf AZCLI=az CLUSTER=${{ parameters.clusterName }}-$(make revision)
make -C ./hack/aks azcfg AZCLI=az REGION=$(LOCATION)
make -C ./hack/aks down AZCLI=az REGION=$(LOCATION) SUB=$(SUBSCRIPTION_ID) CLUSTER=${{ parameters.clusterName }}-$(make revision)
echo "Cluster and resources down"
else
echo "Deletion of resources is False"
fi
name: "CleanUpCluster"
displayName: "Cleanup cluster"
condition: always()