Skip to content

fix(kops): apply control-plane instance group overrides - #18800

Closed
divyanshuprakas-h wants to merge 1 commit into
kubernetes:masterfrom
divyanshuprakas-h:fix-kops-control-plane-overrides
Closed

divyanshuprakas-h wants to merge 1 commit into
kubernetes:masterfrom
divyanshuprakas-h:fix-kops-control-plane-overrides

Conversation

@divyanshuprakas-h

@divyanshuprakas-h divyanshuprakas-h commented Sep 21, 2026 •

Copy link
Copy Markdown

What type of PR is this?

/kind bug

What this PR does

The kOps kubetest2 deployer was checking for the Master instance group role when applying control-plane instance group overrides.

kOps instance groups use the ControlPlane role, so control-plane overrides were never applied.

This caused --control-plane-instance-group-overrides to be silently skipped. In the affected e2e job, the configured:

spec.rootVolume.type=io2

override therefore never reached the generated AWS LaunchTemplate, which continued to use the default gp3 root volume type.

This PR:

  • changes the role check from Master to ControlPlane
  • adds a regression test verifying control-plane overrides are passed to kops edit instancegroup
  • adds coverage for rootVolume.type=io2 through the edit/set and AWS model paths

Testing

  • GOWORK=off go test ./pkg/commands -run 'TestSetInstanceGroupsFields' -v
  • GOWORK=off go test ./cmd/kops -run '^TestEditInstanceGroup$' -v
  • GOWORK=off go test ./pkg/model/awsmodel -run '^TestRootVolumeOptimizationFlag$' -v
  • GOWORK=off go test ./tests/e2e/kubetest2-kops/deployer -run '^TestSetInstanceGroupOverridesControlPlane$' -v
  • git diff --check

Related issue

Related to kubernetes/kubernetes#142282

This PR fixes the kOps control-plane InstanceGroup override path identified while investigating the failing Kubernetes CI job:

ci-kubernetes-e2e-kops-aws-500-node-dra-with-workload-amazonvpc-using-cl2

@kubernetes-prow kubernetes-prow Bot added kind/bug Categorizes issue or PR as related to a bug. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Sep 21, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Welcome @divyanshuprakas-h!

It looks like this is your first PR to kubernetes/kops 🎉. Please refer to our pull request process documentation to help your PR have a smooth ride to approval.

You will be prompted by a bot to use commands during the review process. Do not be afraid to follow the prompts! It is okay to experiment. Here is the bot commands documentation.

You can also check if kubernetes/kops has its own contribution guidelines.

You may want to refer to our testing guide if you run into trouble with your tests not passing.

If you are having difficulty getting your pull request seen, please follow the recommended escalation practices. Also, for tips and tricks in the contribution process you may want to read the Kubernetes contributor cheat sheet. We want to make sure your contribution gets all the attention it needs!

Thank you, and welcome to Kubernetes. 😃

@kubernetes-prow kubernetes-prow Bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Sep 21, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

Hi @divyanshuprakas-h. Thanks for your PR.

I'm waiting for a kubernetes 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.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

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.

@kubernetes-prow
kubernetes-prow Bot requested review from hakman and zetaab September 21, 2026 20:22
@kubernetes-prow kubernetes-prow Bot added the area/provider/aws Issues or PRs related to aws provider label Sep 21, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign zetaab for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

@hakman

hakman commented Sep 22, 2026

Copy link
Copy Markdown
Member

/hold

@kubernetes-prow kubernetes-prow Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 22, 2026
@hakman

hakman commented Sep 22, 2026

Copy link
Copy Markdown
Member

Closing this PR: the proposed root cause does not hold up, and the change would regress the deployer.

kops get instancegroups -o json emits v1alpha2, which serializes the ControlPlane role as Master (see pkg/apis/kops/v1alpha2/conversion.go, Convert_kops_InstanceGroupSpec_To_v1alpha2_InstanceGroupSpec). The deployer parses that output into v1alpha2 types, so the existing "Master" check is correct:

$ kops get ig --name <cluster> -o json | jq '.[] | {name: .metadata.name, role: .spec.role}'
{ "name": "control-plane-us-east-2a", "role": "Master" }
{ "name": "nodes", "role": "Node" }

