Skip to content
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

🌱 Fix empty control-plane taints example #7025

Merged
merged 1 commit into from
Aug 19, 2022

Conversation

apricote
Copy link
Member

@apricote apricote commented Aug 5, 2022

What this PR does / why we need it:

The docs to remove the default control plane taints instruct the user to set the value to an empty slice, i.e. taints: {} in the YAML file , but an empty slice is equal to an empty yaml array: taints: [].

Which issue(s) this PR fixes:
Fixes #

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 5, 2022
@k8s-ci-robot
Copy link
Contributor

@apricote: This issue is currently awaiting triage.

If CAPI contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 5, 2022
@@ -220,7 +220,7 @@ type NodeRegistrationOptions struct {

// Taints specifies the taints the Node API object should be registered with. If this field is unset, i.e. nil, in the `kubeadm init` process
// it will be defaulted to []v1.Taint{'node-role.kubernetes.io/master=""'}. If you don't want to taint your control-plane node, set this field to an
// empty slice, i.e. `taints: {}` in the YAML file. This field is solely used for Node registration.
// empty slice, i.e. `taints: []` in the YAML file. This field is solely used for Node registration.
Copy link
Member Author

Choose a reason for hiding this comment

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

I was not sure if it is okay to change the upstream kubeadm types, but without changing this one description in the generated CRDs still contained the taints: {} example.

Copy link
Member

Choose a reason for hiding this comment

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

Let's keep the upstream types as is. We generally try to keep the diffs there minimal and the godoc here is not exposed anywhere to CAPI users.

Copy link
Member Author

Choose a reason for hiding this comment

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

This godoc is exposed directly to CAPI users for v1alpha3:

JoinConfiguration *upstreamv1beta1.JoinConfiguration `json:"joinConfiguration,omitempty"`

But as @killianmuldoon said, we should probably skip making these changes to out-of-support CRD versions, so I am going to remove this change from the PR.

Copy link
Member

Choose a reason for hiding this comment

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

Ah good point, you're right.

@killianmuldoon
Copy link
Contributor

/retest

Copy link
Contributor

@killianmuldoon killianmuldoon left a comment

Choose a reason for hiding this comment

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

We should IMO only make this change in v1beta1 as v1alpha4 is no longer directly supported.

It looks like this change could also be made to our kubeadm v1beta1 upstream type, but I don't that we need to include that type anymore. It might be safe to drop it as it's used for very old, and I think unsupported clusters.

v1beta1 doesn't even appear on our support matrix. I think it's there to allow potentially updating very old clusters without going through multiple cluster api versions.

@fabriziopandini @sbueringer WDYT?

@stmcginnis
Copy link
Contributor

We should IMO only make this change in v1beta1 as v1alpha4 is no longer directly supported.

Should we clean up (remove) some of those files? Or is there a reason to keep them around?

@killianmuldoon
Copy link
Contributor

Should we clean up (remove) some of those files? Or is there a reason to keep them around?

My understanding is we have to keep those API versions around as long as we support upgrading from an older API version to the current one. I think we're not due to drop support until we drop support for Kubernetes 1.22 (if I'm reading the table right), but it might be dropped sooner or later depending on the community.

The docs to remove the default control plane taints instruct the user
to set the value to _an empty slice, i.e. `taints: {}` in the YAML file_
, but an empty slice is equal to an empty yaml array: `taints: []`.
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 16, 2022
@apricote
Copy link
Member Author

I removed all changes to API versions besides v1beta1.

@sbueringer
Copy link
Member

sbueringer commented Aug 16, 2022

@stmcginnis @killianmuldoon The reason why we currently keep the apiVersions is because while we don't support v1alpha3 CAPI versions anymore we might still want to support upgrading from v1alpha3 to a supported version.

Also in my opinion we have to fix the following issue first before we can drop apiVersions: #5470
Otherwise clusters initially created with v1alpha3 will just break.

@sbueringer
Copy link
Member

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Aug 16, 2022
@killianmuldoon
Copy link
Contributor

/lgtm

@sbueringer
Copy link
Member

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer

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

The pull request process is described here

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

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2022
@k8s-ci-robot k8s-ci-robot merged commit 0017077 into kubernetes-sigs:main Aug 19, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.3 milestone Aug 19, 2022
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants