Skip to content

feat: add SBR detection-mode and NHC+FAR default configs - #276

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift-virtualization:mainfrom
geetikakay:add_node_remediation_config
Aug 4, 2026
Merged

feat: add SBR detection-mode and NHC+FAR default configs#276
openshift-merge-bot[bot] merged 1 commit into
openshift-virtualization:mainfrom
geetikakay:add_node_remediation_config

Conversation

@geetikakay

@geetikakay geetikakay commented Jul 30, 2026

Copy link
Copy Markdown
Contributor
  • Add StorageBasedRemediationConfig asset with detectOnlyMode: Enabled
  • Add NodeHealthCheck asset with FAR as remediator
  • Add storageProfileRWXClass template function to auto-detect RWX Filesystem StorageClass from CDI StorageProfiles
  • Add RBAC for cdi.kubevirt.io/storageprofiles and storage-based-remediation.medik8s.io/storagebasedremediationconfigs
  • Add unit tests for storageProfileRWXClass (single/multiple/none/nil)

Admin can override storage class via platform.kubevirt.io/sbr-storage-class annotation on HCO. User must create fenceagentsremediationtemplate-default in openshift-workload-availability with BMC credentials.

Plan to add e2e in next PR

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown

Hi @geetikakay. Thanks for your PR.

I'm waiting for a openshift-virtualization member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@geetikakay

Copy link
Copy Markdown
Contributor Author

@ksimon1 @jcanocan could you please check

@jcanocan

Copy link
Copy Markdown

@ksimon1 @jcanocan could you please check

Looks good to me, nice job!

@geetikakay
geetikakay marked this pull request as ready for review July 30, 2026 13:40
Comment thread pkg/engine/renderer.go
Comment thread pkg/engine/renderer.go Outdated
Comment thread pkg/engine/renderer.go Outdated
Comment thread pkg/engine/renderer.go Outdated

var candidates []string
for _, profile := range profiles.Items {
sets, found, _ := unstructured.NestedSlice(profile.Object, "status", "claimPropertySets")

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should not be ignoring errors returned by unstructured functions

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't opt to add error checks because it's purely downstream work and both volumeMode and accessModes are schema-required fields within claimPropertySets (enforced by CDI). They cannot be absent in data returned by the API server.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just logging at debug level as a troubleshooting hint for corner cases?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added. I use cause since it is optional so raising error might not be appropriate.

@geetikakay
geetikakay force-pushed the add_node_remediation_config branch from dba76b2 to 62edc11 Compare July 31, 2026 11:27
@tiraboschi

Copy link
Copy Markdown
Member

/ok-to-test

Comment thread assets/active/metadata.yaml Outdated
Comment on lines +760 to +764
# Admin should set platform.kubevirt.io/sbr-storage-class on HCO if multiple RWX classes exist.
- name: sbr-detection-config
path: active/node-remediation/storage-based-remediation-config.yaml.tpl
phase: 1
install: always

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we going to mark this "feature" it as GA as merged or do we prefer to gate it with an opt-in annotation on HCO? see also: #271

@geetikakay geetikakay Aug 3, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did couple of changes(added opt-in). maturity, asserts and requires i could add once 271 is merge

@geetikakay
geetikakay force-pushed the add_node_remediation_config branch 2 times, most recently from 1cb7453 to 0d2f2f1 Compare August 3, 2026 09:00
Comment thread pkg/engine/renderer.go
Comment thread assets/active/node-remediation/nhc-far.yaml Outdated
Comment thread assets/active/node-remediation/nhc-far.yaml Outdated
@geetikakay
geetikakay force-pushed the add_node_remediation_config branch from 0d2f2f1 to 9278df5 Compare August 3, 2026 12:53
@ksimon1

ksimon1 commented Aug 3, 2026

Copy link
Copy Markdown

/lgtm

@openshift-ci

openshift-ci Bot commented Aug 3, 2026

Copy link
Copy Markdown

@ksimon1: changing LGTM is restricted to collaborators

Details

In response to this:

/lgtm

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@geetikakay
geetikakay requested a review from tiraboschi August 4, 2026 03:15
@geetikakay

Copy link
Copy Markdown
Contributor Author

cc @rlobillo

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown
Contributor

Generated Files Verification Failed

One or more generated files in this PR are out of sync:

  • CRDs: Run make update-crds if CRD verification failed
  • RBAC: Run make generate-rbac if RBAC verification failed

Please regenerate the files locally and commit the changes.

@tiraboschi

Copy link
Copy Markdown
Member

@geetikakay in hack/update-crds.sh we also have a script to keep CRDs used in test environment (like test/crds/remediation/storagebasedremediationconfigs.storage-based-remediation.medik8s.io.yaml ) up to date with their upstream counterpart. Could you please add an entry there for storagebasedremediationconfigs one?

- Add StorageBasedRemediationConfig asset with detectOnlyMode: Enabled
- Add NodeHealthCheck asset with FAR as remediator
- Add storageProfileRWXClass template function to auto-detect RWX
  Filesystem StorageClass from CDI StorageProfiles
- Add RBAC for cdi.kubevirt.io/storageprofiles and
  storage-based-remediation.medik8s.io/storagebasedremediationconfigs
- Add unit tests for storageProfileRWXClass (single/multiple/none/nil)

Admin can override storage class via platform.kubevirt.io/sbr-storage-class
annotation on HCO. User must create fenceagentsremediationtemplate-default
in openshift-workload-availability with BMC credentials.

Signed-off-by: Geetika Kapoor <gkapoor@redhat.com>
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
@geetikakay
geetikakay force-pushed the add_node_remediation_config branch from 9278df5 to 397077e Compare August 4, 2026 10:31
@tiraboschi

Copy link
Copy Markdown
Member

/lgtm

@tiraboschi

Copy link
Copy Markdown
Member

/approve

@openshift-ci openshift-ci Bot added the lgtm label Aug 4, 2026
@openshift-ci

openshift-ci Bot commented Aug 4, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: tiraboschi

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved label Aug 4, 2026
@openshift-merge-bot
openshift-merge-bot Bot merged commit 68df086 into openshift-virtualization:main Aug 4, 2026
7 checks passed
Comment thread cmd/rbac-gen/main.go
case "fence-agents-remediation.medik8s.io":
return "Fence Agents Remediation"
case "storage-based-remediation.medik8s.io":
return "Storage Based Remediation"

@razo7 razo7 Aug 12, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The official name has a hyphen

Suggested change
return "Storage Based Remediation"
return "Storage-Based Remediation"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@razo7 ack. #301

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants