projects:k8s:k8s_setup_with_k0s_k0sctl
Home | clubs :: cloud club :: python_club :: 3D-Printing | projects :: Proxmox | Kubernetes | scripting | utilities | games
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| projects:k8s:k8s_setup_with_k0s_k0sctl [2025/08/12 04:43] – created - external edit 127.0.0.1 | projects:k8s:k8s_setup_with_k0s_k0sctl [2026/06/09 07:02] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 11: | Line 11: | ||
| - Required prep - Ensure unique system ID. K0s cluster deployment will fail if aren' | - Required prep - Ensure unique system ID. K0s cluster deployment will fail if aren' | ||
| sudo systemd-machine-id-setup | sudo systemd-machine-id-setup | ||
| + | </ | ||
| + | - Disable SELinux because k0sctl doesn' | ||
| + | sudo setenforce 0 | ||
| </ | </ | ||
| - System prep ( RPM-based distros ) | - System prep ( RPM-based distros ) | ||
| - | - Download the binary: | + | - Download the k0sctl |
| - URL: [[https:// | - URL: [[https:// | ||
| + | - Download the k0s binary: | ||
| + | - URL: [[https:// | ||
| + | - Copy the binaries into / | ||
| + | sudo cp k0sctl* / | ||
| + | sudo chmod u+x / | ||
| + | sudo cp k0s-v* / | ||
| + | sudo chmod u+x / | ||
| + | </ | ||
| ==== Initialize cluster - Control nodes only ==== | ==== Initialize cluster - Control nodes only ==== | ||
| Line 25: | Line 36: | ||
| - Copy or generate the configuration file | - Copy or generate the configuration file | ||
| - If you already have a configuration file, copy it into the current directory | - If you already have a configuration file, copy it into the current directory | ||
| - | - If you don't already have a k0sctl.yaml ( configuration ) file, create a default configuration file< | + | - If not, copy the following |
| - | k0s config create > / | + | |
| - | </ | + | |
| - | - The conent will look like the following:< | + | |
| apiVersion: k0sctl.k0sproject.io/ | apiVersion: k0sctl.k0sproject.io/ | ||
| kind: Cluster | kind: Cluster | ||
| Line 68: | Line 76: | ||
| effect: NoExecute | effect: NoExecute | ||
| controllerWorkers: | controllerWorkers: | ||
| + | </ | ||
| + | - Generate or copy your ssh keys to each target. If you're not sure how, have a look at this site: [[https:// | ||
| + | - Open the firewall ports on the control plane node(s)< | ||
| + | # Open Kubernetes API server port | ||
| + | firewall-cmd --permanent --add-port=6443/ | ||
| + | |||
| + | # Open Kubelet API port | ||
| + | firewall-cmd --permanent --add-port=10250/ | ||
| + | |||
| + | # Open default k0s internal networking ports (BGP and VXLAN) | ||
| + | firewall-cmd --permanent --add-port=179/ | ||
| + | firewall-cmd --permanent --add-port=4789/ | ||
| + | |||
| + | # Tell Fedora to trust all traffic on the container network bridges | ||
| + | firewall-cmd --permanent --zone=trusted --add-interface=cni0 | ||
| + | firewall-cmd --permanent --zone=trusted --add-interface=kube-router | ||
| + | |||
| + | # Allow pods to masquerade/ | ||
| + | firewall-cmd --permanent --zone=trusted --add-masquerade | ||
| + | |||
| + | firewall-cmd --permanent --zone=trusted --add-source=10.244.0.0/ | ||
| + | firewall-cmd --permanent --zone=trusted --add-source=10.96.0.0/ | ||
| + | |||
| + | # Reload firewall to apply changes | ||
| + | firewall-cmd --reload | ||
| + | </ | ||
| + | - Disable the firewall completely **on the worker nodes** since k8s doesn' | ||
| + | sudo systemctl stop firewalld && sudo disable firewalld | ||
| </ | </ | ||
| - Create the cluster< | - Create the cluster< | ||
| Line 81: | Line 117: | ||
| grep -i port / | grep -i port / | ||
| </ | </ | ||
| - | - Open the required firewall ports: < | + | |
| - | firewall-cmd --permanent --add-port={8133/ | + | |
| - | firewall-cmd --reload | + | |
| - | </ | + | |
| ==== Verify the cluster setup/ | ==== Verify the cluster setup/ | ||
projects/k8s/k8s_setup_with_k0s_k0sctl.1754973796.txt.gz · Last modified: by 127.0.0.1
