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

feat: introduces a new --cidr command line flag #1324

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

ricardomaraschini
Copy link
Member

What this PR does / why we need it:

This commit introduces the --cidr flag. This flag is meant to replace the --pod-cidr and --service-cidr flags (these are now hidden). When provided --cidr must be equal or larger than a /16 and half of the IPs go to the pod network while the other half goes to the service network.

The default value for --cidr is defined as k0sv1beta1.DefaultNetwork().PodCIDR ("10.244.0.0/16") resulting in pods getting the 10.244.0.0/17 and services getting the 10.244.128.0/17 network addresses.

Does this PR require a test?

Does this PR require a release note?

Introduced the new --cidr flag, this flag defines both Pod and Service network addresses (half each).

Copy link

github-actions bot commented Oct 15, 2024

This PR has been released (on staging) and is available for download with a embedded-cluster-smoke-test-staging-app license ID.

Online Installer:

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci/appver-dev-5d6495f" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Airgap Installer (may take a few minutes before the airgap bundle is built):

curl "https://staging.replicated.app/embedded/embedded-cluster-smoke-test-staging-app/ci-airgap/appver-dev-5d6495f?airgap=true" -H "Authorization: $EC_SMOKE_TEST_LICENSE_ID" -o embedded-cluster-smoke-test-staging-app-ci.tgz

Happy debugging!

@ricardomaraschini ricardomaraschini force-pushed the ricardomaraschini/sc-113112/introduce-new-cidr-flag-where-the-cidr-is branch 2 times, most recently from 98d2d6e to 7cd2f30 Compare October 16, 2024 12:28
these are going to be replaces by the new --cidr flag.
adds the --cidr flag and makes sure it is valid an at least a /16 subnet.
return an error if the cidr range is not private.
created function to split network cidr in half. we plan to use half for
the pod network and the other half for the service network.
forward down the provided cidr to the k0s config. this commit also
changes the functions that automatically sets the no proxy env var.
the new default cidr is different than the old one so some expectations
need to be updated.
users are supposed to choose one or the other. if --cidr is present then
users can't use --pod-cidr or --service-cidr.
store cidr in the runtimeconfig.
a new field was added to the runtime config spec object.
if during the installation --cidr was used then the restore message
should inform users to use --cidr instead of --pod-cidr and --service-cidr

this annotation isn't yet in the kots code but it will be as a follow up
to this pr.
we wont be preserving the cidr in the cluster anymore.
we will need a function to verify if two networks are adjacent to each
other and if they are, we will merge them into a single network.
@ricardomaraschini ricardomaraschini force-pushed the ricardomaraschini/sc-113112/introduce-new-cidr-flag-where-the-cidr-is branch from 6c4d607 to a0d1087 Compare October 16, 2024 18:55
if pod and svc networks are adjacent and with the same size we instruct
the user to use --cidr instead of --pod-cidr and --service-cidr.
this is a remeniscent commit to remove old code that is no longer used
no-proxy should contain the custom cidr provided by the user.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant