This is not production ready and proofed solution!!!
Try to make k8s clustering as easy as possible and design solution for companies / startups with small or no platform engineering. This is 3 layer platform demo following git-ops guidelines.
Components:
- fedora core with rpm-ostree
- k0s
- haproxy
TODO
Start os you want on the VM and install podman, than just run:
podman run --rm --privileged -v /dev:/dev -v /var/lib/containers:/var/lib/containers -v /:/target \
--pid=host --security-opt label=type:unconfined_t \
ghcr.io/theztd/kluster:amd64 \
bootc install to-existing-root --root-ssh-authorized-keys /target/root/.ssh/authorized_keys
than restart the VM and installation is done!
configure env/YOUR_ENV/inventory file and run setup playbook
ansible-playbook -i envs/hz1/inventory playbook/setup-cluster.yaml
After the first run, you have to generate join token on cp and store it as k0s_join_token variable (it is recommended to encrypt it via ansible-vault). Than run the playbook again and cluster will be ready.
# Generate token on cp-1 node
cp-1: ~ > k0s token create --role worker --expiry 10h
bootc upgrade
reboot
# create new user
# add him to group system:masters
# generate client config file
k0s kubeconfig create --groups "system:masters" new-user > config.yaml
# add user to another roles
k create clusterrolebinding marek --clusterrole=cluster-admin --user=marek
bootc usr-overlay
dnf install strace nmap tcpdump
After os reboot everything will be at state before this installation.