The Kubernetes API server listens on port 6443/TCP (--secure-port, HTTPS). kubectl, worker nodes, controllers and CI systems talk to the cluster only through it; kubeadm and k3s use the same port.
Open it only to nodes, admin networks or a VPN – not to the whole internet. Access is governed by certificates or tokens and RBAC; additionally restrict it by firewall to known source IPs. etcd (2379–2380) and the kubelet (10250) must never be public.
Typical: The connection to the server … was refused (port blocked or API server down) or x509: certificate is valid for …, not … because the IP or hostname used is not in the certificate – with kubeadm add it via --apiserver-cert-extra-sans.
Check
nc -zv k8s.example.com 6443