Skip to content

Commit 7b67717

Browse files
santhoshmprabhusivakami
authored andcommitted
test: pipeline changes for cilium nodesubnet (#3083)
* chore: separate pipeline changes for cilium nodesubnet * fix:make linter happy * chore: remove node subnet cilium version tag * fix: make private fork version tags compatible
1 parent d3508fd commit 7b67717

File tree

8 files changed

+55
-37
lines changed

8 files changed

+55
-37
lines changed

.pipelines/pipeline.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,17 @@ stages:
261261
k8sVersion: ""
262262
dependsOn: "containerize"
263263

264+
# Cilium Nodesubnet E2E tests
265+
- template: singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e-job-template.yaml
266+
parameters:
267+
name: "cilium_nodesubnet_e2e"
268+
displayName: Cilium NodeSubnet
269+
clusterType: nodesubnet-byocni-nokubeproxy-up
270+
clusterName: "cilndsubnete2e"
271+
vmSize: Standard_B2s
272+
k8sVersion: ""
273+
dependsOn: "containerize"
274+
264275
# Cilium Overlay E2E tests
265276
- template: singletenancy/cilium-overlay/cilium-overlay-e2e-job-template.yaml
266277
parameters:
@@ -405,6 +416,7 @@ stages:
405416
- azure_overlay_stateless_e2e
406417
- aks_swift_e2e
407418
- cilium_e2e
419+
- cilium_nodesubnet_e2e
408420
- cilium_overlay_e2e
409421
- cilium_h_overlay_e2e
410422
- aks_ubuntu_22_linux_e2e
@@ -425,6 +437,10 @@ stages:
425437
cilium_e2e:
426438
name: cilium_e2e
427439
clusterName: "ciliume2e"
440+
region: $(REGION_AKS_CLUSTER_TEST)
441+
cilium_nodesubnet_e2e:
442+
name: cilium_nodesubnet_e2e
443+
clusterName: "cilndsubnete2e"
428444
region: $(REGION_AKS_CLUSTER_TEST)
429445
cilium_overlay_e2e:
430446
name: cilium_overlay_e2e

.pipelines/singletenancy/cilium-nodesubnet/cilium-nodesubnet-e2e-job-template.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,9 @@ stages:
7171
os: ${{ parameters.os }}
7272
datapath: true
7373
dns: true
74+
cni: cilium
7475
portforward: true
7576
service: true
76-
hostport: true
7777
dependsOn: ${{ parameters.name }}
7878

7979
- job: failedE2ELogs

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ steps:
5858
kubectl cluster-info
5959
kubectl get po -owide -A
6060
echo "install Cilium ${CILIUM_VERSION_TAG}"
61-
export DIR=${CILIUM_VERSION_TAG%.*}
61+
export DIR=$(echo ${CILIUM_VERSION_TAG#v} | cut -d. -f1,2)
6262
echo "installing files from ${DIR}"
6363
echo "deploy Cilium ConfigMap"
6464
kubectl apply -f test/integration/manifests/cilium/v${DIR}/cilium-config/cilium-config.yaml

hack/aks/Makefile

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,18 @@ AZIMG = mcr.microsoft.com/azure-cli
88
AZCLI ?= docker run --rm -v $(AZCFG):/root/.azure -v $(KUBECFG):/root/.kube -v $(SSH):/root/.ssh -v $(PWD):/root/tmpsrc $(AZIMG) az
99

1010
# overrideable defaults
11-
AUTOUPGRADE ?= patch
12-
K8S_VER ?= 1.30
13-
NODE_COUNT ?= 2
14-
NODE_COUNT_WIN ?= $(NODE_COUNT)
15-
NODEUPGRADE ?= NodeImage
16-
OS ?= linux # Used to signify if you want to bring up a windows nodePool on byocni clusters
17-
OS_SKU ?= Ubuntu
18-
OS_SKU_WIN ?= Windows2022
19-
REGION ?= westus2
20-
VM_SIZE ?= Standard_B2s
21-
VM_SIZE_WIN ?= Standard_B2s
11+
AUTOUPGRADE ?= patch
12+
K8S_VER ?= 1.30
13+
NODE_COUNT ?= 2
14+
NODE_COUNT_WIN ?= $(NODE_COUNT)
15+
NODEUPGRADE ?= NodeImage
16+
OS ?= linux # Used to signify if you want to bring up a windows nodePool on byocni clusters
17+
OS_SKU ?= Ubuntu
18+
OS_SKU_WIN ?= Windows2022
19+
REGION ?= westus2
20+
VM_SIZE ?= Standard_B2s
21+
VM_SIZE_WIN ?= Standard_B2s
22+
KUBE_PROXY_JSON_PATH ?= ./kube-proxy.json
2223

2324
# overrideable variables
2425
SUB ?= $(AZURE_SUBSCRIPTION)
@@ -103,13 +104,13 @@ nodesubnet-byocni-nokubeproxy-up: rg-up overlay-net-up ## Brings up an NodeSubne
103104
--kubernetes-version $(K8S_VER) \
104105
--node-count $(NODE_COUNT) \
105106
--node-vm-size $(VM_SIZE) \
106-
--load-balancer-sku basic \
107+
--load-balancer-sku standard \
107108
--max-pods 250 \
108109
--network-plugin none \
109110
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
110111
--os-sku $(OS_SKU) \
111112
--no-ssh-key \
112-
--kube-proxy-config ./kube-proxy.json \
113+
--kube-proxy-config $(KUBE_PROXY_JSON_PATH) \
113114
--yes
114115
@$(MAKE) set-kubeconf
115116

@@ -146,7 +147,7 @@ overlay-byocni-nokubeproxy-up: rg-up overlay-net-up ## Brings up an Overlay BYO
146147
--pod-cidr 192.168.0.0/16 \
147148
--vnet-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/nodenet \
148149
--no-ssh-key \
149-
--kube-proxy-config ./kube-proxy.json \
150+
--kube-proxy-config $(KUBE_PROXY_JSON_PATH) \
150151
--yes
151152
@$(MAKE) set-kubeconf
152153

@@ -215,7 +216,7 @@ swift-byocni-nokubeproxy-up: rg-up swift-net-up ## Bring up a SWIFT BYO CNI clus
215216
--pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \
216217
--no-ssh-key \
217218
--os-sku $(OS_SKU) \
218-
--kube-proxy-config ./kube-proxy.json \
219+
--kube-proxy-config $(KUBE_PROXY_JSON_PATH) \
219220
--yes
220221
@$(MAKE) set-kubeconf
221222

@@ -305,7 +306,7 @@ vnetscale-swift-byocni-nokubeproxy-up: rg-up vnetscale-swift-net-up ## Bring up
305306
--pod-subnet-id /subscriptions/$(SUB)/resourceGroups/$(GROUP)/providers/Microsoft.Network/virtualNetworks/$(VNET)/subnets/podnet \
306307
--no-ssh-key \
307308
--os-sku $(OS_SKU) \
308-
--kube-proxy-config ./kube-proxy.json \
309+
--kube-proxy-config $(KUBE_PROXY_JSON_PATH) \
309310
--yes
310311
@$(MAKE) set-kubeconf
311312

@@ -434,7 +435,7 @@ dualstack-byocni-nokubeproxy-up: rg-up overlay-net-up ## Brings up a Dualstack o
434435
--ip-families ipv4,ipv6 \
435436
--aks-custom-headers AKSHTTPCustomFeatures=Microsoft.ContainerService/AzureOverlayDualStackPreview \
436437
--no-ssh-key \
437-
--kube-proxy-config ./kube-proxy.json \
438+
--kube-proxy-config $(KUBE_PROXY_JSON_PATH) \
438439
--yes
439440
@$(MAKE) set-kubeconf
440441

hack/aks/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ AKS Clusters
2424
byocni-up Alias to swift-byocni-up
2525
cilium-up Alias to swift-cilium-up
2626
up Alias to swift-up
27+
nodesubnet-byocni-nokubeproxy-up Bring up a Nodesubnet BYO CNI cluster. Does not include secondary IP configs.
2728
overlay-byocni-up Bring up a Overlay BYO CNI cluster
2829
overlay-byocni-nokubeproxy-up Bring up a Overlay BYO CNI cluster without kube-proxy
2930
overlay-cilium-up Bring up a Overlay Cilium cluster

test/integration/cilium-nodesubnet/ipconfigupdate.go

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,23 @@ import (
1212
"github.com/pkg/errors"
1313
)
1414

15-
func runCommand(command string) (string, error) {
16-
cmd := exec.Command("bash", "-c", command)
15+
func runAzCommand(params ...string) (string, error) {
1716
var out bytes.Buffer
1817
var stderr bytes.Buffer
19-
cmd.Stdout = &out
20-
cmd.Stderr = &stderr
2118
var err error
19+
fmt.Println("Running Azure CLI command ", strings.Join(params, " "))
2220
for i := 0; i < 3; i++ {
21+
cmd := exec.Command("az", params...)
22+
cmd.Stdout = &out
23+
cmd.Stderr = &stderr
2324
err = cmd.Run()
2425
if err == nil {
2526
break
2627
}
2728
}
2829

2930
if err != nil {
30-
return "", errors.Wrap(err, "command failed")
31+
return "", errors.Wrap(err, "command failed "+stderr.String())
3132
}
3233

3334
return out.String(), nil
@@ -60,16 +61,14 @@ func main() {
6061
os.Exit(1)
6162
}
6263

63-
command := fmt.Sprintf("az vmss list -g %s --query '[0].name' -o tsv", resourceGroup)
64-
result, err := runCommand(command)
64+
result, err := runAzCommand("vmss", "list", "-g", resourceGroup, "--query", "[0].name", "-o", "tsv")
6565
if err != nil {
6666
fmt.Printf("Command failed with error: %s\n", err)
6767
os.Exit(1)
6868
}
6969
vmssName := strings.TrimSpace(result)
7070

71-
command = fmt.Sprintf("az vmss show -g %s -n %s", resourceGroup, vmssName)
72-
result, err = runCommand(command)
71+
result, err = runAzCommand("vmss", "show", "-g", resourceGroup, "-n", vmssName)
7372
if err != nil {
7473
fmt.Printf("Command failed with error: %s\n", err)
7574
os.Exit(1)
@@ -104,8 +103,14 @@ func main() {
104103
for i := 2; i <= secondaryConfigCount+1; i++ {
105104
ipConfig := make(map[string]interface{})
106105
for k, v := range primaryIPConfig {
106+
// only the primary config needs loadBalancerBackendAddressPools. Azure doesn't allow
107+
// secondary IP configs to be associated load balancer backend pools.
108+
if k == "loadBalancerBackendAddressPools" {
109+
continue
110+
}
107111
ipConfig[k] = v
108112
}
113+
109114
ipConfigName := fmt.Sprintf("ipconfig%d", i)
110115
if !contains(usedIPConfigNames, ipConfigName) {
111116
ipConfig["name"] = ipConfigName
@@ -125,20 +130,13 @@ func main() {
125130
os.Exit(1)
126131
}
127132

128-
escapedNetworkProfileJSON := strings.ReplaceAll(string(networkProfileJSON), `\`, `\\`)
129-
escapedNetworkProfileJSON = strings.ReplaceAll(escapedNetworkProfileJSON, `'`, `\'`)
130-
131-
command = fmt.Sprintf("az vmss update -g %s -n %s --set virtualMachineProfile.networkProfile='%s'", resourceGroup, vmssName, escapedNetworkProfileJSON)
132-
fmt.Println("Command to update VMSS: ", command)
133-
_, err = runCommand(command)
133+
_, err = runAzCommand("vmss", "update", "-g", resourceGroup, "-n", vmssName, "--set", fmt.Sprintf("virtualMachineProfile.networkProfile=%s", networkProfileJSON))
134134
if err != nil {
135135
fmt.Printf("Command failed with error: %s\n", err)
136136
os.Exit(1)
137137
}
138138

139-
command = fmt.Sprintf("az vmss update-instances -g %s -n %s --instance-ids '*'", resourceGroup, vmssName)
140-
fmt.Println("Command to update VMSS instances: ", command)
141-
_, err = runCommand(command)
139+
_, err = runAzCommand("vmss", "update-instances", "-g", resourceGroup, "-n", vmssName, "--instance-ids", "*")
142140
if err != nil {
143141
fmt.Printf("Command failed with error: %s\n", err)
144142
os.Exit(1)

test/integration/manifests/ip-masq-agent/config-custom.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,6 @@ data:
1313
- 192.168.0.0/16
1414
- 100.64.0.0/10
1515
- 10.244.0.0/16
16+
- 10.10.0.0/16
1617
masqLinkLocal: false
1718
masqLinkLocalIPv6: true

test/integration/manifests/ip-masq-agent/config-reconcile.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,5 @@ data:
1111
- 192.168.0.0/16
1212
- 100.64.0.0/10
1313
- 10.244.0.0/16
14+
- 10.10.0.0/16
1415
masqLinkLocal: true

0 commit comments

Comments
 (0)