Prerequisites
- Be comfortable in YAML ✍
- Be comfortable with the concept of Docker containers and virtualization (this is a great place to start)
Welcome to a No Nonsense guide to Kubernetes. I promise to do my best to introduce material in a logical manner, provide production-centric examples, pepper in memes and gifs to keep things feeling fresh, and explain complicated material as simply as possible. If you don’t meet both of these prereq’s, give this videos a watch, do your own research, and come back later!
Install Kubectl
Kubectl is the command line tool used to run commands against your Kubernetes cluster.
You must use a kubectl version that is within one minor version difference of your cluster. For example, a v1.2 client should work with v1.1, v1.2, and v1.3 master. Using the latest version of kubectl helps avoid unforeseen issues.
Add Windows or MacOS instructions with a pull request!
Install kubectl
1
curl -LO https://storage.googleapis.com/kubernetes-release/release/`curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt`/bin/linux/amd64/kubectl
To download a specific version, replace the
$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)
portion of the command with the specific version number.Make the kubectl binary executable and move it into your path
1
chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
Test your install:
1
kubectl version --client
Install Minikube
Minikube is a lightweight Kubernetes implementation that creates a VM on your local machine and deploys a simple cluster containing only one node.
Add Windows or MacOS instructions with a pull request!
Install either KVM (which also uses QEMU) or Virtualbox.
If you are a RHEL/CentOS/Fedora user installing VirtualBox, you might encounter:
This system is currently not set up to build kernel modules. Please install the gcc make perl packages from your distribution. Please install the Linux kernel "header" files matching the current kernel for adding new hardware support to the system. The distribution packages containing the headers are probably: kernel-devel kernel-devel-5.3.7-301.fc31.x86_64 There were problems setting up VirtualBox. To re-start the set-up process, run /sbin/vboxconfig as root. If your system is using EFI Secure Boot you may need to sign the kernel modules (vboxdrv, vboxnetflt, vboxnetadp, vboxpci) before you can load them. Please see your Linux system's documentation for more information.
This may cause some extra complication, but I’ve found that the simplest solution is to just disable secure boot in your bios.
If you don’t want to use a VM, use the
--driver=none
flag to run Kubernetes components directly on the host. Using this driver requires Docker and a Linux environment but not a hypervisor. Do not install Docker using snap, as it will more than likely be outdated.Caution: The
none
VM driver can result in security and data loss issues. Before using –driver=none, consult this documentation for more information.
Now, install Minikube via:
Add minikube to your path:
1
sudo install minikube /usr/local/bin/ && rm ./minikube
Verify install replacing the
driver_name
with the hypervisor of your choice from this list. Run the following:1
minikube start --driver=<driver_name>
Once
minikube start
finishes, run:If something doesn’t seem right, use the following to increase your logging level:
1
minikube -v=9 start
When all else fails, you can always blow away your minikube environment using:
1
minikube delete
Stop minikube with:
1
minikube stop