Creating a K8s Cluster with Zarf
In this tutorial, we will demonstrate how to use Zarf on a fresh Linux machine to deploy a k3s cluster through Zarf’s k3s
component.
root
access on a Linux machine
Before beginning this tutorial you will need the following:
- The Zarf repository cloned: (
git clone
Instructions) - Zarf binary installed on your $PATH: (Installing Zarf)
- An init-package built/downloaded: (init-package Build Instructions) or (Download Location)
- Run the
zarf init
command asroot
.
- Confirm Package Deployment:
- When prompted to deploy the package select
y
for Yes, then hit theenter
key.
- Confirm k3s Component Deployment:
- When prompted to deploy the k3s component select
y
for Yes, then hit theenter
key.
After the zarf init
command is done running, you should see a k3s cluster running and a few zarf
pods in the zarf
namespace.
By default, the k3s component will only automatically provide cluster access to the root user. To access the cluster as another user, you can run the following to setup the ~/.kube/config
file:
The zarf destroy
command will remove all of the resources, including the k3s cluster, that was created by the initialization command.