Prerequisites

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!

  1. 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.

  2. Make the kubectl binary executable and move it into your path

    1
    
    chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl
    
  3. 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!

  1. 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.

  2. Now, install Minikube via:

    1
    2
    
    curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 \
    && chmod +x minikube
    
  3. Add minikube to your path:

    1
    
    sudo install minikube /usr/local/bin/ && rm ./minikube
    
  4. Verify install replacing the driver_name with the hypervisor of your choice from this list. Run the following:

    1. 1
      
       minikube start --driver=<driver_name>
      
    2. Once minikube start finishes, run:

      1
      2
      3
      4
      5
      6
      7
      
      minikube status
      
      # Your output should look something like this:
      #> host: Running
      #> kubelet: Running
      #> apiserver: Running
      #> kubeconfig: Configured
      
    3. If something doesn’t seem right, use the following to increase your logging level:

      1
      
      minikube -v=9 start
      
    4. When all else fails, you can always blow away your minikube environment using:

      1
      
      minikube delete
      
    5. Stop minikube with:

      1
      
      minikube stop
      

Additional Resources