Installation Options
To setup a Kubernetes cluster, there are several options available, each with its own advantages and use cases. Below are some of the most popular methods for installing Kubernetes:- Minikube: A local Kubernetes cluster that is easy to set up and ideal for development and testing purposes.
- kubeadm: A tool that provides a simple way to create a Kubernetes cluster on any machine
- k3s: A lightweight Kubernetes distribution designed for edge computing and IoT devices.
- microk8s: A minimal Kubernetes distribution that is easy to install and suitable for development and testing.
k3s Installation
Here is the documentation as well as the GitHub repository.
1
Install Script
The easiest way to install k3s is to use the installation script provided by the k3s project. You can run the following command in your terminal:This command will download and execute the installation script, which will set up k3s, its dependencies, and
kubectl on your machine.Make sure you have curl installed on your system before running the above command.
Terminal Output
2
Verify Installation
After the installation is complete, you can verify that k3s is running by checking the status of the service:You should see output indicating that the k3s service is active and running.
Terminal Output
You can also check the Kubernetes cluster status using This command should show your node(s) in a
kubectl:Ready state.3
Fix kubectl Permission Issue
You can refer this link for more details.
kubectl commands (e.g., kubectl get nodes), it may be because the k3s installation creates a kubeconfig file that is owned by root. To fix this issue, you can change the ownership of the kubeconfig file to your user.Issue
Fix Permission Issue
~/.bashrc or ~/.profile):~/.bashrc
kubectl commands without encountering permission issues:Verify kubectl Access