With this PR, the condition never matches real output, so --control-plane-instance-group-overrides silently stops applying. The new unit test passes only because the fake kops script emits ControlPlane, which the real binary never does.

The failing job also shows the override was applied. The [build log](https://storage.googleapis.com/kubernetes-ci-logs/logs/ci-kubernetes-e2e-kops-aws-500-node-dra-with-workload-amazonvpc-using-cl2/2101869215270047744/build-log.txt) contains:

kops edit instancegroup --name e2e-...k8s.local control-plane-us-east-2a --set spec.rootVolume.type=io2

The [instancegroups.yaml](https://storage.googleapis.com/kubernetes-ci-logs/logs/ci-kubernetes-e2e-kops-aws-500-node-dra-with-workload-amazonvpc-using-cl2/2101869215270047744/artifacts/instancegroups.yaml) artifact has rootVolumeType: io2 on the control-plane IG.

The actual problem is EC2 capacity for c8a.12xlarge in us-east-2a:

  • Runs with the single instance type launched a control plane in 5 of 14 attempts.
  • Sep 21 reruns with CONTROL_PLANE_SIZE=c8a.12xlarge,c8id.12xlarge,c8i.12xlarge,c7a.12xlarge,c7i.12xlarge launched it 3 of 3 times.

The fix belongs in the test-infra job config (config/jobs/kubernetes/sig-scalability/DRA/sig-scalability-ec2-dra.yaml), not in kOps. #18329 will make this kind of failure visible directly in validation output.

/close

@kubernetes-prow kubernetes-prow Bot closed this Sep 22, 2026
@kubernetes-prow

Copy link
Copy Markdown
Contributor

@hakman: Closed this PR.

Details

In response to this:

Closing this PR: the proposed root cause does not hold up, and the change would regress the deployer.

kops get instancegroups -o json emits v1alpha2, which serializes the ControlPlane role as Master (see pkg/apis/kops/v1alpha2/conversion.go, Convert_kops_InstanceGroupSpec_To_v1alpha2_InstanceGroupSpec). The deployer parses that output into v1alpha2 types, so the existing "Master" check is correct:

$ kops get ig --name <cluster> -o json | jq '.[] | {name: .metadata.name, role: .spec.role}'
{ "name": "control-plane-us-east-2a", "role": "Master" }
{ "name": "nodes", "role": "Node" }

With this PR, the condition never matches real output, so --control-plane-instance-group-overrides silently stops applying. The new unit test passes only because the fake kops script emits ControlPlane, which the real binary never does.

The failing job also shows the override was applied. The [build log](https://storage.googleapis.com/kubernetes-ci-logs/logs/ci-kubernetes-e2e-kops-aws-500-node-dra-with-workload-amazonvpc-using-cl2/2101869215270047744/build-log.txt) contains:

kops edit instancegroup --name e2e-...k8s.local control-plane-us-east-2a --set spec.rootVolume.type=io2

The [instancegroups.yaml](https://storage.googleapis.com/kubernetes-ci-logs/logs/ci-kubernetes-e2e-kops-aws-500-node-dra-with-workload-amazonvpc-using-cl2/2101869215270047744/artifacts/instancegroups.yaml) artifact has rootVolumeType: io2 on the control-plane IG.

The actual problem is EC2 capacity for c8a.12xlarge in us-east-2a:

  • Runs with the single instance type launched a control plane in 5 of 14 attempts.
  • Sep 21 reruns with CONTROL_PLANE_SIZE=c8a.12xlarge,c8id.12xlarge,c8i.12xlarge,c7a.12xlarge,c7i.12xlarge launched it 3 of 3 times.

The fix belongs in the test-infra job config (config/jobs/kubernetes/sig-scalability/DRA/sig-scalability-ec2-dra.yaml), not in kOps. #18329 will make this kind of failure visible directly in validation output.

/close

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.

@divyanshuprakas-h
divyanshuprakas-h deleted the fix-kops-control-plane-overrides branch September 22, 2026 10:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/provider/aws Issues or PRs related to aws provider cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/bug Categorizes issue or PR as related to a bug. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants