-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: [CNI] Adding aks cluster creation steps for k8s e2e test (#2052)
* ci: [CNI] Adding aks cluster creation steps for k8s e2e test * Add validate step to the pipeline * Adding the telemetry config to the cluster (cherry picked from commit 846e508)
- Loading branch information
1 parent
030a54f
commit 5d2eae0
Showing
10 changed files
with
313 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
parameters: | ||
name: "" | ||
displayName: "" | ||
arch: "" | ||
os: "" | ||
clusterType: "" | ||
clusterName: "" | ||
k8sVersion: "" | ||
windowsOsSku: "" | ||
os_version: "" | ||
|
||
stages: | ||
- stage: ${{ parameters.name }} | ||
displayName: E2E - ${{ parameters.displayName }} | ||
dependsOn: | ||
- setup | ||
- publish | ||
jobs: | ||
- job: ${{ parameters.name }} | ||
displayName: Singletenancy AKS - (${{ parameters.name }}) | ||
pool: | ||
name: $(BUILD_POOL_NAME_DEFAULT) | ||
demands: | ||
- agent.os -equals Linux | ||
- Role -equals $(CUSTOM_E2E_ROLE) | ||
variables: | ||
GOPATH: "$(Agent.TempDirectory)/go" # Go workspace path | ||
GOBIN: "$(GOPATH)/bin" # Go binaries path | ||
modulePath: "$(GOPATH)/src/github.com/Azure/azure-container-networking" | ||
dropgzVersion: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.dropgzVersion'] ] | ||
cniVersion: $[ stagedependencies.setup.env.outputs['EnvironmentalVariables.cniVersion'] ] | ||
steps: | ||
- template: e2e-step-template.yaml | ||
parameters: | ||
name: ${{ parameters.name }} | ||
clusterType: ${{ parameters.clusterType }} | ||
clusterName: ${{ parameters.clusterName }} | ||
arch: ${{ parameters.arch }} | ||
os: ${{ parameters.os }} | ||
k8sVersion: ${{ parameters.k8sVersion }} | ||
windowsOsSku: ${{ parameters.windowsOsSku }} | ||
os_version: ${{ parameters.os_version }} | ||
version: $(dropgzVersion) | ||
cniVersion: $(cniVersion) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
parameters: | ||
name: "" | ||
clusterType: "" | ||
clusterName: "" | ||
nodeCount: "" | ||
vmSize: "" | ||
windowsVMSize: "" | ||
k8sVersion: "" | ||
version: "" | ||
os: "" | ||
windowsOsSku: "" | ||
cniVersion: "" | ||
os_version: "" | ||
|
||
steps: | ||
- bash: | | ||
go version | ||
go env | ||
mkdir -p '$(GOBIN)' | ||
mkdir -p '$(GOPATH)/pkg' | ||
mkdir -p '$(modulePath)' | ||
echo '##vso[task.prependpath]$(GOBIN)' | ||
echo '##vso[task.prependpath]$(GOROOT)/bin' | ||
name: "GoEnv" | ||
displayName: "Set up the Go environment" | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
mkdir -p ~/.kube/ | ||
echo "Create AKS cluster" | ||
echo "parameters ${{ parameters.windowsOsSku }}" | ||
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) | ||
make -C ./hack/aks ${{ parameters.clusterType }} AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision) K8S_VER=${{ parameters.k8sVersion }} WINDOWS_OS_SKU=${{ parameters.windowsOsSku }} WINDOWS_USERNAME=${WINDOWS_USERNAME} WINDOWS_PASSWORD=${WINDOWS_PASSWORD} | ||
echo "Cluster successfully created" | ||
displayName: Create test cluster | ||
- script: | | ||
echo "Upload CNI" | ||
if [ "${{parameters.os}}" == "windows" ]; then | ||
export DROP_GZ_URL=$( make cni-dropgz-test-image-name-and-tag OS='linux' ARCH=${{ parameters.arch }} CNI_DROPGZ_VERSION=${{ parameters.version }}) | ||
envsubst < ./test/integration/manifests/cni/cni-installer-v1.yaml | kubectl apply -f - | ||
kubectl rollout status daemonset/azure-cni -n kube-system | ||
export CNI_IMAGE=$(make cni-plugin-image-name-and-tag OS=${{ parameters.os }} ARCH=${{ parameters.arch }} OS_VERSION=${{ parameters.os_version }} CNI_VERSION=${{ parameters.cniVersion }}) | ||
envsubst < ./hack/manifests/windows-update.yaml | kubectl apply -f - | ||
kubectl rollout status daemonset/azure-cni-windows -n kube-system | ||
else | ||
export DROP_GZ_URL=$( make cni-dropgz-test-image-name-and-tag OS=${{ parameters.os }} ARCH=${{ parameters.arch }} CNI_DROPGZ_VERSION=${{ parameters.version }}) | ||
envsubst < ./test/integration/manifests/cni/cni-installer-v1.yaml | kubectl apply -f - | ||
kubectl rollout status daemonset/azure-cni -n kube-system | ||
fi | ||
name: "UploadCni" | ||
displayName: "Upload CNI" | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
clusterName=${{ parameters.clusterName }}-$(make revision) | ||
echo "Restarting nodes" | ||
for val in $(az vmss list -g MC_${clusterName}_${clusterName}_$(REGION_AKS_CLUSTER_TEST) --query "[].name" -o tsv); do | ||
make -C ./hack/aks restart-vmss AZCLI=az CLUSTER=${clusterName} REGION=$(REGION_AKS_CLUSTER_TEST) VMSS_NAME=${val} | ||
done | ||
displayName: "Restart Nodes" | ||
- script: | | ||
kubectl get pods -A -o wide | ||
echo "Deploying test pods" | ||
cd test/integration/load | ||
go test -count 1 -timeout 30m -tags load -run ^TestLoad$ -tags=load -iterations=2 -scaleup=40 -os=${{ parameters.os }} | ||
cd ../../.. | ||
# Remove this once we have cniv1 support for validating the test cluster | ||
echo "Validate State skipped for linux cniv1 for now" | ||
if [ "${{parameters.os}}" == "windows" ]; then | ||
make test-validate-state OS=${{ parameters.os }} | ||
fi | ||
displayName: "Validate State" | ||
retryCountOnTaskFailure: 3 | ||
- task: AzureCLI@1 | ||
inputs: | ||
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) | ||
scriptLocation: "inlineScript" | ||
scriptType: "bash" | ||
addSpnToEnvironment: true | ||
inlineScript: | | ||
echo "Skipping Deleting cluster" | ||
make -C ./hack/aks azcfg AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) | ||
make -C ./hack/aks down AZCLI=az REGION=$(REGION_AKS_CLUSTER_TEST) SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) CLUSTER=${{ parameters.clusterName }}-$(make revision) | ||
echo "Cluster and resources down" | ||
displayName: "Delete test cluster" | ||
condition: always() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.