Skip to content

Commit 4063dcb

Browse files
authored
Merge pull request #5101 from npinaeva/test-kernel-2
Update github runners to use the new kernel
2 parents fd5a1d1 + 6b01b29 commit 4063dcb

File tree

7 files changed

+85
-106
lines changed

7 files changed

+85
-106
lines changed

.github/workflows/test.yml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
# separate job for parallelism
3939
lint:
4040
name: Lint
41-
runs-on: ubuntu-22.04
41+
runs-on: ubuntu-24.04
4242
steps:
4343
- name: Check out code
4444
uses: actions/checkout@v4
@@ -63,7 +63,7 @@ jobs:
6363

6464
build-master:
6565
name: Build-master
66-
runs-on: ubuntu-22.04
66+
runs-on: ubuntu-24.04
6767
steps:
6868
# Create a cache for the built master image
6969
- name: Restore master image cache
@@ -156,7 +156,7 @@ jobs:
156156

157157
build-pr:
158158
name: Build-PR
159-
runs-on: ubuntu-22.04
159+
runs-on: ubuntu-24.04
160160
steps:
161161
# Create a cache for the build PR image
162162
- name: Restore PR image cache
@@ -271,7 +271,7 @@ jobs:
271271
ovn-upgrade-e2e:
272272
name: Upgrade OVN from Master to PR branch based image
273273
if: github.event_name != 'schedule'
274-
runs-on: ubuntu-22.04
274+
runs-on: ubuntu-24.04
275275
timeout-minutes: 120
276276
needs:
277277
- build-master
@@ -319,10 +319,9 @@ jobs:
319319
sudo rm -rf /usr/local/lib/android/sdk
320320
sudo apt-get update
321321
sudo eatmydata apt-get purge --auto-remove -y \
322-
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
322+
azure-cli firefox \
323323
google-chrome-stable \
324-
llvm-* microsoft-edge-stable mono-* \
325-
msbuild mysql-server-core-* php-* php7* \
324+
llvm-* microsoft-edge-stable \
326325
powershell temurin-* zulu-*
327326
# clean unused packages
328327
sudo apt-get autoclean
@@ -422,7 +421,7 @@ jobs:
422421

423422
e2e:
424423
name: e2e
425-
runs-on: ubuntu-22.04
424+
runs-on: ubuntu-24.04
426425
# 30 mins for kind, 180 mins for control-plane tests, 10 minutes for all other steps
427426
timeout-minutes: 220
428427
strategy:
@@ -495,7 +494,6 @@ jobs:
495494
OVN_SECOND_BRIDGE: "${{ matrix.second-bridge == '2br' }}"
496495
ENABLE_MULTI_NET: "${{ matrix.target == 'multi-homing' || matrix.target == 'kv-live-migration' || matrix.target == 'network-segmentation' || matrix.target == 'tools' || matrix.target == 'multi-homing-helm' || matrix.target == 'traffic-flow-test-only' || matrix.routeadvertisements != '' }}"
497496
ENABLE_NETWORK_SEGMENTATION: "${{ matrix.target == 'network-segmentation' || matrix.network-segmentation == 'enable-network-segmentation' }}"
498-
DISABLE_UDN_HOST_ISOLATION: "true"
499497
PLATFORM_IPV4_SUPPORT: "${{ matrix.ipfamily == 'IPv4' || matrix.ipfamily == 'dualstack' }}"
500498
PLATFORM_IPV6_SUPPORT: "${{ matrix.ipfamily == 'IPv6' || matrix.ipfamily == 'dualstack' }}"
501499
KIND_INSTALL_KUBEVIRT: "${{ matrix.target == 'kv-live-migration' }}"
@@ -526,10 +524,9 @@ jobs:
526524
sudo rm -rf /usr/local/lib/android/sdk
527525
sudo apt-get update
528526
sudo eatmydata apt-get purge --auto-remove -y \
529-
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
527+
azure-cli firefox \
530528
google-chrome-stable \
531-
llvm-* microsoft-edge-stable mono-* \
532-
msbuild mysql-server-core-* php-* php7* \
529+
llvm-* microsoft-edge-stable \
533530
powershell temurin-* zulu-*
534531
# clean unused packages
535532
sudo apt-get autoclean
@@ -713,7 +710,7 @@ jobs:
713710
e2e-dual-conversion:
714711
name: e2e-dual-conversion
715712
if: github.event_name != 'schedule'
716-
runs-on: ubuntu-22.04
713+
runs-on: ubuntu-24.04
717714
timeout-minutes: 60
718715
strategy:
719716
fail-fast: false
@@ -762,10 +759,9 @@ jobs:
762759
sudo rm -rf /usr/local/lib/android/sdk
763760
sudo apt-get update
764761
sudo eatmydata apt-get purge --auto-remove -y \
765-
azure-cli aspnetcore-* dotnet-* ghc-* firefox \
762+
azure-cli firefox \
766763
google-chrome-stable \
767-
llvm-* microsoft-edge-stable mono-* \
768-
msbuild mysql-server-core-* php-* php7* \
764+
llvm-* microsoft-edge-stable \
769765
powershell temurin-* zulu-*
770766
# clean unused packages
771767
sudo apt-get autoclean

