Skip to content

OCPBUGS-99650: Delete stale auto-sizing MachineConfigs for non-default (custom) pools 4.20 - #6335

Open
aksjadha wants to merge 1 commit into
openshift:release-4.20from
aksjadha:fix-OCPBUGS-99650
Open

OCPBUGS-99650: Delete stale auto-sizing MachineConfigs for non-default (custom) pools 4.20#6335
aksjadha wants to merge 1 commit into
openshift:release-4.20from
aksjadha:fix-OCPBUGS-99650

Conversation

@aksjadha

@aksjadha aksjadha commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Fixes: OCPBUGS-99650

- What I did

Fixed stale 50-{pool}-auto-sizing-disabled MachineConfigs persisting on non-default pools after upgrade from 4.20.24 or earlier. Restarting machine-config-controller creating 50-{pool}-auto-sizing-disabled MachineConfigs for custom pools.

OCPBUGS-83862 (shipped in 4.20.25) stopped creating auto-sizing MachineConfigs for non-default pools, but never cleaned up ones already created by older MCO versions. These stale MachineConfigs mask autoscaling configuration in KubeletConfigs for custom pool nodes.

Modified ensureAutoSizingMachineConfigs to iterate all MachineConfigPools on controller startup:

  • Master/worker pools: create auto-sizing MC if missing (existing behavior)
  • Non-default pools: delete the auto-sizing MC if it exists

- How to verify it

  1. Launch a cluster on 4.20.24
  2. oc apply -f mcp.yaml to add a custom MachineConfigPool
  3. oc -n openshift-machine-config-operator delete pods -l k8s-app=machine-config-controller
  4. Verify 50-custom-auto-sizing-disabled gets created
  5. Upgrade to a version containing this fix
  6. oc get machineconfigs | grep auto-sizing — only 50-master-auto-sizing-disabled and 50-worker-auto-sizing-disabled should remain

- Description for the changelog

Delete stale auto-sizing-disabled MachineConfigs for non-default pools on controller startup to fix custom pool nodes affected after upgrade clusters.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 24, 2026
@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@aksjadha: This pull request references Jira Issue OCPBUGS-99650, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected Jira Issue OCPBUGS-99650 to depend on a bug targeting a version in 4.21.0, 4.21.z and in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but no dependents were found

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Fixes: OCPBUGS-99650

- What I did

Fixed stale 50-{pool}-auto-sizing-disabled MachineConfigs persisting on non-default pools after upgrade from 4.20.24 or earlier. Restarting machine-config-controller creating 50-{pool}-auto-sizing-disabled MachineConfigs for custom pools.

OCPBUGS-83862 (shipped in 4.20.25) stopped creating auto-sizing MachineConfigs for non-default pools, but never cleaned up ones already created by older MCO versions. These stale MachineConfigs mask autoscaling configuration in KubeletConfigs for custom pool nodes.

Modified ensureAutoSizingMachineConfigs to iterate all MachineConfigPools on controller startup:

  • Master/worker pools: create auto-sizing MC if missing (existing behavior)
  • Non-default pools: delete the auto-sizing MC if it exists

- How to verify it

  1. Launch a cluster on 4.20.24
  2. oc apply -f mcp.yaml to add a custom MachineConfigPool
  3. oc -n openshift-machine-config-operator delete pods -l k8s-app=machine-config-controller
  4. Verify 50-custom-auto-sizing-disabled gets created
  5. Upgrade to a version containing this fix
  6. oc get machineconfigs | grep auto-sizing — only 50-master-auto-sizing-disabled and 50-worker-auto-sizing-disabled should remain

- Description for the changelog

Delete stale auto-sizing-disabled MachineConfigs for non-default pools on controller startup to fix custom pool nodes affected after upgrade clusters.

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 openshift-eng/jira-lifecycle-plugin repository.

@coderabbitai

coderabbitai Bot commented Jul 24, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: b2d329f7-3604-427d-88db-c43cb6d29fbd

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@aksjadha

Copy link
Copy Markdown
Contributor Author

Manually verified that the MCC is working as expected. During MCC reconciliation, the older custom autosizing MachineConfig is removed, leaving only the master and worker autosizing MachineConfigs.

# oc get clusterversion
NAME      VERSION                                                AVAILABLE   PROGRESSING   SINCE   STATUS
version   4.20.0-0-2026-07-24-084507-test-ci-ln-71zxh7t-latest   True        False         44m     Cluster version is 4.20.0-0-2026-07-24-084507-test-ci-ln-71zxh7t-latest

# oc get mc|grep 50      
50-custom-auto-sizing-disabled                                                                 3.5.0             16s
50-master-auto-sizing-disabled                                                                 3.5.0             62m
50-worker-auto-sizing-disabled                                                                 3.5.0             62m

