Skip to content

Commit b58dc70

Browse files
camrynlrbtr
andauthored
Update Swift pipeline w byo cluster (#1475)
* byo cluster pipeline update * adding sub var * use build validations sub * test Signed-off-by: GitHub <[email protected]> * use native azcli * test /usr/bin/az * login and set sub * testing * try upgrade cli * try upgrade azcli 2 * testing * testing * test svc conn * test svc conn * test svc conn * test svc conn * test svc conn * test svc conn * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * testing * fix rg-down * testing * testing * testing * testing * testing * testing * testing * update ds * testing * build imgs * test * uncomment pipeline * remove debug * pipeline update * review fixes * update svc conn * testing Co-authored-by: Camryn Lee <[email protected]> Co-authored-by: Evan Baker <[email protected]>
1 parent 9dc679e commit b58dc70

File tree

6 files changed

+46
-26
lines changed

6 files changed

+46
-26
lines changed

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ parameters:
66
stages:
77
- stage: ${{ parameters.name }}
88
displayName: E2E - ${{ parameters.displayName }}
9-
lockBehavior: sequential
109
dependsOn:
1110
- setup
1211
- publish

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

Lines changed: 22 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,17 @@ steps:
2626
2727
- task: AzureCLI@1
2828
inputs:
29-
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)
29+
azureSubscription: $(AZURE_TEST_AGENT_SERVICE_CONNECTION)
3030
scriptLocation: "inlineScript"
31+
scriptType: "bash"
3132
addSpnToEnvironment: true
3233
inlineScript: |
3334
mkdir -p ~/.kube/
34-
echo "DNC Underlay config"
35-
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/"$//'
36-
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
37-
echo "Dirty ACN ccp config"
38-
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/"$//'
39-
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
40-
displayName: Pull Kubeconfig from Keyvault
35+
echo "Create AKS cluster"
36+
make -C ./hack/swift azcfg AZCLI=az
37+
make -C ./hack/swift byocni-up SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision)
38+
echo "Cluster successfully created"
39+
displayName: Create test cluster
4140
condition: succeeded()
4241

