Skip to content

Open ports to incoming traffic#

When installing MKE 4 on a host, you must open specific ports to incoming traffic.

Protocol Port Process Usage Comments
TCP 22 ssh Install node <-> (controller, worker)
TCP 2380 etcd peers controller <-> controller
TCP 6443 kube-apiserver Worker node, CLI => controller Authenticated kube API using kube TLS client certs, ServiceAccount tokens with RBAC.
UDP 4789 Calico Worker node Calico VXLAN overlay.
TCP 10250 kubelet Master, Worker => Host * Authenticated kubelet API for the master node kube-apiserver (and heapster/metrics-server addons) using TLS client cert.
TCP 9443 k0s-api controller <-> controller k0s controller join API, TLS with token auth.
HTTP 33000 Ingress controller
HTTPS 33001 Ingress controller
TCP 33001
GRPC 5557 etcd maintenance. Used for internal communication across services, and thus does not need to be opened externally to the cluster. Manager nodes, though, need to be able to communicate using this port.
TCP 179 Calico controllers, worker nodes BGP peers, used for Kubernetes networking.
TCP 5473 Calico controllers, worker nodes Calico-node connecting to typha. Only needed with Calico CNI-s. Not needed if typha is disabled[that scenario is atypical]
TCP 80 mkectl First two controllers and first two manager nodes, as listed in hosts section of the MKE4.yaml configuration file. Networking checks.

Specific to Windows worker nodes

On Windows worker nodes the same worker ports apply (notably 4789/UDP for Calico VXLAN and 10250/TCP for kubelet), though they are managed by Windows Defender Firewall and not iptables/ufw. For fresh MKE 4 installations, mkectl creates these firewall rules automatically; for upgrade operations, they must already be present beforehand.

Configure firewalld#

MKE 4 does not manage firewalld rules. In its default configuration, firewalld blocks the MKE 4 node ports and rejects forwarded pod traffic between nodes. As a result, all nodes reach the Ready state, but pods cannot communicate across nodes.

The following operations check Linux nodes for firewalld:

  • The mkectl apply command checks each Linux node.
  • The mkectl node add command checks each Linux node that it adds to the cluster.
  • The mkectl upgrade command checks each Linux node when you upgrade from MKE 3. Upgrades between MKE 4 versions do not check for firewalld.

The check fails if firewalld is active or enabled on any checked node, and the command lists the affected nodes. When you run the mkectl apply command on an existing cluster, the command logs a warning instead of failing.

To resolve the issue, either stop and disable firewalld, or configure firewalld for MKE 4.

To stop and disable firewalld, run the following command on each affected node:

sudo systemctl disable --now firewalld

To configure firewalld for MKE 4:

  1. On each node, identify the firewalld zone of the network interface that carries the IP address of the node:

    sudo firewall-cmd --get-zone-of-interface=<interface>
    

    If the interface is not bound to a zone, use the default zone:

    sudo firewall-cmd --get-default-zone
    
  2. Open the MKE 4 node ports in that zone:

    • On controller nodes:

      sudo firewall-cmd --permanent --zone=<zone> \
        --add-port=6443/tcp --add-port=2380/tcp --add-port=9443/tcp \
        --add-port=10250/tcp --add-port=4789/udp --add-port=5473/tcp \
        --add-port=80/tcp
      
    • On worker nodes:

      sudo firewall-cmd --permanent --zone=<zone> \
        --add-port=10250/tcp --add-port=4789/udp --add-port=5473/tcp \
        --add-port=80/tcp
      

    Adjust the ports to your cluster configuration:

    • If the cluster uses BGP, also open port 179/tcp on all nodes.
    • If MetalLB is enabled, also open ports 7946/tcp and 7946/udp on all nodes.
    • If you set a networking check port other than the default with the --cni-check-port flag, open that port instead of 80/tcp.
  3. On each node, add the pod network CIDR to the trusted zone to allow forwarded pod traffic:

    sudo firewall-cmd --permanent --zone=trusted --add-source=<pod-cidr>
    

    If the Calico values.yaml sets an IP pool in installation.calicoNetwork.ipPools, the pod network CIDR is the CIDR of that pool. Otherwise, the pod network CIDR is the cidrV4 setting, which defaults to 192.168.0.0/16. For more information, refer to Configure CNI providers.

  4. If the cluster uses the Calico eBPF data plane, add the IP address of the node to the trusted zone as a /32 source:

    sudo firewall-cmd --permanent --zone=trusted --add-source=<node-ip-address>/32
    
  5. Reload firewalld to apply the permanent rules:

    sudo firewall-cmd --reload
    
  6. Run the mkectl command again with the --skip-firewalld-check flag.

Note

The mkectl node add command fails the firewalld check even on an existing cluster. Configure firewalld on each new node before you add it to the cluster.