dist/images/ovnkube.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2162,7 +2162,6 @@ ovnkube-controller-with-node() {
21622162
--nodeport \
21632163
--ovn-metrics-bind-address ${ovn_metrics_bind_address} \
21642164
--pidfile ${OVN_RUNDIR}/ovnkube-controller-with-node.pid \
2165-
--disable-udn-host-isolation \
21662165
--zone ${ovn_zone} &
21672166

21682167
wait_for_event attempts=3 process_ready ovnkube-controller-with-node
@@ -2814,7 +2813,6 @@ ovn-node() {
28142813
--nodeport \
28152814
--ovn-metrics-bind-address ${ovn_metrics_bind_address} \
28162815
--pidfile ${OVN_RUNDIR}/ovnkube.pid \
2817-
--disable-udn-host-isolation \
28182816
--zone ${ovn_zone} &
28192817

28202818
wait_for_event attempts=3 process_ready ovnkube

go-controller/pkg/config/config.go

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -425,18 +425,15 @@ type OVNKubernetesFeatureConfig struct {
425425
EnableNetworkSegmentation bool `gcfg:"enable-network-segmentation"`
426426
EnablePreconfiguredUDNAddresses bool `gcfg:"enable-preconfigured-udn-addresses"`
427427
EnableRouteAdvertisements bool `gcfg:"enable-route-advertisements"`
428-
// This feature requires a kernel fix https://github.com/torvalds/linux/commit/7f3287db654395f9c5ddd246325ff7889f550286
429-
// to work on a kind cluster. Flag allows to disable it for current CI, will be turned on when github runners have this fix.
430-
DisableUDNHostIsolation bool `gcfg:"disable-udn-host-isolation"`
431-
EnableMultiNetworkPolicy bool `gcfg:"enable-multi-networkpolicy"`
432-
EnableStatelessNetPol bool `gcfg:"enable-stateless-netpol"`
433-
EnableInterconnect bool `gcfg:"enable-interconnect"`
434-
EnableMultiExternalGateway bool `gcfg:"enable-multi-external-gateway"`
435-
EnablePersistentIPs bool `gcfg:"enable-persistent-ips"`
436-
EnableDNSNameResolver bool `gcfg:"enable-dns-name-resolver"`
437-
EnableServiceTemplateSupport bool `gcfg:"enable-svc-template-support"`
438-
EnableObservability bool `gcfg:"enable-observability"`
439-
EnableNetworkQoS bool `gcfg:"enable-network-qos"`
428+
EnableMultiNetworkPolicy bool `gcfg:"enable-multi-networkpolicy"`
429+
EnableStatelessNetPol bool `gcfg:"enable-stateless-netpol"`
430+
EnableInterconnect bool `gcfg:"enable-interconnect"`
431+
EnableMultiExternalGateway bool `gcfg:"enable-multi-external-gateway"`
432+
EnablePersistentIPs bool `gcfg:"enable-persistent-ips"`
433+
EnableDNSNameResolver bool `gcfg:"enable-dns-name-resolver"`
434+
EnableServiceTemplateSupport bool `gcfg:"enable-svc-template-support"`
435+
EnableObservability bool `gcfg:"enable-observability"`
436+
EnableNetworkQoS bool `gcfg:"enable-network-qos"`
440437
}
441438

442439
// GatewayMode holds the node gateway mode
@@ -1087,12 +1084,6 @@ var OVNK8sFeatureFlags = []cli.Flag{
10871084
Destination: &cliConfig.OVNKubernetesFeature.EnableMultiNetworkPolicy,
10881085
Value: OVNKubernetesFeature.EnableMultiNetworkPolicy,
10891086
},
1090-
&cli.BoolFlag{
1091-
Name: "disable-udn-host-isolation",
1092-
Usage: "Configure to disable UDN host isolation with ovn-kubernetes.",
1093-
Destination: &cliConfig.OVNKubernetesFeature.DisableUDNHostIsolation,
1094-
Value: OVNKubernetesFeature.DisableUDNHostIsolation,
1095-
},
10961087
&cli.BoolFlag{
10971088
Name: "enable-network-segmentation",
10981089
Usage: "Configure to use network segmentation feature with ovn-kubernetes.",

go-controller/pkg/node/default_node_network_controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ func newDefaultNodeNetworkController(cnnci *CommonNodeNetworkControllerInfo, sto
150150
routeManager: routeManager,
151151
ovsClient: ovsClient,
152152
}
153-
if util.IsNetworkSegmentationSupportEnabled() && !config.OVNKubernetesFeature.DisableUDNHostIsolation {
153+
if util.IsNetworkSegmentationSupportEnabled() {
154154
c.udnHostIsolationManager = NewUDNHostIsolationManager(config.IPv4Mode, config.IPv6Mode,
155155
cnnci.watchFactory.PodCoreInformer(), cnnci.name, cnnci.recorder)
156156
}

test/e2e/network_segmentation.go

Lines changed: 46 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -385,52 +385,50 @@ var _ = Describe("Network Segmentation", feature.NetworkSegmentation, func() {
385385
}, 10*time.Second, 1*time.Second).Should(BeTrue())
386386
Expect(udnPod.Status.ContainerStatuses[0].RestartCount).To(Equal(int32(0)))
387387

388-
if !isUDNHostIsolationDisabled() {
389-
By("checking default network hostNetwork pod and non-kubelet host process can't reach the UDN pod")
390-
hostNetPod, err := createPod(f, "host-net-pod", nodeName,
391-
defaultNetNamespace, []string{}, nil, func(pod *v1.Pod) {
392-
pod.Spec.HostNetwork = true
393-
})
394-
Expect(err).NotTo(HaveOccurred())
388+
By("checking default network hostNetwork pod and non-kubelet host process can't reach the UDN pod")
389+
hostNetPod, err := createPod(f, "host-net-pod", nodeName,
390+
defaultNetNamespace, []string{}, nil, func(pod *v1.Pod) {
391+
pod.Spec.HostNetwork = true
392+
})
393+
Expect(err).NotTo(HaveOccurred())
395394

396-
// positive check for reachable default network pod
397-
for _, destIP := range []string{defaultIPv4, defaultIPv6} {
398-
if destIP == "" {
399-
continue
400-
}
401-
By("checking the default network hostNetwork can reach default pod on IP " + destIP)
402-
Eventually(func() bool {
403-
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetDefaultPort) == nil
404-
}).Should(BeTrue())
405-
By("checking the non-kubelet host process can reach default pod on IP " + destIP)
406-
Eventually(func() bool {
407-
_, err := infraprovider.Get().ExecK8NodeCommand(nodeName, []string{
408-
"curl", "--connect-timeout", "2",
409-
net.JoinHostPort(destIP, fmt.Sprintf("%d", podClusterNetDefaultPort)),
395+
// positive check for reachable default network pod
396+
for _, destIP := range []string{defaultIPv4, defaultIPv6} {
397+
if destIP == "" {
398+
continue
399+
}
400+
By("checking the default network hostNetwork can reach default pod on IP " + destIP)
401+
Eventually(func() bool {
402+
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetDefaultPort) == nil
403+
}).Should(BeTrue())
404+
By("checking the non-kubelet host process can reach default pod on IP " + destIP)
405+
Eventually(func() bool {
406+
_, err := infraprovider.Get().ExecK8NodeCommand(nodeName, []string{
407+
"curl", "--connect-timeout", "2",
408+
net.JoinHostPort(destIP, fmt.Sprintf("%d", podClusterNetDefaultPort)),
410409
})
411-
return err == nil
412-
}).Should(BeTrue())
410+
return err == nil
411+
}).Should(BeTrue())
412+
}
413+
// negative check for UDN pod
414+
for _, destIP := range []string{udnIPv4, udnIPv6} {
415+
if destIP == "" {
416+
continue
413417
}
414-
// negative check for UDN pod
415-
for _, destIP := range []string{udnIPv4, udnIPv6} {
416-
if destIP == "" {
417-
continue
418-
}
419418

420-
By("checking the default network hostNetwork pod can't reach UDN pod on IP " + destIP)
421-
Consistently(func() bool {
422-
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetPort) != nil
423-
}, 5*time.Second).Should(BeTrue())
419+
By("checking the default network hostNetwork pod can't reach UDN pod on IP " + destIP)
420+
Consistently(func() bool {
421+
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetPort) != nil
422+
}, 5*time.Second).Should(BeTrue())
424423

425-
By("checking the non-kubelet host process can't reach UDN pod on IP " + destIP)
426-
Consistently(func() bool {
427-
_, err := infraprovider.Get().ExecK8NodeCommand(nodeName, []string{
428-
"curl", "--connect-timeout", "2",
429-
net.JoinHostPort(destIP, fmt.Sprintf("%d", podClusterNetPort)),
424+
By("checking the non-kubelet host process can't reach UDN pod on IP " + destIP)
425+
Consistently(func() bool {
426+
_, err := infraprovider.Get().ExecK8NodeCommand(nodeName, []string{
427+
"curl", "--connect-timeout", "2",
428+
net.JoinHostPort(destIP, fmt.Sprintf("%d", podClusterNetPort)),
430429
})
431-
return err != nil
432-
}, 5*time.Second).Should(BeTrue())
433-
}
430+
return err != nil
431+
}, 5*time.Second).Should(BeTrue())
434432
}
435433

436434
By("asserting UDN pod can reach the kapi service in the default network")
@@ -1646,12 +1644,10 @@ spec:
16461644
return connectToServer(podConfiguration{namespace: defaultClientPod.Namespace, name: defaultClientPod.Name}, destIP, podClusterNetPort) != nil
16471645
}, 5*time.Second).Should(BeTrue())
16481646

1649-
if !isUDNHostIsolationDisabled() {
1650-
By("checking the default hostNetwork pod can't reach UDN pod on IP " + destIP)
1651-
Consistently(func() bool {
1652-
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetPort) != nil
1653-
}, 5*time.Second).Should(BeTrue())
1654-
}
1647+
By("checking the default hostNetwork pod can't reach UDN pod on IP " + destIP)
1648+
Consistently(func() bool {
1649+
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetPort) != nil
1650+
}, 5*time.Second).Should(BeTrue())
16551651
}
16561652

16571653
By("Open UDN pod port")
@@ -1696,12 +1692,10 @@ spec:
16961692
return connectToServer(podConfiguration{namespace: defaultClientPod.Namespace, name: defaultClientPod.Name}, destIP, podClusterNetPort) != nil
16971693
}, 5*time.Second).Should(BeTrue())
16981694

