Supose you are in a new server and you want to install k3s in it.
Goals
- Simplify regular server and new server deployments
- Configuration with off-the-shelf tools
- Secrets management
Prerequisites
Documentation says to disable the firewall. That’s preposterous!
It also has rules to allow k3s ports which are much better:
#RHEL
firewall-cmd --permanent --add-port=6443/tcp #apiserver
firewall-cmd --permanent --zone=trusted --add-source=10.42.0.0/16 #pods
firewall-cmd --permanent --zone=trusted --add-source=10.43.0.0/16 #services
firewall-cmd --reload
#Ubuntu ufw
ufw allow 6443/tcp #apiserver
ufw allow from 10.42.0.0/16 to any #pods
ufw allow from 10.43.0.0/16 to any #servicesInstall script
curl -sfL https://get.k3s.io | sh -Copy kubeconfig for normal user
mkdir -p ~/.kube \
&& sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config \
&& sudo chown $(id -u):$(id -g) ~/.kube/config
&& export KUBECONFIG=$HOME/.kube/configInspect the cluster
kubectl get nodes
kubectl get pods -ARelated Ideas
- check Extra tooling