Kubernetes, also known as K8s, is an open-source platform for automating deployment, scaling, and management of containerized applications. K3s is a lightweight and simple distribution of Kubernetes, specifically designed for resource-constrained environments. This article provides a step-by-step guide to help you install K3s on a dedicated Hetzner server.
Before installing K3s, there are a few things you need to consider:
Ensure that you have a dedicated Hetzner server with a minimum of 2GB of RAM and at least 20GB of disk space.
Make sure that the server is running Ubuntu 20.04 LTS or later.
You need to have root access to the server or an account with sufficient privileges to install packages and configure the server.
You will also need a domain name or a public IP address that resolves to your server.
Installing K3s on a dedicated Hetzner server involves the following steps:
The first step is to add the K3s repository to your server. This can be done by running the following command:
curl -sfL https://get.k3s.io | sh -
Next, you need to install K3s by running the following command:
sudo k3s server &
To verify the installation, run the following command:
sudo k3s kubectl get node
You should see the following output:
NAME STATUS ROLES AGE VERSION
localhost Ready master xxx v1.x.x
Once you have installed K3s, you need to configure it to your specific requirements.
Next, you need to connect to K3s by running the following command:
sudo k3s kubectl config set-cluster default-cluster --server=https://localhost:6443 --insecure-skip-tls-verify=true
sudo k3s kubectl config set-context default-context --cluster=default-cluster
sudo k3s kubectl config use-context default-context
To verify that you have successfully configured K3s, run the following command:
sudo k3s kubectl get node
You should see the output similar to the following:
NAME STATUS ROLES AGE VERSION
localhost Ready master xxx v1.x.x
Installing K3s on a dedicated Hetzner server is a straightforward, see you soon for an another post !