Skip to content

feat: switch nodeaffinity from required to prefer for OLM#133

Closed
bhpratt wants to merge 3 commits into
ROCm:mainfrom
bhpratt:main
Closed

feat: switch nodeaffinity from required to prefer for OLM#133
bhpratt wants to merge 3 commits into
ROCm:mainfrom
bhpratt:main

Conversation

@bhpratt

@bhpratt bhpratt commented Apr 10, 2025

Copy link
Copy Markdown
Contributor

This is related to: #129

There are a few ways to address this issue, but here is one idea - to switch nodeaffinity from Required to Preferred.

I did not update the Helm charts, as those appear to have a different flow (and do have a path to override nodeAffinity). However, I can add those to this PR as well.

@yansun1996

Copy link
Copy Markdown
Member

Hi @bhpratt thanks for the PR we will evaluate this change and get back to you

@yansun1996 yansun1996 self-assigned this Apr 10, 2025
…cheduling

Amend some details for nodeAffinity preferredDuringSchedulingIgnoredDuringExecution
Amend more details to use nodeAffinity preferredDuringSchedulingIgnoredDuringExecution
@yansun1996

Copy link
Copy Markdown
Member

@bhpratt your commit has been picked up to the main branch 0bd7906 and you have been recorded as contributor to this repo, Thanks for your suggestion !

@yansun1996 yansun1996 closed this May 8, 2025
spraveenio added a commit that referenced this pull request Jul 11, 2026
…readiness (#599)

* fix(kmm): gate ContainerStatusUnknown pod deletion on node readiness (#1595)

* fix(kmm): gate ContainerStatusUnknown pod deletion on node readiness

When a KMM build pod hits ContainerStatusUnknown due to a NodeNotReady
event, deleting it immediately causes KMM to spawn a replacement build
pod before the kubelet's volume registry has re-synced. The replacement
then fails with FailedMount on the Dockerfile ConfigMap (the ConfigMap
exists in etcd but the kubelet's in-memory volume plugin registry is
stale from the network partition window).

Gate the deletion on the node's current Ready condition. If the node is
still NotReady, skip deletion — the pod will transition to Failed once
the node recovers, firing another Update event at which point deletion
proceeds and KMM's replacement starts cleanly.

Observed in CI job 32149765 (test_driver_upgrade_cycle[30.30],
asrock-126-b3-1b, ubuntu-22.04, kernel 6.8.0-100-generic).

Plan: docs-internal/knowledge/plans/2026-07-10-kmm-build-pod-node-readiness-gate.md

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(kmm): gate ContainerStatusUnknown pod deletion on node readiness

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(kmm): address copilot review comments

- Scope node-readiness check to KMM builder pods only (pod-type=builder)
- Add node name to node GET error log
- Use structured logging for delete failure

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(kmm): correct build pod-type label value from "builder" to "build"

The build-pod gate and the pre-existing hasExpectedPodLabel watch predicate
both matched kmm.node.kubernetes.io/pod-type == "builder". The deployed KMM
(ROCm fork, release-v1.5.0) labels build pods pod-type=build (PodTypeBuild in
internal/utils/podhelper.go); "builder" never matched, so both the
node-readiness gate and the original auto-remove-unknown-build-pod feature
(PR #133) were dead code against ROCm KMM.

Correct both sites to "build" via shared local constants. KMM's constant
lives in an internal, non-importable package, so the value is duplicated.

Addresses review feedback from spraveenio on PR #1595.

Co-Authored-By: Claude <noreply@anthropic.com>

* fix(kmm): extend ContainerStatusUnknown node-readiness gate to sign pods

Sign pods share KMM's recreate-if-missing lifecycle (internal/sign/pod/manager.go
Sync respawns a missing sign pod exactly as the build manager does) and are real in
this deployment via the ImageSign secure-boot spec. Extend the gate and the watch
predicate to admit pod-type in {build, sign} via a shared isKMMBuildOrSignPod helper.

Worker (workerMgr) pods are intentionally excluded: they mount HostPath volumes, not
the Dockerfile ConfigMap, so the FailedMount race does not apply, and they have a
dedicated lifecycle path respawned by our own workermgr reconcile.

Co-Authored-By: Claude <noreply@anthropic.com>

---------

Co-authored-by: Claude <noreply@anthropic.com>
(cherry picked from commit f25b3614fe194aa5498af3f9bd7a7b16a91ec1c1)

* Delete docs-internal/knowledge/plans/2026-07-10-kmm-build-pod-node-readiness-gate.md

---------

Co-authored-by: Yan Sun <Yan.Sun3@amd.com>
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Praveen Kumar Shanmugam <58961022+spraveenio@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants