Skip to content

Commit 976a32b

Browse files
authored
ci: fix multus installation (#3062)
1 parent 0d1599f commit 976a32b

File tree

4 files changed

+18
-20
lines changed

4 files changed

+18
-20
lines changed

.github/workflows/build-x86-image.yaml

+1-4
Original file line numberDiff line numberDiff line change
@@ -2026,10 +2026,7 @@ jobs:
20262026
sudo cp -r /root/.kube/ ~/.kube/
20272027
sudo chown -R $(id -un). ~/.kube/
20282028
2029-
- name: Install Kube-OVN
2030-
run: make kind-install
2031-
2032-
- name: Install vpc-nat-gw
2029+
- name: Install Kube-OVN with VPC NAT gateway enabled
20332030
run: make kind-install-vpc-nat-gw
20342031

20352032
- name: Run E2E

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
.vscode/*
33
.DS_Store
44
dist/images/test-server
5+
dist/images/kube-ovn
56
dist/images/kube-ovn-cmd
67
dist/images/kube-ovn-webhook
78
dist/windows/kube-ovn.exe

Makefile

+7-9
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ CONTROL_PLANE_TAINTS = node-role.kubernetes.io/master node-role.kubernetes.io/co
2222

2323
CHART_UPGRADE_RESTART_OVS=$(shell echo $${CHART_UPGRADE_RESTART_OVS:-false})
2424

25-
MULTUS_IMAGE = ghcr.io/k8snetworkplumbingwg/multus-cni:snapshot-thick
26-
MULTUS_YAML = https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/master/deployments/multus-daemonset-thick.yml
25+
MULTUS_VERSION = v4.0.2
26+
MULTUS_IMAGE = ghcr.io/k8snetworkplumbingwg/multus-cni:$(MULTUS_VERSION)-thick
27+
MULTUS_YAML = https://raw.githubusercontent.com/k8snetworkplumbingwg/multus-cni/$(MULTUS_VERSION)/deployments/multus-daemonset-thick.yml
2728

2829
KUBEVIRT_VERSION = v0.59.2
2930
KUBEVIRT_OPERATOR_IMAGE = quay.io/kubevirt/virt-operator:$(KUBEVIRT_VERSION)
@@ -690,27 +691,24 @@ kind-install-underlay-logical-gateway-dual: kind-disable-hairpin kind-load-image
690691
.PHONY: kind-install-multus
691692
kind-install-multus:
692693
$(call kind_load_image,kube-ovn,$(MULTUS_IMAGE),1)
693-
kubectl apply -f "$(MULTUS_YAML)"
694+
curl -s "$(MULTUS_YAML)" | sed 's/:snapshot-thick/:$(MULTUS_VERSION)-thick/g' | kubectl apply -f -
694695
kubectl -n kube-system rollout status ds kube-multus-ds
695696

696697
.PHONY: kind-install-vpc-nat-gw
697-
kind-install-vpc-nat-gw: kind-load-image kind-untaint-control-plane
698+
kind-install-vpc-nat-gw:
698699
$(call kind_load_image,kube-ovn,$(VPC_NAT_GW_IMG))
699700
@$(MAKE) ENABLE_NAT_GW=true CNI_CONFIG_PRIORITY=10 kind-install
700701
@$(MAKE) kind-install-multus
701702

702703
.PHONY: kind-install-kubevirt
703-
kind-install-kubevirt: kind-load-image kind-untaint-control-plane
704+
kind-install-kubevirt: kind-install
704705
$(call kind_load_image,kube-ovn,$(KUBEVIRT_OPERATOR_IMAGE),1)
705706
$(call kind_load_image,kube-ovn,$(KUBEVIRT_API_IMAGE),1)
706707
$(call kind_load_image,kube-ovn,$(KUBEVIRT_CONTROLLER_IMAGE),1)
707708
$(call kind_load_image,kube-ovn,$(KUBEVIRT_HANDLER_IMAGE),1)
708709
$(call kind_load_image,kube-ovn,$(KUBEVIRT_LAUNCHER_IMAGE),1)
709710
$(call kind_load_image,kube-ovn,$(KUBEVIRT_TEST_IMAGE),1)
710711

711-
sed 's/VERSION=.*/VERSION=$(VERSION)/' dist/images/install.sh | bash
712-
kubectl describe no
713-
714712
kubectl apply -f "$(KUBEVIRT_OPERATOR_YAML)"
715713
kubectl apply -f "$(KUBEVIRT_CR_YAML)"
716714
kubectl rollout status deployment/virt-operator -n kubevirt --timeout 120s
@@ -723,7 +721,7 @@ kind-install-kubevirt: kind-load-image kind-untaint-control-plane
723721
kubectl patch vm testvm --type=merge --patch '{"spec":{"running":true}}'
724722

725723
.PHONY: kind-install-lb-svc
726-
kind-install-lb-svc: kind-load-image kind-untaint-control-plane
724+
kind-install-lb-svc:
727725
$(call kind_load_image,kube-ovn,$(VPC_NAT_GW_IMG))
728726
@$(MAKE) ENABLE_LB_SVC=true CNI_CONFIG_PRIORITY=10 kind-install
729727
@$(MAKE) kind-install-multus

test/e2e/iptables-vpc-nat-gw/e2e_test.go

+9-7
Original file line numberDiff line numberDiff line change
@@ -158,15 +158,15 @@ func setupVpcNatGwTestEnvironment(
158158
_, err := f.ClientSet.CoreV1().ConfigMaps(framework.KubeOvnNamespace).Get(context.Background(), vpcNatGWConfigMapName, metav1.GetOptions{})
159159
framework.ExpectNoError(err, "failed to get ConfigMap")
160160

161-
ginkgo.By("Creating custom vpc")
161+
ginkgo.By("Creating custom vpc " + vpcName)
162162
vpc := framework.MakeVpc(vpcName, lanIp, false, false, nil)
163163
_ = vpcClient.CreateSync(vpc)
164164

165-
ginkgo.By("Creating custom overlay subnet")
165+
ginkgo.By("Creating custom overlay subnet " + overlaySubnetName)
166166
overlaySubnet := framework.MakeSubnet(overlaySubnetName, "", overlaySubnetV4Cidr, overlaySubnetV4Gw, vpcName, "", nil, nil, nil)
167167
_ = subnetClient.CreateSync(overlaySubnet)
168168

169-
ginkgo.By("Creating custom vpc nat gw")
169+
ginkgo.By("Creating custom vpc nat gw " + vpcNatGwName)
170170
vpcNatGw := framework.MakeVpcNatGateway(vpcNatGwName, vpcName, overlaySubnetName, lanIp, externalNetworkName, natGwQosPolicy)
171171
_ = vpcNatGwClient.CreateSync(vpcNatGw, f.ClientSet)
172172
}
@@ -230,7 +230,7 @@ var _ = framework.Describe("[group:iptables-vpc-nat-gw]", func() {
230230
overlaySubnetName = "overlay-subnet-" + framework.RandomSuffix()
231231

232232
net2AttachDefName = "net2-ovn-vpc-external-network-" + framework.RandomSuffix()
233-
net2SubnetProvider = net2AttachDefName + ".kube-system"
233+
net2SubnetProvider = fmt.Sprintf("%s.%s", net2AttachDefName, framework.KubeOvnNamespace)
234234
net2OverlaySubnetName = "net2-overlay-subnet-" + framework.RandomSuffix()
235235
net2VpcNatGwName = "net2-gw-" + framework.RandomSuffix()
236236
net2VpcName = "net2-vpc-" + framework.RandomSuffix()
@@ -610,7 +610,7 @@ func newVPCQoSParamsInit() *qosParams {
610610
vpc2PodName: "qos-vpc2-pod-" + framework.RandomSuffix(),
611611
attachDefName: "qos-ovn-vpc-external-network-" + framework.RandomSuffix(),
612612
}
613-
qosParames.subnetProvider = qosParames.attachDefName + ".kube-system"
613+
qosParames.subnetProvider = fmt.Sprintf("%s.%s", qosParames.attachDefName, framework.KubeOvnNamespace)
614614
return qosParames
615615
}
616616

@@ -1078,7 +1078,7 @@ var _ = framework.Describe("[group:qos-policy]", func() {
10781078
vpcQosParams.vpc2PodName = "qos-vpc2-pod-" + framework.RandomSuffix()
10791079

10801080
vpcQosParams.attachDefName = "qos-ovn-vpc-external-network-" + framework.RandomSuffix()
1081-
vpcQosParams.subnetProvider = vpcQosParams.attachDefName + ".kube-system"
1081+
vpcQosParams.subnetProvider = fmt.Sprintf("%s.%s", vpcQosParams.attachDefName, framework.KubeOvnNamespace)
10821082

10831083
containerID = ""
10841084
cs = f.ClientSet
@@ -1286,8 +1286,10 @@ var _ = framework.Describe("[group:qos-policy]", func() {
12861286
ginkgo.By("Deleting overlay subnet " + vpcQosParams.vpc1SubnetName)
12871287
subnetClient.DeleteSync(vpcQosParams.vpc1SubnetName)
12881288

1289-
vpcNatGw2PodName := util.GenNatGwPodName(vpcQosParams.vpcNat2GwName)
1289+
ginkgo.By("Getting overlay subnet " + vpcQosParams.vpc2SubnetName)
12901290
overlaySubnet2 := subnetClient.Get(vpcQosParams.vpc2SubnetName)
1291+
1292+
vpcNatGw2PodName := util.GenNatGwPodName(vpcQosParams.vpcNat2GwName)
12911293
eth0IpName = ovs.PodNameToPortName(vpcNatGw2PodName, framework.KubeOvnNamespace, overlaySubnet2.Spec.Provider)
12921294
net1IpName = ovs.PodNameToPortName(vpcNatGw2PodName, framework.KubeOvnNamespace, macvlanSubnet.Spec.Provider)
12931295
ginkgo.By("Deleting vpc nat gw eth0 ip " + eth0IpName)

0 commit comments

Comments
 (0)