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(clusterpools): cluster-pool-ipv4-cidr/cluster-pool-ipv6-cidr #17780

Merged
merged 1 commit into from Nov 22, 2021

Conversation

cndoit18
Copy link
Contributor

@cndoit18 cndoit18 commented Nov 4, 2021

Please ensure your pull request adheres to the following guidelines:

  • For first time contributors, read Submitting a pull request
  • All code is covered by unit and/or runtime tests where feasible.
  • All commits contain a well written commit description including a title,
    description and a Fixes: #XXX line if the commit addresses a particular
    GitHub issue.
  • All commits are signed off. See the section Developer’s Certificate of Origin
  • Provide a title or release-note blurb suitable for the release notes.
  • Thanks for contributing!
`cluster-pool-ipv4-cidr` and `cluster-pool-ipv6-cidr` options now accept string slices and not just string

@cndoit18 cndoit18 requested a review from a team as a code owner November 4, 2021 05:12
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Nov 4, 2021
operator/flags.go Outdated Show resolved Hide resolved
@cndoit18 cndoit18 marked this pull request as draft November 5, 2021 04:35
@cndoit18 cndoit18 changed the title fix(flags): cluster-pool-ipv4-cidr/cluster-pool-ipv6-cidr fix(clusterpools): cluster-pool-ipv4-cidr/cluster-pool-ipv6-cidr Nov 5, 2021
@cndoit18 cndoit18 force-pushed the fix-flags branch 3 times, most recently from c75fdb6 to a0d4dbb Compare November 11, 2021 08:47
@cndoit18 cndoit18 marked this pull request as ready for review November 11, 2021 09:21
@cndoit18 cndoit18 requested review from a team as code owners November 11, 2021 09:21
@cndoit18 cndoit18 requested review from a team and joestringer November 11, 2021 09:21
@gandro
Copy link
Member

gandro commented Nov 11, 2021

Thanks for the contribution.

I believe however changing this value breaks upgrades. If users use "--reuse-values" when performing "helm upgrade", Helm will likely fail trying to apply join to a string, no?

My proposal therefore would be to introduce a new Helm value (e.g. operator.clusterPoolIPv6PodCIDRList), modify the chart such that it prefers the new list-based one (if set), but fails back to the old string-based one if not. And then we can deprecate the old one eventually. At least we should mention this change it the update notes.

While less elegant, there is also an option where we don't change the Helm value at all. I believe if you only changed flags.String to flags.StringSlice that you can specify multiple CIDRs via Helm by just comma-separating them, e.g. "ipam.operator.clusterPoolIPv4PodCIDR=10.0.0.0/8,172.16.0.0/12" should work too.

@cndoit18
Copy link
Contributor Author

clusterPoolIPv6PodCIDRList

Thanks for the contribution.

I believe however changing this value breaks upgrades. If users use "--reuse-values" when performing "helm upgrade", Helm will likely fail trying to apply join to a string, no?

My proposal therefore would be to introduce a new Helm value (e.g. operator.clusterPoolIPv6PodCIDRList), modify the chart such that it prefers the new list-based one (if set), but fails back to the old string-based one if not. And then we can deprecate the old one eventually. At least we should mention this change it the update notes.

While less elegant, there is also an option where we don't change the Helm value at all. I believe if you only changed flags.String to flags.StringSlice that you can specify multiple CIDRs via Helm by just comma-separating them, e.g. "ipam.operator.clusterPoolIPv4PodCIDR=10.0.0.0/8,172.16.0.0/12" should work too.

Thank you very much, I agree with you. I'll think about how to modify it

@cndoit18 cndoit18 force-pushed the fix-flags branch 2 times, most recently from 36949bb to 288d24b Compare November 12, 2021 04:17
@cndoit18
Copy link
Contributor Author

Thanks for the contribution.

I believe however changing this value breaks upgrades. If users use "--reuse-values" when performing "helm upgrade", Helm will likely fail trying to apply join to a string, no?

My proposal therefore would be to introduce a new Helm value (e.g. operator.clusterPoolIPv6PodCIDRList), modify the chart such that it prefers the new list-based one (if set), but fails back to the old string-based one if not. And then we can deprecate the old one eventually. At least we should mention this change it the update notes.

While less elegant, there is also an option where we don't change the Helm value at all. I believe if you only changed flags.String to flags.StringSlice that you can specify multiple CIDRs via Helm by just comma-separating them, e.g. "ipam.operator.clusterPoolIPv4PodCIDR=10.0.0.0/8,172.16.0.0/12" should work too.

done

Copy link
Contributor

@errordeveloper errordeveloper left a comment

Choose a reason for hiding this comment

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

Please see my comments

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

Thanks for the PR. At a glance this seems like it should be safe for upgrades from existing clusterpool configuration, although I have not tested it out.

There's a few references to the old name for this field in the docs, could you fix them up?

$ git grep clusterPoolIPv4
Documentation/gettingstarted/ipam-cluster-pool.rst:   * ``--set ipam.operator.clusterPoolIPv4PodCIDR=<IPv4CIDR>``
Documentation/gettingstarted/ipam-cluster-pool.rst:   * ``--set ipam.operator.clusterPoolIPv4MaskSize=<IPv4MaskSize>``
Documentation/gettingstarted/k8s-install-openshift-okd.rst:reflect those changes. Namely ``clusterNetwork`` should match ``nativeRoutingCIDR``, ``clusterPoolIPv4PodCIDR`` and ``clusterPoolIPv4MaskSize``.
...

