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

experimentally allow custom networks #1538

Merged

Conversation

BenTheElder
Copy link
Member

fixes #273

  • we allow overriding the network
  • it's not officially supported
  • currently we do no validation
  • it must be done via an experimental env, which comes with a warning

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

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: BenTheElder

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 requested review from amwat and munnerz April 30, 2020 23:49
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 30, 2020
@BenTheElder
Copy link
Member Author

bazel build flake
/retest

@amwat
Copy link
Contributor

amwat commented May 1, 2020

missed changing

// user a user defined docker network so we get embedded DNS
"--net", fixedNetworkName,

@BenTheElder BenTheElder force-pushed the network-experiment branch from 1a5d820 to 2da88e6 Compare May 1, 2020 01:06
@BenTheElder
Copy link
Member Author

done

@BenTheElder
Copy link
Member Author

/retest

Copy link
Contributor

@amwat amwat left a comment

Choose a reason for hiding this comment

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

/lgtm
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 1, 2020
@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 1, 2020
@BenTheElder BenTheElder force-pushed the network-experiment branch from 2da88e6 to 8cef04c Compare May 1, 2020 01:48
@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 1, 2020
@BenTheElder
Copy link
Member Author

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 1, 2020
@BenTheElder
Copy link
Member Author

re-applying, made trivial change per comments. this is the last PR before the v0.8.0 tag

@BenTheElder BenTheElder added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label May 1, 2020
@k8s-ci-robot k8s-ci-robot merged commit be68136 into kubernetes-sigs:master May 1, 2020
@BenTheElder BenTheElder deleted the network-experiment branch May 1, 2020 02:52
@BenTheElder BenTheElder added this to the v0.8.0 milestone May 1, 2020
joshuaspence added a commit to joshuaspence/homelab that referenced this pull request Aug 3, 2020
Instead of using two completely separate subnets (`172.x.0.0/16` is used by Kind and I had arbitrarily chosen `192.168.2.0/24` for MetalLB), use a custom Docker network for `kind` instead. I needed to create the Docker network myself rather than letting `kind` do it because otherwise the subnet IP range will not necessarily be fixed (see https://github.com/kubernetes-sigs/kind/blob/add83858a0addea5899a88003a598399a8a36747/pkg/cluster/internal/providers/docker/network.go#L94).

To allow `kind` to use the custom Docker network, I am relying on `KIND_EXPERIMENTAL_DOCKER_NETWORK`. See kubernetes-sigs/kind#273 and kubernetes-sigs/kind#1538.

For documentation on `docker network create`, see https://docs.docker.com/engine/reference/commandline/network_create/.

| Subnet           | Usage                |
|------------------|----------------------|
| `172.100.0.0/24` | Kubernetes nodes     |
| `172.100.1.0/24` | MetalLB address pool |
@mausch mausch mentioned this pull request Sep 9, 2020
@jieyu
Copy link
Contributor

jieyu commented Jan 4, 2023

can we make this an experimental option in the API, instead of an environment variable? It's not very easy to use environment variable when using the library to create the kind cluster.

@BenTheElder
Copy link
Member Author

can we make this an experimental option in the API, instead of an environment variable? It's not very easy to use environment variable when using the library to create the kind cluster.

experimental options are only exposed via environment variable and are highly discouraged.

making it easy would defeat the purpose.

what's your use-case in not using the standard network?

we'd actually prefer to use the default "bridge" network but we can't due to the lack of embedded DNS.

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. 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.

Allow configurable docker network for kind cluster nodes
4 participants