Skip to content

Commit 5033a0c

Browse files
authored
ci: create template for cilium cli install (#2736)
1 parent c9682a6 commit 5033a0c

File tree

6 files changed

+48
-114
lines changed

6 files changed

+48
-114
lines changed

.pipelines/cni/cilium/cilium-overlay-load-test-template.yaml

Lines changed: 5 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ stages:
8888
else
8989
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config.yaml
9090
fi
91-
91+
9292
# Passes Cilium image to daemonset and deployment
9393
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files
9494
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files
95-
95+
9696
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
9797
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
9898
kubectl get po -owide -A
@@ -119,7 +119,7 @@ stages:
119119
pwd
120120
kubectl cluster-info
121121
kubectl get po -owide -A
122-
122+
123123
echo "install Cilium onto Overlay Cluster with hubble enabled"
124124
export CILIUM_VERSION_TAG=${CILIUM_HUBBLE_VERSION_TAG}
125125
export DIR=${CILIUM_VERSION_TAG%.*}
@@ -134,7 +134,7 @@ stages:
134134
echo "Deploy Azure-CNS"
135135
sudo -E env "PATH=$PATH" make test-integration AZURE_IPAM_VERSION=$(make azure-ipam-version) CNS_VERSION=$(make cns-version) INSTALL_CNS=true INSTALL_OVERLAY=true CNS_IMAGE_REPO=$(CNS_IMAGE_REPO)
136136
kubectl get po -owide -A
137-
137+
138138
- job: deploy_pods
139139
condition: and( and( not(canceled()), not(failed()) ), or( contains(variables.CONTROL_SCENARIO, 'scaleTest') , contains(variables.CONTROL_SCENARIO, 'all') ) )
140140
displayName: "Scale Test"
@@ -183,24 +183,7 @@ stages:
183183
displayName: "Cilium Test"
184184
dependsOn: restart_cns
185185
steps:
186-
- script: |
187-
echo "install cilium CLI"
188-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
189-
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
190-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
191-
else
192-
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
193-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
194-
fi
195-
CLI_ARCH=amd64
196-
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
197-
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
198-
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
199-
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
200-
cilium status
201-
cilium version
202-
name: "InstallCiliumCli"
203-
displayName: "Install Cilium CLI"
186+
- template: ../../templates/cilium-cli.yaml
204187
- task: AzureCLI@1
205188
inputs:
206189
azureSubscription: $(BUILD_VALIDATIONS_SERVICE_CONNECTION)

.pipelines/singletenancy/cilium-dualstack-overlay/cilium-dualstackoverlay-e2e-step-template.yaml

Lines changed: 13 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ steps:
4040
# Passes Cilium image to daemonset and deployment
4141
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files
4242
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files
43-
43+
4444
export CILIUM_VERSION_TAG=${CILIUM_DUALSTACK_VERSION}
4545
echo "install Cilium ${CILIUM_DUALSTACK_VERSION} onto Overlay Cluster"
4646
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
@@ -49,25 +49,7 @@ steps:
4949
name: "installCilium"
5050
displayName: "Install Cilium on AKS Dualstack Overlay"
5151

52-
- script: |
53-
echo "install cilium CLI"
54-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
55-
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
56-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
57-
else
58-
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
59-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
60-
fi
61-
CLI_ARCH=amd64
62-
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
63-
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
64-
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
65-
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
66-
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
67-
cilium status
68-
cilium version
69-
name: "installCiliumCLI"
70-
displayName: "Install Cilium CLI"
52+
- template: ../../templates/cilium-cli.yaml
7153

7254
- script: |
7355
echo "Start Azilium E2E Tests on Overlay Cluster"
@@ -93,17 +75,17 @@ steps:
9375
name: "ciliumConnectivityTests"
9476
displayName: "Run Cilium Connectivity Tests"
9577
96-
- script: |
97-
set -e
98-
kubectl get po -owide -A
99-
cd test/integration/datapath
100-
echo "Dualstack Overlay Linux datapath IPv6 test"
101-
go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration -isDualStack=true
102-
echo "Dualstack Overlay Linux datapath IPv4 test"
103-
go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration
104-
retryCountOnTaskFailure: 3
105-
name: "DualStack_Overlay_Linux_Tests"
106-
displayName: "DualStack Overlay Linux Tests"
78+
- script: |
79+
set -e
80+
kubectl get po -owide -A
81+
cd test/integration/datapath
82+
echo "Dualstack Overlay Linux datapath IPv6 test"
83+
go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration -isDualStack=true
84+
echo "Dualstack Overlay Linux datapath IPv4 test"
85+
go test -count=1 datapath_linux_test.go -timeout 3m -tags connection -run ^TestDatapathLinux$ -tags=connection,integration
86+
retryCountOnTaskFailure: 3
87+
name: "DualStack_Overlay_Linux_Tests"
88+
displayName: "DualStack Overlay Linux Tests"
10789
10890
- script: |
10991
echo "validate pod IP assignment and check systemd-networkd restart"

.pipelines/singletenancy/cilium-overlay-withhubble/cilium-overlay-e2e-step-template.yaml

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -48,25 +48,7 @@ steps:
4848
name: "installCilium"
4949
displayName: "Install Cilium on AKS Overlay"
5050

51-
- script: |
52-
echo "install cilium CLI"
53-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
54-
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
55-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
56-
else
57-
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
58-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
59-
fi
60-
CLI_ARCH=amd64
61-
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
62-
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
63-
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
64-
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
65-
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
66-
cilium status
67-
cilium version
68-
name: "installCiliumCLI"
69-
displayName: "Install Cilium CLI"
51+
- template: ../../templates/cilium-cli.yaml
7052

7153
- script: |
7254
echo "Start Azilium E2E Tests on Overlay Cluster"

.pipelines/singletenancy/cilium-overlay/cilium-overlay-e2e-step-template.yaml

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ steps:
3939
pwd
4040
kubectl cluster-info
4141
kubectl get po -owide -A
42-
if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then
42+
if [ "$CILIUM_VERSION_TAG" = "cilium-nightly-pipeline" ]; then
4343
FILE_PATH=-nightly
4444
echo "Running nightly"
4545
echo "deploy Cilium ConfigMap"
@@ -59,34 +59,16 @@ steps:
5959
# Passes Cilium image to daemonset and deployment
6060
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files
6161
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files
62-
62+
6363
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
6464
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
6565
fi
66-
66+
6767
kubectl get po -owide -A
6868
name: "installCilium"
6969
displayName: "Install Cilium on AKS Overlay"
7070

71-
- script: |
72-
echo "install cilium CLI"
73-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
74-
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
75-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
76-
else
77-
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
78-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
79-
fi
80-
CLI_ARCH=amd64
81-
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
82-
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
83-
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
84-
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
85-
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
86-
cilium status
87-
cilium version
88-
name: "installCiliumCLI"
89-
displayName: "Install Cilium CLI"
71+
- template: ../../templates/cilium-cli.yaml
9072

9173
- script: |
9274
echo "Start Azilium E2E Tests on Overlay Cluster"

.pipelines/singletenancy/cilium/cilium-e2e-step-template.yaml

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,32 +46,14 @@ steps:
4646
# Passes Cilium image to daemonset and deployment
4747
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-agent/files
4848
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-operator/files
49-
49+
5050
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-agent/templates/daemonset.yaml | kubectl apply -f -
5151
envsubst '${CILIUM_VERSION_TAG},${CILIUM_IMAGE_REGISTRY}' < test/integration/manifests/cilium/v${DIR}/cilium-operator/templates/deployment.yaml | kubectl apply -f -
5252
kubectl get po -owide -A
5353
name: "installCilium"
5454
displayName: "Install Cilium"
5555

56-
- script: |
57-
echo "install cilium CLI"
58-
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
59-
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
60-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
61-
else
62-
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
63-
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
64-
fi
65-
CLI_ARCH=amd64
66-
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
67-
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
68-
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
69-
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
70-
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
71-
cilium status
72-
cilium version
73-
name: "installCiliumCLI"
74-
displayName: "Install Cilium CLI"
56+
- template: ../../templates/cilium-cli.yaml
7557

7658
- script: |
7759
echo "Start Azilium E2E Tests"
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
steps:
2+
- script: |
3+
echo "install cilium CLI"
4+
if [[ ${CILIUM_VERSION_TAG} =~ ^1.1[1-3].[0-9]{1,2} ]]; then
5+
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
6+
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/main/stable-v0.14.txt)
7+
elif [[ ${CILIUM_VERSION_TAG} =~ ^1.14.[0-9]{1,2} ]]; then
8+
echo "Cilium Agent Version ${BASH_REMATCH[0]}"
9+
CILIUM_CLI_VERSION=v0.15.22
10+
else
11+
echo "Cilium Agent Version ${CILIUM_VERSION_TAG}"
12+
CILIUM_CLI_VERSION=$(curl -s https://raw.githubusercontent.com/cilium/cilium-cli/master/stable.txt)
13+
fi
14+
CLI_ARCH=amd64
15+
if [ "$(uname -m)" = "aarch64" ]; then CLI_ARCH=arm64; fi
16+
curl -L --fail --remote-name-all https://github.com/cilium/cilium-cli/releases/download/${CILIUM_CLI_VERSION}/cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
17+
sha256sum --check cilium-linux-${CLI_ARCH}.tar.gz.sha256sum
18+
sudo tar xzvfC cilium-linux-${CLI_ARCH}.tar.gz /usr/local/bin
19+
rm cilium-linux-${CLI_ARCH}.tar.gz{,.sha256sum}
20+
cilium status
21+
cilium version
22+
name: "installCiliumCLI"
23+
displayName: "Install Cilium CLI"

0 commit comments

Comments
 (0)