Also, should this be added into the Documentation/operations/upgrade.rst upgrade guide to inform users that they should migrate their configurations to the new settings?

@joestringer
Copy link
Member

I suspect that some of the failures in CI are because this PR has not been rebased against the latest master branch recently. Could you also rebasing against master while addressing the above feedback?

@cndoit18
Copy link
Contributor Author

ABC was deprecated in favor of BBC

Thanks for the PR. At a glance this seems like it should be safe for upgrades from existing clusterpool configuration, although I have not tested it out.

There's a few references to the old name for this field in the docs, could you fix them up?

$ git grep clusterPoolIPv4
Documentation/gettingstarted/ipam-cluster-pool.rst:   * ``--set ipam.operator.clusterPoolIPv4PodCIDR=<IPv4CIDR>``
Documentation/gettingstarted/ipam-cluster-pool.rst:   * ``--set ipam.operator.clusterPoolIPv4MaskSize=<IPv4MaskSize>``
Documentation/gettingstarted/k8s-install-openshift-okd.rst:reflect those changes. Namely ``clusterNetwork`` should match ``nativeRoutingCIDR``, ``clusterPoolIPv4PodCIDR`` and ``clusterPoolIPv4MaskSize``.
...

Also, should this be added into the Documentation/operations/upgrade.rst upgrade guide to inform users that they should migrate their configurations to the new settings?

Thx, updated

Copy link
Member

@joestringer joestringer left a comment

Choose a reason for hiding this comment

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

LGTM, thanks.

@cndoit18
Copy link
Contributor Author

Hi, Is there anything else I need to do next?

@gandro
Copy link
Member

gandro commented Nov 18, 2021

Hi, Is there anything else I need to do next?

Let's give @errordeveloper some time to re-review. Other than that, this should be good to go.

I'll also re-run CI again to incorporate the last changes.

@gandro
Copy link
Member

gandro commented Nov 18, 2021

/test

Job 'Cilium-PR-K8s-1.21-kernel-4.19' hit: #17881 (98.48% similarity)

@cndoit18
Copy link
Contributor Author

Hi, Is there anything else I need to do next?

Let's give @errordeveloper some time to re-review. Other than that, this should be good to go.

I'll also re-run CI again to incooperate the last changes.

thank you

@cndoit18
Copy link
Contributor Author

Hi, do I need to do something to solve this CI can not succeed?

@cndoit18
Copy link
Contributor Author

/test

@gandro
Copy link
Member

gandro commented Nov 22, 2021

Hi, do I need to do something to solve this CI can not succeed?

Pushing new commits unfortunately invalidates previous CI runs and their links, so I can't tell you what went wrong the last time besides one known-flaky test that got flagged (which is unrelated to your changes) here: #17780 (comment)

I'll run the tests again (this can only be done by team members with commit access unfortunately), please avoid pushing to the branch after the tests have run to keep the result validated. There is usually no need to rebase.

@gandro
Copy link
Member

gandro commented Nov 22, 2021

/test

@cndoit18
Copy link
Contributor Author

Hi, do I need to do something to solve this CI can not succeed?

Pushing new commits unfortunately invalidates previous CI runs and their links, so I can't tell you what went wrong the last time besides one known-flaky test that got flagged (which is unrelated to your changes) here: #17780 (comment)

I'll run the tests again (this can only be done by team members with commit access unfortunately), please avoid pushing to the branch after the tests have run to keep the result validated. There is usually no need to rebase.

Thank you very much

@cndoit18
Copy link
Contributor Author

cndoit18 commented Nov 22, 2021

/test

@gandro Sorry, it seems that the rebase is a past commit, I need to fix it.

`cluster-pool-ipv4-cidr` and `cluster-pool-ipv6-cidr` should be string slices and not string

Signed-off-by: cndoit18 <cndoit18@outlook.com>
@cndoit18
Copy link
Contributor Author

/test

Can you retrigger it? Thank you

@gandro
Copy link
Member

gandro commented Nov 22, 2021

/test

Can you retrigger it? Thank you

Yes, will re-trigger it as soon as the Image CI Build stage has finished. Please note that it is usually fine if your branch is not up to date with the master branch, there is no need to rebase, unless there is a known bug somewhere.

@gandro
Copy link
Member

gandro commented Nov 22, 2021

/test

Job 'Cilium-PR-K8s-GKE' failed and has not been observed before, so may be related to your PR:

Click to show.

Test Name

K8sDatapathConfig Encapsulation Check connectivity with sockops and VXLAN encapsulation

Failure Output

FAIL: Kubernetes DNS did not become ready in time

If it is a flake, comment /mlh new-flake Cilium-PR-K8s-GKE so I can create a new GitHub issue to track it.

@aanm aanm merged commit 8a7c37f into cilium:master Nov 22, 2021
@cndoit18 cndoit18 deleted the fix-flags branch November 23, 2021 00:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-note/bug This PR fixes an issue in a previous release of Cilium. sig/ipam IP address management, including cloud IPAM
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants