talos icon indicating copy to clipboard operation
talos copied to clipboard

Docker control plane port mapping should be 6443:6443 (or documented not to be)

Open jfrosch opened this issue 1 year ago • 1 comments

Bug Report

Docker installation port mapping should map the control plane as 6443:6443 not some_random_port:6443. Either the docs should warn about this and advise users to update the kube config with the random port mapping, or (even better) change the mapping of the control plane container to 6443:6443.

Description

The cluster was created with the simple command talosctl cluster create --workers 3 but I couldn't get kubectl get nodes to work. It kept timing out. Same with curl. Being new to Talos, I though I had made a mistake somewhere. After retracing my steps, it became obvious the instructions in the docs and the Install on Docker video were missing some key ingredient.

I couldn't figure it out until I opened Docker Desktop dashboard and noticed the port mappings. Here's the control plane entry from docker ps:

b02a0503888c   ghcr.io/siderolabs/talos:v1.7.5   "/sbin/init"   About an hour ago   Up About an hour   0.0.0.0:64919->6443/tcp, 0.0.0.0:64920->50000/tcp   talos-default-controlplane-1

Crap. The container was started with control plane port mapping of 64919:6443 . I would have expected a port mapping of 6443:6443 to go along with all the documentation, videos, etc. I don't have any other apps listening on 6443, so the random port number doesn't seem to have been used to deconflict with an existing K8s cluster.

As soon as I updated the KubeConfig with server: https://localhost:64919, kubectl was able to interact with the cluster.

Logs

Environment

  • Macbook Pro: Sonoma 14.5
  • Docker Desktop: 4.31.0 (Kubernetes not enabled)
  • Docker Engine: 26.1.4
  • Talos version: 1.7.5
  • Kubernetes version: 1.30.1 (server version) Note: This command seems invalid: [kubectl version --short]
  • Platform: Docker

jfrosch avatar Jul 13 '24 18:07 jfrosch

talosctl cluster create out of the box generates proper kubeconfig (with the correct port) and merges it into your default ~/.kubeconfig location. So you can do kubectl right after the moment talosctl cluster create finished.

I agree there's a bit of the documentation missing here.

smira avatar Jul 15 '24 07:07 smira

This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 7 days.

github-actions[bot] avatar Jan 12 '25 02:01 github-actions[bot]

This issue was closed because it has been stalled for 7 days with no activity.

github-actions[bot] avatar Jan 18 '25 01:01 github-actions[bot]