Skip to content

Commit 816598a

Browse files
authored
Merge pull request #5298 from aserdean/ovn_ic_dpu_bash
ovnkube.sh: Add new overwriting options for the gateway options and kubernetes node name
2 parents 11ca0ec + 05f8d8f commit 816598a

File tree

2 files changed

+68
-8
lines changed

2 files changed

+68
-8
lines changed

dist/images/ovnkube.sh

Lines changed: 32 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,16 @@ ovn_nohostsubnet_label=${OVN_NOHOSTSUBNET_LABEL:-""}
324324
# should be set to true when dpu nodes are in the cluster
325325
ovn_disable_requestedchassis=${OVN_DISABLE_REQUESTEDCHASSIS:-false}
326326

327+
# external_ids:host-k8s-nodename is set on an Open_vSwitch enabled system if the ovnkube stack
328+
# should function on behalf of a different host than external_ids:hostname. This includes
329+
# all the components that belond in an ovnkube stack (i.e. NB DB, SB DB, ovnkube etc)
330+
# overwrite the K8S_NODE env var with the one found within the OVS metadata in this case
331+
ovn_k8s_node=$(ovs-vsctl --if-exists get Open_vSwitch . external_ids:host-k8s-nodename | tr -d '\"')
332+
if [[ ! -z $ovn_k8s_node ]]; then
333+
echo "host-k8s-nodename is set, overriding K8S_NODE with $ovn_k8s_node"
334+
K8S_NODE=$ovn_k8s_node
335+
fi
336+
327337
# Determine the ovn rundir.
328338
if [[ -f /usr/bin/ovn-appctl ]]; then
329339
# ovn-appctl is present. Use new ovn run dir path.
@@ -1356,6 +1366,7 @@ ovn-master() {
13561366
${network_qos_enabled_flag} \
13571367
${ovn_enable_dnsnameresolver_flag} \
13581368
${nohostsubnet_label_option} \
1369+
${ovn_stateless_netpol_enable_flag} \
13591370
${ovn_disable_requestedchassis_flag} \
13601371
--cluster-subnets ${net_cidr} --k8s-service-cidr=${svc_cidr} \
13611372
--gateway-mode=${ovn_gateway_mode} ${ovn_gateway_opts} \
@@ -1626,6 +1637,13 @@ ovnkube-controller() {
16261637
fi
16271638
echo "ovn_observ_enable_flag=${ovn_observ_enable_flag}"
16281639

1640+
1641+
ovn_stateless_netpol_enable_flag=
1642+
if [[ ${ovn_stateless_netpol_enable} == "true" ]]; then
1643+
ovn_stateless_netpol_enable_flag="--enable-stateless-netpol"
1644+
fi
1645+
echo "ovn_stateless_netpol_enable_flag: ${ovn_stateless_netpol_enable_flag}"
1646+
16291647
echo "=============== ovnkube-controller ========== MASTER ONLY"
16301648
/usr/bin/ovnkube --init-ovnkube-controller ${K8S_NODE} \
16311649
${anp_enabled_flag} \
@@ -2054,6 +2072,11 @@ ovnkube-controller-with-node() {
20542072
fi
20552073
echo "ovn_observ_enable_flag=${ovn_observ_enable_flag}"
20562074

2075+
ovn_stateless_netpol_enable_flag=
2076+
if [[ ${ovn_stateless_netpol_enable} == "true" ]]; then
2077+
ovn_stateless_netpol_enable_flag="--enable-stateless-netpol"
2078+
fi
2079+
20572080
echo "=============== ovnkube-controller-with-node --init-ovnkube-controller-with-node=========="
20582081
/usr/bin/ovnkube --init-ovnkube-controller ${K8S_NODE} --init-node ${K8S_NODE} \
20592082
${anp_enabled_flag} \
@@ -2399,8 +2422,15 @@ ovn-node() {
23992422
wait_for_event ovs_ready
24002423
fi
24012424

2402-
echo "=============== ovn-node - (wait for ready_to_start_node)"
2403-
wait_for_event ready_to_start_node
2425+
if [[ ${ovnkube_node_mode} == "dpu-host" ]] && [[ ${ovn_enable_interconnect} == "true" ]]; then
2426+
# ready_to_start_node checks for the NB/SB readiness state.
2427+
# This is not available on the DPU host when interconnect is enabled,
2428+
# because the DBs will run locally on the DPU
2429+
echo "skipping ready_to_start_node on DPU Host and when interconnect is true"
2430+
else
2431+
echo "=============== ovn-node - (wait for ready_to_start_node)"
2432+
wait_for_event ready_to_start_node
2433+
fi
24042434

24052435
echo "ovn_nbdb ${ovn_nbdb} ovn_sbdb ${ovn_sbdb} ovn_nbdb_conn ${ovn_nbdb_conn}"
24062436

@@ -2578,12 +2608,6 @@ ovn-node() {
25782608
fi
25792609

25802610
if [[ ${ovnkube_node_mode} == "dpu" ]]; then
2581-
# in the case of dpu mode we want the host K8s Node Name and not the DPU K8s Node Name
2582-
K8S_NODE=$(ovs-vsctl --if-exists get Open_vSwitch . external_ids:host-k8s-nodename | tr -d '\"')
2583-
if [[ ${K8S_NODE} == "" ]]; then
2584-
echo "Couldn't get the required Host K8s Nodename. Exiting..."
2585-
exit 1
2586-
fi
25872611
if [[ ${ovn_gateway_opts} == "" ]]; then
25882612
# get the gateway interface
25892613
gw_iface=$(ovs-vsctl --if-exists get Open_vSwitch . external_ids:ovn-gw-interface | tr -d \")

docs/features/hardware-offload/dpu-support.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,39 @@ on the embedded CPU.
1717
Any vendor that manufactures a DPU which supports the above model should work with current design.
1818

1919
Design document can be found [here](https://docs.google.com/document/d/11IoMKiohK7hIyIE36FJmwJv46DEBx52a4fqvrpCBBcg/edit?usp=sharing).
20+
21+
## OVN Kubernetes in a DPU-Accelerated Environment
22+
23+
The **ovn-kubernetes** deployment will have two parts one on the host and another on the DPU side.
24+
25+
26+
These aforementioned parts are expected to be deployed also on two different Kubernetes clusters, one for the host and another for the DPUs.
27+
28+
29+
### Host Cluster
30+
---
31+
32+
#### OVN Kubernetes control plane related component
33+
- ovn-cluster-manager
34+
35+
#### OVN Kubernetes components on a Standard Host (Non-DPU)
36+
- local-nb-ovsdb
37+
- local-sb-ovsdb
38+
- run-ovn-northd
39+
- ovnkube-controller-with-node
40+
- ovn-controller
41+
- ovs-metrics
42+
43+
#### OVN Kubernetes component on a DPU-Enabled Host
44+
- ovn-node
45+
46+
### DPU Cluster
47+
---
48+
49+
#### OVN Kubernetes components
50+
- local-nb-ovsdb
51+
- local-sb-ovsdb
52+
- run-ovn-northd
53+
- ovnkube-controller-with-node
54+
- ovn-controller
55+
- ovs-metrics

0 commit comments

Comments
 (0)