@@ -64,6 +64,11 @@ const OVN_NODE_SELECTOR_DEFAULT_DPU = "network.operator.openshift.io/dpu="
6464const OVN_NODE_SELECTOR_DEFAULT_SMART_NIC = "network.operator.openshift.io/smart-nic="
6565const OVN_NODE_IDENTITY_CERT_DURATION = "24h"
6666
67+ // Default DPU health check lease configuration.
68+ // Setting renew-interval to 0 disables the health check.
69+ const DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT = 10
70+ const DPU_NODE_LEASE_DURATION_DEFAULT = 40
71+
6772// gRPC healthcheck port. See: https://github.com/openshift/enhancements/pull/1209
6873const OVN_EGRESSIP_HEALTHCHECK_PORT = "9107"
6974
@@ -218,6 +223,8 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo
218223 data .Data ["SmartNicModeLabel" ] = bootstrapResult .OVN .OVNKubernetesConfig .SmartNicModeLabel
219224 data .Data ["SmartNicModeValue" ] = bootstrapResult .OVN .OVNKubernetesConfig .SmartNicModeValue
220225 data .Data ["MgmtPortResourceName" ] = bootstrapResult .OVN .OVNKubernetesConfig .MgmtPortResourceName
226+ data .Data ["DpuNodeLeaseRenewInterval" ] = strconv .Itoa (bootstrapResult .OVN .OVNKubernetesConfig .DpuNodeLeaseRenewInterval )
227+ data .Data ["DpuNodeLeaseDuration" ] = strconv .Itoa (bootstrapResult .OVN .OVNKubernetesConfig .DpuNodeLeaseDuration )
221228 data .Data ["OVN_CONTROLLER_INACTIVITY_PROBE" ] = os .Getenv ("OVN_CONTROLLER_INACTIVITY_PROBE" )
222229 controller_inactivity_probe := os .Getenv ("OVN_CONTROLLER_INACTIVITY_PROBE" )
223230 if len (controller_inactivity_probe ) == 0 {
@@ -927,10 +934,12 @@ func findCommonNode(nodeLists ...[]string) (bool, string) {
927934// if it exists, otherwise returns default configuration for OCP clusters using OVN-Kubernetes
928935func bootstrapOVNConfig (conf * operv1.Network , kubeClient cnoclient.Client , hc * hypershift.HyperShiftConfig , infraStatus * bootstrap.InfraStatus ) (* bootstrap.OVNConfigBoostrapResult , error ) {
929936 ovnConfigResult := & bootstrap.OVNConfigBoostrapResult {
930- DpuHostModeLabel : OVN_NODE_SELECTOR_DEFAULT_DPU_HOST ,
931- DpuModeLabel : OVN_NODE_SELECTOR_DEFAULT_DPU ,
932- SmartNicModeLabel : OVN_NODE_SELECTOR_DEFAULT_SMART_NIC ,
933- MgmtPortResourceName : "" ,
937+ DpuHostModeLabel : OVN_NODE_SELECTOR_DEFAULT_DPU_HOST ,
938+ DpuModeLabel : OVN_NODE_SELECTOR_DEFAULT_DPU ,
939+ SmartNicModeLabel : OVN_NODE_SELECTOR_DEFAULT_SMART_NIC ,
940+ MgmtPortResourceName : "" ,
941+ DpuNodeLeaseRenewInterval : DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT ,
942+ DpuNodeLeaseDuration : DPU_NODE_LEASE_DURATION_DEFAULT ,
934943 }
935944 if conf .Spec .DefaultNetwork .OVNKubernetesConfig .GatewayConfig == nil {
936945 bootstrapOVNGatewayConfig (conf , kubeClient .ClientFor ("" ).CRClient ())
@@ -976,6 +985,33 @@ func bootstrapOVNConfig(conf *operv1.Network, kubeClient cnoclient.Client, hc *h
976985 if exists {
977986 ovnConfigResult .MgmtPortResourceName = mgmtPortresourceName
978987 }
988+
989+ if val , exists := cm .Data ["dpu-node-lease-renew-interval" ]; exists {
990+ parsed , err := strconv .Atoi (val )
991+ if err == nil && parsed >= 0 {
992+ ovnConfigResult .DpuNodeLeaseRenewInterval = parsed
993+ } else {
994+ klog .Warningf ("Invalid dpu-node-lease-renew-interval %q, using default %d" , val , DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT )
995+ }
996+ }
997+ if val , exists := cm .Data ["dpu-node-lease-duration" ]; exists {
998+ parsed , err := strconv .Atoi (val )
999+ if err == nil && parsed >= 0 {
1000+ ovnConfigResult .DpuNodeLeaseDuration = parsed
1001+ } else {
1002+ klog .Warningf ("Invalid dpu-node-lease-duration %q, using default %d" , val , DPU_NODE_LEASE_DURATION_DEFAULT )
1003+ }
1004+ }
1005+
1006+ // Setting either value to 0 disables the DPU health check.
1007+ // When both are non-zero, duration must be greater than interval.
1008+ if ovnConfigResult .DpuNodeLeaseRenewInterval != 0 && ovnConfigResult .DpuNodeLeaseDuration != 0 &&
1009+ ovnConfigResult .DpuNodeLeaseDuration <= ovnConfigResult .DpuNodeLeaseRenewInterval {
1010+ klog .Warningf ("dpu-node-lease-duration (%d) must be greater than dpu-node-lease-renew-interval (%d), using defaults" ,
1011+ ovnConfigResult .DpuNodeLeaseDuration , ovnConfigResult .DpuNodeLeaseRenewInterval )
1012+ ovnConfigResult .DpuNodeLeaseRenewInterval = DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT
1013+ ovnConfigResult .DpuNodeLeaseDuration = DPU_NODE_LEASE_DURATION_DEFAULT
1014+ }
9791015 }
9801016
9811017 // We want to see if there are any nodes that are labeled for specific modes such as Full/SmartNIC/DPU Host/DPU
0 commit comments