Package: kubeinit
The KUBErnetes INITiatorWhat is KubeInit?KubeInit provides Ansible playbooks and roles for the deployment
and configuration of multiple Kubernetes distributions.
KubeInit's mission is to have a fully automated way to deploy in
a single command a curated list of prescribed architectures.DocumentationKubeInit's documentation is hosted inthis same repository.Periodic jobs statusThere is a set of predefined scenarios that are tested on
a weekly basis, the result of those executions is
presented in theperiodic job execution page.KubeInit supported scenariosK8s distribution:OKD (testing K8S, RKE, EKS, RKE)Driver:LibvirtOS:CentOS/Fedora, Debian/UbuntuRequirementsA fresh deployed server with enough RAM and disk space (120GB in RAM and 300GB in disk) and CentOS 8 (it should work also in Fedora/Debian/Ubuntu hosts).Adjust the inventory file to suit your needs.By default the first hypervisor node is called nyctea (defined in the inventory). Replace it with the hostname you specified if you changed it.
You can also use the names in the inventory as aliases for your own hostnames using ~/.ssh/config (described in more detail below).Have root passwordless access with certificates.Having podman installed in the machine where you are running ansible-playbook.Check if nyctea is reachable via passwordless root accessIf you need to setup aliases in ssh for nyctea, tyto, strix, or any other hypervisor hosts that
you have added or are mentioned in the inventory, you can create a file named config in ~/.ssh
with contents like this:echo"Host nyctea">>~/.ssh/configecho"  Hostname actual_hostname">>~/.ssh/configFor example, if you have a deployed server that you can already ssh into as root calledserver.mysite.localyou can create a ~/.ssh/config with these contents:Host nyctea
  Hostname server.mysite.localNow you should be ready to try access to your ansible host like this:sshroot@nycteaIf it fails. check if you have an ssh key, and generate one if you don'tif[-f~/.ssh/id_rsa];thenssh-keygenssh-copy-id/root/.ssh/id_rsaroot@nycteafiHow to runThere are two ways of launching Kubeinit, directly using the
ansible-playbook command, or by running it inside a container.Directly executing the deployment playbookThe following example command will deploy an OKD 4.8 cluster with a 3 node control-plane
and 1 worker node in a single command and in approximately 30 minutes.# Install the requirements assuming python3/pip3 is installedpip3install\--upgrade\pip\shyaml\ansible\netaddr# Get the project's source codegitclonehttps://github.com/Kubeinit/kubeinit.gitcdkubeinit# Install the Ansible collection requirementsansible-galaxycollectioninstall--force--requirements-filekubeinit/requirements.yml# Build and install the collectionrm-rf~/.ansible/collections/ansible_collections/kubeinit/kubeinit
ansible-galaxycollectionbuildkubeinit--verbose--force--output-pathreleases/
ansible-galaxycollectioninstall--force--force-with-depsreleases/kubeinit-kubeinit-`catkubeinit/galaxy.yml|shyamlget-valueversion`.tar.gz# Run the playbookansible-playbook\-v--userroot\-ekubeinit_spec=okd-libvirt-3-1-1\-ehypervisor_hosts_spec='[{"ansible_host":"nyctea"},{"ansible_host":"tyto"}]'\./kubeinit/playbook.ymlAfter provisioning any of the scenarios, you should have your environment ready to go.
To connect to the nodes from the hypervisor use the IP addresses from the inventory files.Running the deployment command from a containerThe whole process is explained in theHowTo's.
The following commands build a container image with the project inside of it, and then
launches the container executing the ansible-playbook command with all the
standard ansible-playbook parameters.Kubeinit is built and installed when deploying from a container as those steps
are included in the Dockerfile, there is no need to build and install
the collection locally if its used through a container.Note: When running the deployment from a container,nycteacan not be 127.0.0.1, it needs to be
the hypervisor's IP address. Also when running the
deployment as a user different than root, the
keys needs to be also updated.Running from the GIT repositoryNote:Won't work with ARM.git clone https://github.com/Kubeinit/kubeinit.git
cd kubeinit
podman build -t kubeinit/kubeinit .

podman run --rm -it \
    -v ~/.ssh/id_rsa:/root/.ssh/id_rsa:z \
    -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub:z \
    -v ~/.ssh/config:/root/.ssh/config:z \
    kubeinit/kubeinit \
        -v --user root \
        -e kubeinit_spec=okd-libvirt-3-1-1 \
        -i ./kubeinit/inventory.yml \
        ./kubeinit/playbook.ymlRunning from a releaseInstall [jq](https://stedolan.github.io/jq/)

# Get latest release tag name
TAG=$(curl --silent "https://api.github.com/repos/kubeinit/kubeinit/releases/latest" | jq -r .tag_name)
podman run --rm -it \
    -v ~/.ssh/id_rsa:/root/.ssh/id_rsa:z \
    -v ~/.ssh/id_rsa.pub:/root/.ssh/id_rsa.pub:z \
    -v ~/.ssh/config:/root/.ssh/config:z \
    quay.io/kubeinit/kubeinit:$TAG \
        -v --user root \
        -e kubeinit_spec=okd-libvirt-3-1-1 \
        -i ./kubeinit/inventory.yml \
        ./kubeinit/playbook.ymlHowTo's and presentationsThe easiest and fastest way to deploy an OKD 4.5 cluster in a Libvirt/KVM Host.KubeInit external access for OpenShift/OKD deployments with Libvirt.Deploying KubeInit from a container.KubeInit: Bringing good practices from the OpenStack ecosystem to improve the way OKD/OpenShift deploys,slides.Persistent Volumes And Claims In KubeInitDeploying Multiple KubeInit Clusters In The Same HypervisorKubeInit 4-In-1 - Deploying Multiple Kubernetes Distributions (K8S, OKD, RKE, And CDK) With The Same PlatformSupporters