-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 extraPortMappings issue #3681
Comments
You have both workers trying to bind to the same ports on the host. That will not work. What you probably want is to add the port mappings to the control-plane container, then use ingress to expose your applications running on the workers. |
Can you give me some example for my config? |
As far as just creating the cluster, this should work:
|
Creating cluster "k8s-proj" ... Still showing the error |
something else on your host may already be using port 80? setting also, if you don't have a specific use-case in mind, I'd highly recommend using a single node cluster and just doing: kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
extraPortMappings:
- containerPort: 30000
hostPort: 80
listenAddress: "127.0.0.1"
- containerPort: 31000
hostPort: 443
listenAddress: "127.0.0.1"
- containerPort: 32000
hostPort: 15021
listenAddress: "127.0.0.1" |
Creating cluster "k8s-proj" ...
β Ensuring node image (kindest/node:v1.30.0) πΌ
β Preparing nodes π¦ π¦ π¦
Deleted nodes: ["k8s-proj-worker" "k8s-proj-worker2" "k8s-proj-control-plane"]
ERROR: failed to create cluster: command "docker run --name k8s-proj-worker2 --hostname k8s-proj-worker2 --label io.x-k8s.kind.role=worker --privileged --security-opt seccomp=unconfined --security-opt apparmor=unconfined --tmpfs /tmp --tmpfs /run --volume /var --volume /lib/modules:/lib/modules:ro -e KIND_EXPERIMENTAL_CONTAINERD_SNAPSHOTTER --detach --tty --label io.x-k8s.kind.cluster=k8s-proj --net kind --restart=on-failure:1 --init=false --cgroupns=private --publish=127.0.0.1:80:30000/TCP --publish=127.0.0.1:443:31000/TCP --publish=127.0.0.1:15021:32000/TCP kindest/node:v1.30.0@sha256:047357ac0cfea04663786a612ba1eaba9702bef25227a794b52890dd8bcd692e" failed with error: exit status 125
Command Output: 90e96a94f270f108b9861949cb539484b7b9be34c1fad906d991e9373be7df0a
docker: Error response from daemon: Ports are not available: exposing port TCP 127.0.0.1:80 -> 0.0.0.0:0: listen tcp 127.0.0.1:80: bind: An attempt was made
Here is the error occurred when I create a cluster with config file including extra port mappings.
The text was updated successfully, but these errors were encountered: