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

kind and docker --net=host #651

Closed
alexz-kh opened this issue Jun 25, 2019 · 6 comments
Closed

kind and docker --net=host #651

alexz-kh opened this issue Jun 25, 2019 · 6 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature.

Comments

@alexz-kh
Copy link

Currently, there is no possibility to pass custom network type, for kind cluster.

Docs networking: example:
https://kind.sigs.k8s.io/docs/user/quick-start#ipv6-clusters
https://raw.githubusercontent.com/kubernetes-sigs/kind/master/site/content/docs/user/kind-example-config.yaml

What would you like to be added:
Possibility, to use host network in k8s\kind clusters

Why is this needed:
To be able pass into privileged containers network bridges\etc from host system.

@alexz-kh alexz-kh added the kind/feature Categorizes issue or PR as related to a new feature. label Jun 25, 2019
@BenTheElder
Copy link
Member

this is approximately a duplicate of #273

note that net=host specifically probably not going to work well, port forwarding is going to work in a saner fashion most likely and is a work in progress.

@BenTheElder
Copy link
Member

please follow #273

@nikhil-nutanix
Copy link

Does this work now? My use case is to run open-iscsi in a pod and for that to run, the cluster must be running in host network.
I checked out #273 and tried creating a cluster with KIND_EXPERIMENTAL_NETWORK=host kind create cluster, but that doesn't seem to have any visible effect.

$ kind version
kind v0.17.0 go1.19 linux/amd64

@BenTheElder
Copy link
Member

No, this is not and will not be supported.

If you'd like to run a kubernetes node in the host network without isolation, I highly recommend using kubeadm init directly instead of kind. It will be supported and much more debuggable.

@weberc2-tempus
Copy link

weberc2-tempus commented Jun 4, 2024

If you'd like to run a kubernetes node in the host network without isolation, I highly recommend using kubeadm init directly instead of kind. It will be supported and much more debuggable.

Presumably this won't work for macOS or Windows developers (maybe Windows via WSL2)?

@BenTheElder
Copy link
Member

You can't run docker directly on macOS or Windows, if you're running kind then you're running linux in a VM or directly. For example docker desktop uses a linux VM.

You can instead run kubeadm directly on a Linux VM (which, your host must support, because it had to support Linux to get docker/kind running).

For macOS I would suggest looking at https://github.com/lima-vm/lima, for Windows I don't have any particular recommendations but there are many options.

IN general I would not recommend depending on host network though, it's not going to be nearly as portable to other options as avoiding that dependency, and to run in the host network we can only have a single node/cluster anyhow which makes most of the containerized / devel cluster tools far less useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature.
Projects
None yet
Development

No branches or pull requests

4 participants