1699-
if !isUDNHostIsolationDisabled() {
1700-
By("checking the default hostNetwork pod can't reach UDN pod on IP " + destIP)
1701-
Eventually(func() bool {
1702-
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetPort) != nil
1703-
}, 5*time.Second).Should(BeTrue())
1704-
}
1695+
By("checking the default hostNetwork pod can't reach UDN pod on IP " + destIP)
1696+
Eventually(func() bool {
1697+
return connectToServer(podConfiguration{namespace: hostNetPod.Namespace, name: hostNetPod.Name}, destIP, podClusterNetPort) != nil
1698+
}, 5*time.Second).Should(BeTrue())
17051699
}
17061700
By("Verify syntax error is reported via event")
17071701
events, err := cs.CoreV1().Events(udnPod.Namespace).List(context.Background(), metav1.ListOptions{})

test/e2e/node_ip_mac_migration.go

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -953,26 +953,31 @@ func migrateWorkerNodeIP(nodeName, fromIP, targetIP string, invertOrder bool) (e
953953

954954
// Define a function to change the IP address for later use.
955955
changeIPAddress := func() error {
956-
// Add new IP first - this will preserve the default route.
957956
newIPMask := targetIP + "/" + mask
958-
framework.Logf("Adding new IP address %s to node %s", newIPMask, nodeName)
959-
// Add cleanup command.
960-
cleanupCmd := []string{"ip", "address", "del", newIPMask, "dev", iface}
957+
958+
// Delete current IP address. If you add a second ip from the same subnet to an interface, it will
959+
// be considered a secondary IP address and will be deleted together with the primary (aka old) IP.
960+
framework.Logf("Deleting current IP address %s from node %s", parsedNetIPMask.String(), nodeName)
961+
// Add cleanup command to add original IP back to the end of the cleanupCommands list.
962+
// This way, we preserve first delete then add new IP sequence.
963+
cleanupCmd := []string{"ip", "address", "add", parsedNetIPMask.String(), "dev", iface}
961964
cleanupCommands = append(cleanupCommands, cleanupCmd)
962965
// Run command.
963-
_, err = infraprovider.Get().ExecK8NodeCommand(nodeName, []string{"ip", "address", "add", newIPMask, "dev", iface})
966+
_, err = infraprovider.Get().ExecK8NodeCommand(nodeName, []string{"ip", "address", "del", parsedNetIPMask.String(), "dev", iface})
964967
if err != nil {
965-
return fmt.Errorf("failed to add new IP %s to interface %s on node %s: %v", newIPMask, iface, nodeName, err)
968+
return err
966969
}
967-
// Delete current IP address. On rollback, first add the old IP and then delete the new one.
968-
framework.Logf("Deleting current IP address %s from node %s", parsedNetIPMask.String(), nodeName)
969-
// Add cleanup command.
970-
cleanupCmd = []string{"ip", "address", "add", parsedNetIPMask.String(), "dev", iface}
970+
971+
// Now add new IP.
972+
framework.Logf("Adding new IP address %s to node %s", newIPMask, nodeName)
973+
// Add cleanup command to remove the new IP address to the beginning of the cleanupCommands list.
974+
cleanupCmd = []string{"ip", "address", "del", newIPMask, "dev", iface}
971975
cleanupCommands = append([][]string{cleanupCmd}, cleanupCommands...)
976+
972977
// Run command.
973-
_, err = infraprovider.Get().ExecK8NodeCommand(nodeName, []string{"ip", "address", "del", parsedNetIPMask.String(), "dev", iface})
978+
_, err = infraprovider.Get().ExecK8NodeCommand(nodeName, []string{"ip", "address", "add", newIPMask, "dev", iface})
974979
if err != nil {
975-
return err
980+
return fmt.Errorf("failed to add new IP %s to interface %s on node %s: %v", newIPMask, iface, nodeName, err)
976981
}
977982
return nil
978983
}

test/e2e/util.go

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1144,11 +1144,6 @@ func isInterconnectEnabled() bool {
11441144
return present && val == "true"
11451145
}
11461146

1147-
func isUDNHostIsolationDisabled() bool {
1148-
val, present := os.LookupEnv("DISABLE_UDN_HOST_ISOLATION")
1149-
return present && val == "true"
1150-
}
1151-
11521147
func isNetworkSegmentationEnabled() bool {
11531148
val, present := os.LookupEnv("ENABLE_NETWORK_SEGMENTATION")
11541149
return present && val == "true"

0 commit comments

Comments
 (0)