These notes assume instructions are followed and that there is an initial node created.

Open internode ports

Using OCI networking tools, open the following:

StatelessSourceIP ProtocolSource Port RangeDestination Port RangeType and CodeAllowsDescription
No10.0.0.0/16TCPAll25000TCP traffic for ports: 25000 (MicroK8s)
No10.0.0.0/16TCPAll10250–10260TCP traffic for ports: 10250–10260 (MicroK8s)
No10.0.0.0/16TCPAll12379TCP traffic for ports: 12379 (MicroK8s)
No10.0.0.0/16TCPAll19001TCP traffic for ports: 19001 (MicroK8s)
No10.0.0.0/16UDPAll4789UDP traffic for ports: 4789 (MicroK8s)
No10.0.0.0/16TCPAll179TCP traffic for ports: 179 (BGP) (MicroK8s)
No10.0.0.0/16IP-in-IPIP-in-IP traffic (MicroK8s)
No10.0.0.0/16ICMPAllAllICMP traffic for: All (MicroK8s)

For each node

Get a VM on the same network as your master node and follow instructions from https://kambur.ie/tips/k8s/microk8sinoci/ optionally skipping External Access section. This in fact will create dependency on the original node being up but we will come back to it.

Run the following to open ports.

# Allow MicroK8s dqlite
sudo iptables -I INPUT 5 -s 10.0.0.0/16 -p tcp --dport 19001 -j ACCEPT -m comment --comment "MicroK8s dqlite"

# Allow MicroK8s cluster agent
sudo iptables -I INPUT 5 -s 10.0.0.0/16 -p tcp --dport 25000 -j ACCEPT -m comment --comment "MicroK8s cluster agent"

# Allow MicroK8s apiserver HA communication
sudo iptables -I INPUT 5 -s 10.0.0.0/16 -p tcp --dport 12379 -j ACCEPT -m comment --comment "MicroK8s apiserver-ha (etcd-like)"

# Allow kubelet and related control-plane traffic
sudo iptables -I INPUT 5 -s 10.0.0.0/16 -p tcp --match multiport --dports 10250:10260 -j ACCEPT -m comment --comment "MicroK8s kubelet and node comms"

Add nodes as here: https://microk8s.io/docs/clustering

Note that if using AMD Free Tier machines, probably best to use them just as workers.

To test:

kubectl run my-shell --rm -i --tty --image nicolaka/netshoot --overrides='{"spec":{"nodeName":"worker-1"}}' -- bash

Using this, you can force K8s to schedule the my-shell pod on newly added worker. Check connectivity to outside world and to the cluster.