PlayFab / thundernetes

Thundernetes makes it easy to run your game servers on Kubernetes
https://playfab.github.io/thundernetes
Apache License 2.0
307 stars 46 forks source link

macos port 5000 already in use by Airplay Receiver #379

Open BennyDeeDev opened 1 year ago

BennyDeeDev commented 1 year ago

Describe the bug

ERROR: failed to create cluster: command "docker run --name kind-worker --hostname kind-worker --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=kind --net kind --restart=on-failure:1 --init=false --publish=0.0.0.0:5000:5000/TCP --publish=0.0.0.0:10000:10000/TCP --publish=0.0.0.0:10001:10001/TCP kindest/node:v1.24.0@sha256:0866296e693efe1fed79d5e6c7af8df71fc73ae45e3679af05342239cdc5bc8e" failed with error: exit status 125
Command Output: 28ef95724a4daf43b462efdb8076fff0b7b28c3a0d6f0a22064a031634cc6ff3
docker: Error response from daemon: Ports are not available: exposing port TCP 0.0.0.0:5000 -> 0.0.0.0:0: listen tcp 0.0.0.0:5000: bind: address already in use.

I don't know if its really a bug, but when installing a thundernetes cluster with kind on macos I encountered that the port 5000 is already used by airplay.

For now I disabled airplay receiver like this: https://developer.apple.com/forums/thread/682332

To Reproduce Steps to reproduce the behavior: kind create cluster --config /path/to/kind-config.yaml

kind: Cluster
apiVersion: kind.x-k8s.io/v1alpha4
nodes:
- role: control-plane
- role: worker
  extraPortMappings:
  - containerPort: 5000
    hostPort: 5000
    listenAddress: "0.0.0.0"
    protocol: tcp
  - containerPort: 10000
    hostPort: 10000
    listenAddress: "0.0.0.0"
    protocol: tcp
  - containerPort: 10001
    hostPort: 10001
    listenAddress: "0.0.0.0"
    protocol: tcp

Desktop:

dgkanatsios commented 1 year ago

Thanks for reporting this! We should definitely document how to change the port, apologies for the inconvenience! Keeping this issue open so we can work on this.

snobu commented 1 year ago

I can confirm 5000/TCP is in use on my Monterey as well. Maybe we should pick a different port by default? Something that's not on this list would have a good chance at being available - https://www.liquisearch.com/list_of_tcp_and_udp_port_numbers/registered_ports

dgkanatsios commented 1 year ago

this was partially fixed in #419. It would be great if we could customize the port via Makefile though, so leaving this open