-
Notifications
You must be signed in to change notification settings - Fork 277
NVIDIA-596: Enable dpu healthcheck #2941
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -65,6 +65,11 @@ const OVN_NODE_SELECTOR_DEFAULT_DPU = "network.operator.openshift.io/dpu=" | |||||||||||||||||||||||||||||||||||||||||
| const OVN_NODE_SELECTOR_DEFAULT_SMART_NIC = "network.operator.openshift.io/smart-nic=" | ||||||||||||||||||||||||||||||||||||||||||
| const OVN_NODE_IDENTITY_CERT_DURATION = "24h" | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // Default DPU health check lease configuration. | ||||||||||||||||||||||||||||||||||||||||||
| // Setting renew-interval to 0 disables the health check. | ||||||||||||||||||||||||||||||||||||||||||
| const DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT = 10 | ||||||||||||||||||||||||||||||||||||||||||
| const DPU_NODE_LEASE_DURATION_DEFAULT = 40 | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // gRPC healthcheck port. See: https://github.com/openshift/enhancements/pull/1209 | ||||||||||||||||||||||||||||||||||||||||||
| const OVN_EGRESSIP_HEALTHCHECK_PORT = "9107" | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -232,6 +237,8 @@ func renderOVNKubernetes(conf *operv1.NetworkSpec, bootstrapResult *bootstrap.Bo | |||||||||||||||||||||||||||||||||||||||||
| data.Data["SmartNicModeLabel"] = bootstrapResult.OVN.OVNKubernetesConfig.SmartNicModeLabel | ||||||||||||||||||||||||||||||||||||||||||
| data.Data["SmartNicModeValue"] = bootstrapResult.OVN.OVNKubernetesConfig.SmartNicModeValue | ||||||||||||||||||||||||||||||||||||||||||
| data.Data["MgmtPortResourceName"] = bootstrapResult.OVN.OVNKubernetesConfig.MgmtPortResourceName | ||||||||||||||||||||||||||||||||||||||||||
| data.Data["DpuNodeLeaseRenewInterval"] = strconv.Itoa(bootstrapResult.OVN.OVNKubernetesConfig.DpuNodeLeaseRenewInterval) | ||||||||||||||||||||||||||||||||||||||||||
| data.Data["DpuNodeLeaseDuration"] = strconv.Itoa(bootstrapResult.OVN.OVNKubernetesConfig.DpuNodeLeaseDuration) | ||||||||||||||||||||||||||||||||||||||||||
| data.Data["OVN_CONTROLLER_INACTIVITY_PROBE"] = os.Getenv("OVN_CONTROLLER_INACTIVITY_PROBE") | ||||||||||||||||||||||||||||||||||||||||||
| controller_inactivity_probe := os.Getenv("OVN_CONTROLLER_INACTIVITY_PROBE") | ||||||||||||||||||||||||||||||||||||||||||
| if len(controller_inactivity_probe) == 0 { | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1015,10 +1022,12 @@ func findCommonNode(nodeLists ...[]string) (bool, string) { | |||||||||||||||||||||||||||||||||||||||||
| // if it exists, otherwise returns default configuration for OCP clusters using OVN-Kubernetes | ||||||||||||||||||||||||||||||||||||||||||
| func bootstrapOVNConfig(conf *operv1.Network, kubeClient cnoclient.Client, hc *hypershift.HyperShiftConfig, infraStatus *bootstrap.InfraStatus) (*bootstrap.OVNConfigBoostrapResult, error) { | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult := &bootstrap.OVNConfigBoostrapResult{ | ||||||||||||||||||||||||||||||||||||||||||
| DpuHostModeLabel: OVN_NODE_SELECTOR_DEFAULT_DPU_HOST, | ||||||||||||||||||||||||||||||||||||||||||
| DpuModeLabel: OVN_NODE_SELECTOR_DEFAULT_DPU, | ||||||||||||||||||||||||||||||||||||||||||
| SmartNicModeLabel: OVN_NODE_SELECTOR_DEFAULT_SMART_NIC, | ||||||||||||||||||||||||||||||||||||||||||
| MgmtPortResourceName: "", | ||||||||||||||||||||||||||||||||||||||||||
| DpuHostModeLabel: OVN_NODE_SELECTOR_DEFAULT_DPU_HOST, | ||||||||||||||||||||||||||||||||||||||||||
| DpuModeLabel: OVN_NODE_SELECTOR_DEFAULT_DPU, | ||||||||||||||||||||||||||||||||||||||||||
| SmartNicModeLabel: OVN_NODE_SELECTOR_DEFAULT_SMART_NIC, | ||||||||||||||||||||||||||||||||||||||||||
| MgmtPortResourceName: "", | ||||||||||||||||||||||||||||||||||||||||||
| DpuNodeLeaseRenewInterval: DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT, | ||||||||||||||||||||||||||||||||||||||||||
| DpuNodeLeaseDuration: DPU_NODE_LEASE_DURATION_DEFAULT, | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| if conf.Spec.DefaultNetwork.OVNKubernetesConfig.GatewayConfig == nil { | ||||||||||||||||||||||||||||||||||||||||||
| bootstrapOVNGatewayConfig(conf, kubeClient.ClientFor("").CRClient()) | ||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -1064,6 +1073,33 @@ func bootstrapOVNConfig(conf *operv1.Network, kubeClient cnoclient.Client, hc *h | |||||||||||||||||||||||||||||||||||||||||
| if exists { | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.MgmtPortResourceName = mgmtPortresourceName | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| if val, exists := cm.Data["dpu-node-lease-renew-interval-in-seconds"]; exists { | ||||||||||||||||||||||||||||||||||||||||||
| parsed, err := strconv.Atoi(val) | ||||||||||||||||||||||||||||||||||||||||||
| if err == nil && parsed >= 0 { | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.DpuNodeLeaseRenewInterval = parsed | ||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||
| klog.Warningf("Invalid dpu-node-lease-renew-interval-in-seconds %q, using default %d", val, DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| if val, exists := cm.Data["dpu-node-lease-duration-in-seconds"]; exists { | ||||||||||||||||||||||||||||||||||||||||||
| parsed, err := strconv.Atoi(val) | ||||||||||||||||||||||||||||||||||||||||||
| if err == nil && parsed >= 0 { | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.DpuNodeLeaseDuration = parsed | ||||||||||||||||||||||||||||||||||||||||||
| } else { | ||||||||||||||||||||||||||||||||||||||||||
| klog.Warningf("Invalid dpu-node-lease-duration-in-seconds %q, using default %d", val, DPU_NODE_LEASE_DURATION_DEFAULT) | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // Setting either value to 0 disables the DPU health check. | ||||||||||||||||||||||||||||||||||||||||||
| // When both are non-zero, duration must be greater than interval. | ||||||||||||||||||||||||||||||||||||||||||
| if ovnConfigResult.DpuNodeLeaseRenewInterval != 0 && ovnConfigResult.DpuNodeLeaseDuration != 0 && | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.DpuNodeLeaseDuration <= ovnConfigResult.DpuNodeLeaseRenewInterval { | ||||||||||||||||||||||||||||||||||||||||||
| klog.Warningf("dpu-node-lease-duration-in-seconds (%d) must be greater than dpu-node-lease-renew-interval-in-seconds (%d), using defaults", | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.DpuNodeLeaseDuration, ovnConfigResult.DpuNodeLeaseRenewInterval) | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.DpuNodeLeaseRenewInterval = DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT | ||||||||||||||||||||||||||||||||||||||||||
| ovnConfigResult.DpuNodeLeaseDuration = DPU_NODE_LEASE_DURATION_DEFAULT | ||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+1094
to
+1102
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Normalize disable semantics when either lease value is Line 1094 says either value disables health check, but current flow can still render flags when renew interval is non-zero and duration is Proposed fix- // Setting either value to 0 disables the DPU health check.
- // When both are non-zero, duration must be greater than interval.
- if ovnConfigResult.DpuNodeLeaseRenewInterval != 0 && ovnConfigResult.DpuNodeLeaseDuration != 0 &&
- ovnConfigResult.DpuNodeLeaseDuration <= ovnConfigResult.DpuNodeLeaseRenewInterval {
+ // Setting either value to 0 disables the DPU health check.
+ if ovnConfigResult.DpuNodeLeaseRenewInterval == 0 || ovnConfigResult.DpuNodeLeaseDuration == 0 {
+ ovnConfigResult.DpuNodeLeaseRenewInterval = 0
+ ovnConfigResult.DpuNodeLeaseDuration = 0
+ } else if ovnConfigResult.DpuNodeLeaseDuration <= ovnConfigResult.DpuNodeLeaseRenewInterval {
+ // When both are non-zero, duration must be greater than interval.
klog.Warningf("dpu-node-lease-duration-in-seconds (%d) must be greater than dpu-node-lease-renew-interval-in-seconds (%d), using defaults",
ovnConfigResult.DpuNodeLeaseDuration, ovnConfigResult.DpuNodeLeaseRenewInterval)
ovnConfigResult.DpuNodeLeaseRenewInterval = DPU_NODE_LEASE_RENEW_INTERVAL_DEFAULT
ovnConfigResult.DpuNodeLeaseDuration = DPU_NODE_LEASE_DURATION_DEFAULT
}📝 Committable suggestion
Suggested change
🤖 Prompt for AI Agents |
||||||||||||||||||||||||||||||||||||||||||
| } | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
| // We want to see if there are any nodes that are labeled for specific modes such as Full/SmartNIC/DPU Host/DPU | ||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Multus was updated to the new version which enables CNI status