# oc -n openshift-machine-config-operator delete pods -l k8s-app=machine-config-controller
pod "machine-config-controller-7649575fb4-b844r" deleted

# oc get mc|grep 50                                        
50-master-auto-sizing-disabled                                                                 3.5.0             63m
50-worker-auto-sizing-disabled                                                                 3.5.0             63m

Additionally, I deleted all three MachineConfigs (50-custom-auto-sizing-disabled, 50-master-auto-sizing-disabled, and 50-worker-auto-sizing-disabled). After restarting the MCC, only 50-master-auto-sizing-disabled and 50-worker-auto-sizing-disabled were recreated, confirming that the custom autosizing MachineConfig is no longer regenerated during reconciliation.

@aksjadha
aksjadha marked this pull request as ready for review July 24, 2026 10:22
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 24, 2026
@aksjadha

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@aksjadha: This pull request references Jira Issue OCPBUGS-99650, which is invalid:

  • expected the bug to target either version "4.20." or "openshift-4.20.", but it targets "4.21.z" instead
  • expected dependent Jira Issue OCPBUGS-99674 to target a version in 4.21.0, 4.21.z, but it targets "4.20.z" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@aksjadha

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Jul 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@aksjadha: This pull request references Jira Issue OCPBUGS-99650, which is valid. The bug has been moved to the POST state.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.z) matches configured target version for branch (4.20.z)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-99674 is in the state Closed (Done), which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-99674 targets the "4.21.z" version, which is one of the valid target versions: 4.21.0, 4.21.z
  • bug has dependents
Details

In response to this:

/jira refresh

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Jul 24, 2026
@aksjadha

Copy link
Copy Markdown
Contributor Author

/ok-to-test

@openshift-ci openshift-ci Bot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Jul 24, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@aksjadha: This pull request references Jira Issue OCPBUGS-99650, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.z) matches configured target version for branch (4.20.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-99674 is in the state Closed (Done), which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-99674 targets the "4.21.z" version, which is one of the valid target versions: 4.21.0, 4.21.z
  • bug has dependents
Details

In response to this:

Fixes: OCPBUGS-99650

- What I did

Fixed stale 50-{pool}-auto-sizing-disabled MachineConfigs persisting on non-default pools after upgrade from 4.20.24 or earlier. Restarting machine-config-controller creating 50-{pool}-auto-sizing-disabled MachineConfigs for custom pools.

OCPBUGS-83862 (shipped in 4.20.25) stopped creating auto-sizing MachineConfigs for non-default pools, but never cleaned up ones already created by older MCO versions. These stale MachineConfigs mask autoscaling configuration in KubeletConfigs for custom pool nodes.

Modified ensureAutoSizingMachineConfigs to iterate all MachineConfigPools on controller startup:

  • Master/worker pools: create auto-sizing MC if missing (existing behavior)
  • Non-default pools: delete the auto-sizing MC if it exists

- How to verify it

  1. Launch a cluster on 4.20.24
  2. oc apply -f mcp.yaml to add a custom MachineConfigPool
  3. oc -n openshift-machine-config-operator delete pods -l k8s-app=machine-config-controller
  4. Verify 50-custom-auto-sizing-disabled gets created
  5. Upgrade to a version containing this fix
  6. oc get machineconfigs | grep auto-sizing — only 50-master-auto-sizing-disabled and 50-worker-auto-sizing-disabled should remain

- Description for the changelog

Delete stale auto-sizing-disabled MachineConfigs for non-default pools on controller startup to fix custom pool nodes affected after upgrade clusters.

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 openshift-eng/jira-lifecycle-plugin repository.

@aksjadha
aksjadha force-pushed the fix-OCPBUGS-99650 branch from f56f4b7 to e0d9dd7 Compare July 24, 2026 12:56
@aksjadha

Copy link
Copy Markdown
Contributor Author

/retest

Comment thread pkg/controller/kubelet-config/kubelet_config_autosizing.go
@pablintino

Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 27, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aws-ovn
/test e2e-aws-ovn-upgrade
/test e2e-gcp-op-ocl
/test e2e-gcp-op-ocl-part1
/test e2e-gcp-op-ocl-part2
/test e2e-gcp-op-part1
/test e2e-gcp-op-part2
/test e2e-gcp-op-single-node
/test e2e-hypershift

@openshift-ci

openshift-ci Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: aksjadha, pablintino

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 Indicates a PR has been approved by an approver from all required OWNERS files. label Jul 27, 2026
@aksjadha

Copy link
Copy Markdown
Contributor Author

/retest

@openshift-ci

openshift-ci Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

@aksjadha: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-op-ocl e0d9dd7 link false /test e2e-gcp-op-ocl

Full PR test history. Your PR dashboard.

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. I understand the commands that are listed here.

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

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants