Local Kubernetes installation
There are several tools that can be used to deploy Kubernetes on one or many clusters. Some of them include:
Minikube is the easiest and preferred method for setting up Kubernetes locally. It is used to manage a single-node cluster, although there is already an experimental feature that supports multi-node clusters.
Minikube
The minikube project is a local Kubernetes cluster implementation for Linux, macOS, and Windows. Its goal is to be the best tool for local Kubernetes application development 1.
The first steps with minikube can be found in the official documentation and are as follows 2:
Requirements
- 2 CPUs or more
- 2GB of RAM
- 20GB of disk space
- Internet connection
- Container or virtual machine manager, such as: Docker, Hyperkit, Hyper-V, KVM, Parallels, Podman, VirtualBox, or VMware.
Installing minikube
For Linux there are three options:
- Binary package:
| |
- Debian package:
| |
- RPM package:
| |
To start minikube, run:
| |
To stop minikube safely, run:
| |
Installing Kubernetes
Kubernetes can be installed locally on virtual machines or directly on the operating system. Tools such as Ansible or kubeadm can be used to automate the installation.
The CLI tool kubectl can be used to manage, deploy, and configure the resources and applications of the Minikube cluster, and can be installed with the following commands:
| |
For details on kubectl commands, you can refer to the kubectl book, the official Kubernetes documentation, or its GitHub repository.
A common step after installation is to configure and enable kubectl command autocompletion:
| |
Other relevant packages to install include:
kubeadm: used for managing or automating the installationkubelet: an agent that runs on each node and communicates with the control plane componentskubernetes-cni: allows configuring network elements
| |