-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
better support of ipv6-only clusters: prevent creation of default-ipv4-pool during calico-node startup #8156
better support of ipv6-only clusters: prevent creation of default-ipv4-pool during calico-node startup #8156
Conversation
2f7387a
to
dbdbc47
Compare
/sem-approve |
I wonder if instead of introducing new env vars for this, we should follow the pattern we used for That said, I am curious why using |
yeah, it's a better option. I will refactor the PR into such an approach. |
@caseydavenport , done. Could you look into? |
737bbcb
to
395be5e
Compare
b981afb
to
4635380
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apologies for the delay here - this looks good to me!
I do think we need a pair of unit tests to verify this behavior works - here's an example of a similar test you can base it on:
calico/node/pkg/lifecycle/startup/startup_test.go
Lines 455 to 477 in 8d31b26
It("should properly handle NO_DEFAULT_POOLS env variable", func() { | |
// Create clients for test. | |
cfg, err := apiconfig.LoadClientConfigFromEnvironment() | |
Expect(err).NotTo(HaveOccurred()) | |
c, err := client.New(*cfg) | |
Expect(err).NotTo(HaveOccurred()) | |
be, err := backend.NewClient(*cfg) | |
Expect(err).NotTo(HaveOccurred()) | |
err = be.Clean() | |
Expect(err).NotTo(HaveOccurred()) | |
// Set the env variables specified. | |
os.Setenv("NO_DEFAULT_POOLS", "true") | |
// Run the UUT. | |
configureIPPools(ctx, c, kubeadmConfig) | |
// Get the IPPool list. | |
poolList, err := c.IPPools().List(ctx, options.ListOptions{}) | |
Expect(err).NotTo(HaveOccurred()) | |
Expect(poolList.Items).To(BeEmpty(), "Environment %#v", os.Environ()) | |
}) |
4635380
to
dd96f62
Compare
/sem-approve |
@sridhartigera This might be related to your recent works. |
@kruftik is this still on your radar? The only thing remaining is a unit test (see my last comment) |
d9946cd
to
30c5eb8
Compare
seems like done |
/sem-approve |
Description
Current calico-node startup logic supports creation of default ip-pools both for ipv4 and ipv6 stacks if the ones do not exist. However, it does not take into account accordingly the ipv6-only clusters (without ipv4 addresses on any interfaces at all): as soon as default-ipv4 pool being created, every calico-node instance begin log flooding with something like:
This PR mitigate such an issue: in addition to
NO_DEFAULT_POOLS
environment variable,CALICO_IPV4POOL_CIDR
=none
andCALICO_IPV6POOL_CIDR
=none
special values are added.Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.