4342
- script: |
@@ -60,10 +59,6 @@ steps:
6059
sudo rm -rf $ARTIFACT_DIR
6160
sudo mkdir $ARTIFACT_DIR
6261
sudo cp test/integration/logs/* $ARTIFACT_DIR
63-
export KUBECONFIG=~/.kube/dnc-underlay
64-
kubectl logs -n $STABLE_DNC_NAMESPACE -l app=dnc --tail -1 -c dnc --prefix > dnc-logs.txt
65-
kubectl logs -n $STABLE_DNC_NAMESPACE -l app=dnc --tail -1 -c requestcontroller --prefix > dnc-rc-logs.txt
66-
sudo cp *.txt $ARTIFACT_DIR
6762
name: "GetLogs"
6863
displayName: "Get logs"
6964
condition: always()
@@ -82,3 +77,18 @@ steps:
8277
name: "Cleanupartifactdir"
8378
displayName: "Cleanup artifact dir"
8479
condition: always()
80+
81+
- task: AzureCLI@2
82+
inputs:
83+
azureSubscription: "Azure Container Networking - Test"
84+
scriptLocation: "inlineScript"
85+
scriptType: "bash"
86+
addSpnToEnvironment: true
87+
inlineScript: |
88+
echo "Deleting cluster"
89+
make -C ./hack/swift azcfg AZCLI=az
90+
make -C ./hack/swift down SUB=$(SUB_AZURE_NETWORK_AGENT_TEST) AZCLI=az CLUSTER=swifte2e-$(make revision)
91+
echo "Cluster and resources down"
92+
name: "Cleanupcluster"
93+
displayName: "Cleanup cluster"
94+
condition: always()

Makefile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ CNS_IMAGE_INFO_FILE = azure-cns-$(VERSION).txt
8989
CNM_PLUGIN_IMAGE ?= microsoft/azure-vnet-plugin
9090
CNM_PLUGIN_ROOTFS = azure-vnet-plugin-rootfs
9191

92-
VERSION ?= $(shell git describe --exclude "zapai*" --tags --always --dirty)
92+
REVISION ?= $(shell git rev-parse --short HEAD)
93+
VERSION ?= $(shell git describe --exclude "zapai*" --tags --always --dirty)
9394

9495
# Default target
9596
all-binaries-platforms: ## Make all platform binaries
@@ -558,6 +559,9 @@ install-hooks: $(REPO_ROOT)/.git/hooks/pre-push ## installs git hooks
558559

559560
setup: tools install-hooks ## performs common required repo setup
560561

562+
revision: ## print the current git revision
563+
@echo $(REVISION)
564+
561565
version: ## prints the version
562566
@echo $(VERSION)
563567

hack/swift/Makefile

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ KUBECFG = $(HOME)/.kube
55
SSH = $(HOME)/.ssh
66
AZCFG = $(HOME)/.azure
77
AZIMG = mcr.microsoft.com/azure-cli
8-
AZCLI = docker run -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh $(AZIMG) az
8+
AZCLI ?= docker run -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh $(AZIMG) az
99

1010
# overrideable variables
1111
USER ?= $(whoami)
@@ -25,10 +25,9 @@ help: ## Display this help
2525

2626
azlogin:
2727
@$(AZCLI) login
28+
@$(AZCLI) account set -s $(SUB)
2829

2930
azcfg:
30-
@$(AZCLI) account set -s $(SUB)
31-
@$(AZCLI) group create --location $(REGION) --name $(GROUP)
3231
@$(AZCLI) extension add --name aks-preview --yes
3332

3433
set-kubeconf: ## Adds the kubeconf for $CLUSTER
@@ -52,17 +51,21 @@ vars: ## Show the env vars configured for the swift command
5251
@echo VNET=$(VNET)
5352
@echo CLUSTER=$(CLUSTER)
5453

55-
swift-net-up: azcfg ## Create required swift vnet/subnets
54+
rg-up: ## Create resource group $GROUP in $SUB/$REGION
55+
@$(AZCLI) group create --location $(REGION) --name $(GROUP)
56+
57+
rg-down: ## Delete the $GROUP in $SUB/$REGION
58+
$(AZCLI) group delete -g $(GROUP) --yes
59+
60+
net-up: ## Create required swift vnet/subnets
5661
$(AZCLI) network vnet create -g $(GROUP) -l $(REGION) --name $(VNET) --address-prefixes 10.0.0.0/8 -o none
5762
$(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name nodenet --address-prefixes 10.240.0.0/16 -o none
5863
$(AZCLI) network vnet subnet create -g $(GROUP) --vnet-name $(VNET) --name podnet --address-prefixes 10.241.0.0/16 -o none
5964

60-
rg-down: azcfg ## Delete the $GROUP in $SUB/$REGION
61-
$(AZCLI) group delete -g $(GROUP) --yes
6265

6366
##@ AKS Clusters
6467

65-
swift-up: azcfg swift-net-up ## Brings up a swift cluster $name in $SUB/$REGION
68+
swift-up: rg-up net-up ## Brings up a swift cluster $name in $SUB/$REGION
6669
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
6770
--max-pods 250 \
6871
--node-count 3 \
@@ -72,17 +75,18 @@ swift-up: azcfg swift-net-up ## Brings up a swift cluster $name in $SUB/$REGION
7275
--yes
7376
@$(MAKE) set-kubeconf
7477

75-
byocni-up: azcfg swift-net-up ## Brings up a swift cluster $name in $SUB/$REGION
78+
byocni-up: rg-up net-up ## Brings up a swift cluster $name in $SUB/$REGION
7679
$(AZCLI) aks create -n $(CLUSTER) -g $(GROUP) -l $(REGION) \
7780
--max-pods 250 \
7881
--node-count 3 \
7982
--network-plugin none \
8083
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
8184
--pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \
85+
--generate-ssh-keys \
8286
--yes
8387
@$(MAKE) set-kubeconf
8488

85-
down: azcfg ## Deletes the swift resources $SUB/$REGION
89+
down: ## Deletes the swift resources $SUB/$REGION
8690
$(AZCLI) aks delete -g $(GROUP) -n $(CLUSTER) --yes
8791
@$(MAKE) unset-kubeconf
88-
@$(MAKE) swift-rg-down
92+
@$(MAKE) rg-down

test/integration/manifests/cni/manager.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ spec:
1616
- effect: NoSchedule
1717
key: node-role.kubernetes.io/master
1818
operator: Exists
19+
- effect: NoSchedule
20+
key: node.kubernetes.io/not-ready
21+
operator: Exists
1922
hostNetwork: true
2023
containers:
2124
- name: azure-cni-installer
22-
image: acnpublic.azurecr.io/acncli:v1.2.8-32-g77506640
25+
image: acnpublic.azurecr.io/acncli:v1.4.28-42-gd086cf1b
2326
command: ["./acn"]
2427
args: ["cni", "manager", "--follow", "--mode", "transparent", "--ipam", "azure-cns"]
2528
imagePullPolicy: Always

test/integration/manifests/cns/daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
effect: NoSchedule
4242
containers:
4343
- name: cns-container
44-
image: acnpublic.azurecr.io/azure-cns:v1.2.8
44+
image: acnpublic.azurecr.io/azure-cns:v1.4.29
4545
imagePullPolicy: IfNotPresent
4646
args: [ "-c", "tcp://$(CNSIpAddress):$(CNSPort)", "-t", "$(CNSLogTarget)"]
4747
volumeMounts:

0 commit comments

Comments
 (0)