diff --git a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml index 79057bb764..3fbaeb59af 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-job-template.yaml @@ -6,7 +6,6 @@ parameters: stages: - stage: ${{ parameters.name }} displayName: E2E - ${{ parameters.displayName }} - lockBehavior: sequential dependsOn: - setup - publish diff --git a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml index 931a588a28..202b9e8b82 100644 --- a/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml +++ b/.pipelines/singletenancy/aks-swift/e2e-step-template.yaml @@ -26,18 +26,17 @@ steps: - task: AzureCLI@1 inputs: - azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION) + azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION) scriptLocation: "inlineScript" + scriptType: "bash" addSpnToEnvironment: true inlineScript: | mkdir -p ~/.kube/ - echo "DNC Underlay config" - az keyvault secret show --name $(KV_DNC_UNDERLAY_SECRET_NAME) --vault-name $(KV_NAME) --query value | sed 's/\\n/\n/g' | sed -e 's/^"//' -e 's/"$//' - az keyvault secret show --name $(KV_DNC_UNDERLAY_SECRET_NAME) --vault-name $(KV_NAME) --query value | sed 's/\\n/\n/g' | sed -e 's/^"//' -e 's/"$//' > ~/.kube/dnc-underlay - echo "Dirty ACN ccp config" - az keyvault secret show --name $(KV_AKS_SWIFT_CX_SECRET_NAME) --vault-name $(KV_NAME) --query value | sed 's/\\n/\n/g' | sed -e 's/^"//' -e 's/"$//' - az keyvault secret show --name $(KV_AKS_SWIFT_CX_SECRET_NAME) --vault-name $(KV_NAME) --query value | sed 's/\\n/\n/g' | sed -e 's/^"//' -e 's/"$//' > ~/.kube/config - displayName: Pull Kubeconfig from Keyvault + echo "Create AKS cluster" + make -C ./hack/swift azcfg AZCLI=az + make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) + echo "Cluster successfully created" + displayName: Create test cluster condition: succeeded() - script: | @@ -60,10 +59,6 @@ steps: sudo rm -rf $ARTIFACT_DIR sudo mkdir $ARTIFACT_DIR sudo cp test/integration/logs/* $ARTIFACT_DIR - export KUBECONFIG=~/.kube/dnc-underlay - kubectl logs -n $STABLE_DNC_NAMESPACE -l app=dnc --tail -1 -c dnc --prefix > dnc-logs.txt - kubectl logs -n $STABLE_DNC_NAMESPACE -l app=dnc --tail -1 -c requestcontroller --prefix > dnc-rc-logs.txt - sudo cp *.txt $ARTIFACT_DIR name: "GetLogs" displayName: "Get logs" condition: always() @@ -82,3 +77,18 @@ steps: name: "Cleanupartifactdir" displayName: "Cleanup artifact dir" condition: always() + + - task: AzureCLI@2 + inputs: + azureSubscription: "Azure Container Networking - Test" + scriptLocation: "inlineScript" + scriptType: "bash" + addSpnToEnvironment: true + inlineScript: | + echo "Deleting cluster" + make -C ./hack/swift azcfg AZCLI=az + make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision) + echo "Cluster and resources down" + name: "Cleanupcluster" + displayName: "Cleanup cluster" + condition: always() diff --git a/Makefile b/Makefile index 19f809131d..bdb2da489b 100644 --- a/Makefile +++ b/Makefile @@ -89,7 +89,8 @@ CNS_IMAGE_INFO_FILE = azure-cns-$(VERSION).txt CNM_PLUGIN_IMAGE ?= microsoft/azure-vnet-plugin CNM_PLUGIN_ROOTFS = azure-vnet-plugin-rootfs -VERSION ?= $(shell git describe --exclude "zapai*" --tags --always --dirty) +REVISION ?= $(shell git rev-parse --short HEAD) +VERSION ?= $(shell git describe --exclude "zapai*" --tags --always --dirty) # Default target all-binaries-platforms: ## Make all platform binaries @@ -558,6 +559,9 @@ install-hooks: $(REPO_ROOT)/.git/hooks/pre-push ## installs git hooks setup: tools install-hooks ## performs common required repo setup +revision: ## print the current git revision + @echo $(REVISION) + version: ## prints the version @echo $(VERSION) diff --git a/hack/swift/Makefile b/hack/swift/Makefile index 24da0ac3be..f599e3f1b7 100644 --- a/hack/swift/Makefile +++ b/hack/swift/Makefile @@ -5,7 +5,7 @@ KUBECFG = $(HOME)/.kube SSH = $(HOME)/.ssh AZCFG = $(HOME)/.azure AZIMG = mcr.microsoft.com/azure-cli -AZCLI = docker run -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh $(AZIMG) az +AZCLI ?= docker run -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh $(AZIMG) az # overrideable variables USER ?= $(whoami) @@ -25,10 +25,9 @@ help: ## Display this help azlogin: @$(AZCLI) login + @$(AZCLI) account set -s $(SUB) azcfg: - @$(AZCLI) account set -s $(SUB) - @$(AZCLI) group create --location $(REGION) --name $(GROUP) @$(AZCLI) extension add --name aks-preview --yes set-kubeconf: ## Adds the kubeconf for $CLUSTER @@ -52,17 +51,21 @@ vars: ## Show the env vars configured for the swift command @echo VNET=$(VNET) @echo CLUSTER=$(CLUSTER) -swift-net-up: azcfg ## Create required swift vnet/subnets +rg-up: ## Create resource group $GROUP in $SUB/$REGION + @$(AZCLI) group create --location $(REGION) --name $(GROUP) + +rg-down: ## Delete the $GROUP in $SUB/$REGION + $(AZCLI) group delete -g $(GROUP) --yes + +net-up: ## Create required swift vnet/subnets $(AZCLI) network vnet create -g $(GROUP) -l $(REGION) --name $(VNET) --address-prefixes 10.0.0.0/8 -o none $(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name nodenet --address-prefixes 10.240.0.0/16 -o none $(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name podnet --address-prefixes 10.241.0.0/16 -o none -rg-down: azcfg ## Delete the $GROUP in $SUB/$REGION - $(AZCLI) group delete -g $(GROUP) --yes ##@ AKS Clusters -swift-up: azcfg swift-net-up ## Brings up a swift cluster $name in $SUB/$REGION +swift-up: rg-up net-up ## Brings up a swift cluster $name in $SUB/$REGION $(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \ --max-pods 250 \ --node-count 3 \ @@ -72,17 +75,18 @@ swift-up: azcfg swift-net-up ## Brings up a swift cluster $name in $SUB/$REGION --yes @$(MAKE) set-kubeconf -byocni-up: azcfg swift-net-up ## Brings up a swift cluster $name in $SUB/$REGION +byocni-up: rg-up net-up ## Brings up a swift cluster $name in $SUB/$REGION $(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \ --max-pods 250 \ --node-count 3 \ --network-plugin none \ --vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \ --pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \ + --generate-ssh-keys \ --yes @$(MAKE) set-kubeconf -down: azcfg ## Deletes the swift resources $SUB/$REGION +down: ## Deletes the swift resources $SUB/$REGION $(AZCLI) aks delete -g $(GROUP) -n $(CLUSTER) --yes @$(MAKE) unset-kubeconf - @$(MAKE) swift-rg-down + @$(MAKE) rg-down diff --git a/test/integration/manifests/cni/manager.yaml b/test/integration/manifests/cni/manager.yaml index 5db6dddf9d..9aea779af0 100644 --- a/test/integration/manifests/cni/manager.yaml +++ b/test/integration/manifests/cni/manager.yaml @@ -16,10 +16,13 @@ spec: - effect: NoSchedule key: node-role.kubernetes.io/master operator: Exists + - effect: NoSchedule + key: node.kubernetes.io/not-ready + operator: Exists hostNetwork: true containers: - name: azure-cni-installer - image: acnpublic.azurecr.io/acncli:v1.2.8-32-g77506640 + image: acnpublic.azurecr.io/acncli:v1.4.28-42-gd086cf1b command: ["./acn"] args: ["cni", "manager", "--follow", "--mode", "transparent", "--ipam", "azure-cns"] imagePullPolicy: Always diff --git a/test/integration/manifests/cns/daemonset.yaml b/test/integration/manifests/cns/daemonset.yaml index 5c426e8175..f6b31d7b0b 100644 --- a/test/integration/manifests/cns/daemonset.yaml +++ b/test/integration/manifests/cns/daemonset.yaml @@ -41,7 +41,7 @@ spec: effect: NoSchedule containers: - name: cns-container - image: acnpublic.azurecr.io/azure-cns:v1.2.8 + image: acnpublic.azurecr.io/azure-cns:v1.4.29 imagePullPolicy: IfNotPresent args: [ "-c", "tcp://$(CNSIpAddress):$(CNSPort)", "-t", "$(CNSLogTarget)"] volumeMounts: