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

Use calico_pool_blocksize from cluster when existing #10516

Merged

Conversation

VannTen
Copy link
Contributor

@VannTen VannTen commented Oct 11, 2023

What type of PR is this?
/kind cleanup

What this PR does / why we need it:

The blockSize attribute from Calico IPPool resources cannot be changed
once set 1. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

Special notes for your reviewer:

We faced that problem while upgrading our cluster (to 2.19.1). We have some clusters which have different blockSize (for reasons unclear to me), and while setting the correct value (instead of the default) is not that long, it's still a bit annoying.

Does this PR introduce a user-facing change?:

[calico] Use calico_pool_blocksize from cluster when existing

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 11, 2023
@k8s-ci-robot
Copy link
Contributor

Hi @VannTen. Thanks for your PR.

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

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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Oct 11, 2023
@VannTen VannTen force-pushed the fix/calico_ippool_blocksize branch from b72b6c2 to b3e84a6 Compare October 11, 2023 14:53
The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
@VannTen VannTen force-pushed the fix/calico_ippool_blocksize branch from b3e84a6 to 6439d0c Compare October 13, 2023 07:17
@yankay
Copy link
Member

yankay commented Oct 15, 2023

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Oct 15, 2023
@yankay yankay requested a review from cyclinder October 19, 2023 02:58
@yankay
Copy link
Member

yankay commented Oct 19, 2023

HI @cyclinder
would you please help to review it :-)

Copy link
Contributor

@cyclinder cyclinder left a comment

Choose a reason for hiding this comment

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

thanks, I think it's a good idea.

_calico_blocksize: >
{
"spec": {
"blockSize": {{ (_calico_pool_cmd.stdout | from_json).spec.blockSize }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need also to merge the CIDR? update the CIDR of the existing ippool is dangerous.

Copy link
Contributor Author

@VannTen VannTen Oct 19, 2023

Choose a reason for hiding this comment

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

I'd say it depends on whether we consider changing the cidr as part of the playbook a valid use-case, and what's the "default history" of the cidr attribute is (I came across this little inconvenience because the blockSize default changed apparently, because those clusters never had an explicit setting in their inventory for that).

Changing the blockSize is definitely out of scope, because it's simply impossible, since it's immutable in the IPPool. The cidr, I don't know.

Overall, I would err on the side on keeping it that way, for minimal changes (which might be breaking someone workflow => can't be the case for blockSize).

Copy link
Contributor

Choose a reason for hiding this comment

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

I would err on the side on keeping it that way, for minimal changes

Agree, It's ok for me.

In your case, the default blocksize was not used when the cluster was installed, but the default value was still used when upgrading the cluster, right? It makes sense that blocksize is immutable so we don't make it be updated.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I think that's how it went. The clusters were installed some years ago (not by me), and I think for some it was the calico default value for blocksize (26) and for others... well I don't really know ^^.

Copy link
Contributor

Choose a reason for hiding this comment

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

I used to change the blockSize of calico from 24 to 26(#9055) because it was consistent with the upstream of calico. maybe your cluster was created before this PR merged.

@cyclinder
Copy link
Contributor

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 19, 2023
Copy link
Member

@floryut floryut left a comment

Choose a reason for hiding this comment

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

@VannTen Thank you for the PR 👍

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: floryut, VannTen

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 Oct 30, 2023
@floryut floryut added kind/network Network section in the release note and removed kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. labels Oct 30, 2023
@k8s-ci-robot k8s-ci-robot merged commit 34754cc into kubernetes-sigs:master Oct 30, 2023
59 checks passed
guytet pushed a commit to guytet/kubespray that referenced this pull request Oct 30, 2023
…#10516)

The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
@yankay yankay mentioned this pull request Dec 15, 2023
cyclinder pushed a commit to cyclinder/kubespray that referenced this pull request Jan 5, 2024
…#10516)

The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
cyclinder pushed a commit to cyclinder/kubespray that referenced this pull request Jan 5, 2024
…#10516)

The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
cyclinder pushed a commit to cyclinder/kubespray that referenced this pull request Jan 5, 2024
…#10516)

The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
cyclinder pushed a commit to cyclinder/kubespray that referenced this pull request Jan 5, 2024
…#10516)

The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
floryut pushed a commit that referenced this pull request Jan 22, 2024
The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
floryut pushed a commit that referenced this pull request Jan 22, 2024
The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
This was referenced Feb 5, 2024
pedro-peter pushed a commit to pedro-peter/kubespray that referenced this pull request May 8, 2024
…#10516)

The blockSize attribute from Calico IPPool resources cannot be changed
once set [1]. Consequently, we use the one currently defined when
configuring the existing IPPool, avoiding upgrade errors by trying to
change it.

In particular, this can be useful when calico_pool_blocksize default
changes in kubespray, which would otherwise force users to add an
explicit setting to their inventories.

[1]: https://docs.tigera.io/calico/latest/reference/resources/ippool#spec
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. kind/network Network section in the release note lgtm "Looks good to me", 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. 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