For now, we are woking on a deploy tool helps you set up a working kubernetes cluster in just a few steps.
Prerequisite:
CentOS Stream 9: the currently tested working distro, since the rust container runtime youki has a limit on linux kernel version.
gcc: compiler which rustc depends on.
cargo command available: which means you need to have rust installed.
cfssl: If you do not have one installed, you can run rk8s install cfssl
after the configuration is generated.
First, clone & build the crate:
git clone https://github.com/open-rust-initiative/rk8s.git
cd rk8s
cargo build
cp target/debug/rk8s /usr/bin
Then you should now have a working rk8s
ready for deploying.
The
rk8s
command needs root privilege.
-
rk8s generate config
will generate a folder namedrk8s
under/root
directory. -
Change the content in
/root/rk8s/cfg/config.yaml
, specify the machines' IP addresses and their according roles (master or worker) ininstance_hosts
filed, if your deploying machine (the machine runningrk8s
) will be outside of cluster, theninstance_ip
andinstance_name
fields are irrelevant. -
ssh-keygen
to generate a key for ssh connection across machines, andssh-copy-id -i <path/to/.pub> root@<IP address>
notifies machines to be deployed. -
rk8s install cfssl
to install cfssl-related tools for later use. -
Run
rk8s deploy
.
Then you should have a working cluster, ssh to the master node and run kubectl get nodes
, you should see the master node is ready.
-
Run
rk8s generate config
on every machine to be deployed. -
Run
rk8s precheck
to turn off selinux, firewall and so forth. -
Change the content in
/root/rk8s/cfg/config.yaml
, specify the machines' IP addresses and their according roles (master or worker) ininstance_hosts
filed,instance_ip
andinstance_name
fields need to be set correctly according to theIP
andhostname
of the current machine. -
Run
rk8s install etcd
on each instance. -
For masters run:
$ rk8s install kubernetes $ rk8s install docker
-
Run
rk8s init
on master node. -
Run
rk8s join
on worker node.
After rk8s
finishes its job, the cluster is now set, the deploying machine is inside the cluster.