Open thesn10 opened 2 years ago
Hey @thesn10,
Did you found a workaround to actually disabling the port binding itself?
Hey @thesn10,
Did you found a workaround to actually disabling the port binding itself?
No, i just ignored it and moved on. I just manually replaced the port in the kubeconfig with the correct port of the reverse proxy. The port on the host is still open but i just ignore it and not use it. I know this is unsecure, but it is what it is....
Problem
K3d always binds to a host port which cannot be disabled. This is bad because if we run k3d clusters behind a reverse proxy, we dont need the host port. It will also cause the port in the kubeconfig to not match.
Solution
Maybe add a
--no-host-port
command line arg, which disables this.Or another option is maybe add an option to specify a reverse proxy url which will be used in the kubeconfig. For example
--reverse-proxy-url=k3s-api.mydomain.com
Or change the
--api-port
option format from[(HostIP|HostName):]HostPort
to[(HostIP|HostName):][HostPort]
which makes the port optional.Discussed in https://github.com/k3d-io/k3d/discussions/1066
Current Workaround
You can only manually fix the kubeconfig url but not completely disable the port. This manually removes the port from kubeconfig by replacing the server url:
Unfortunalely, this workaround does not completely disable the port but only remove it in the kubeconfig