Local Kubernetes Environments

with minikube


presented by @ryanj, Developer Advocate at Red Hat

### Single-Node Kubernetes ## with minikube To run minikube on your laptop, you'll need to install: 1. [kubectl](#/kubectl) 2. [minikube](#/minikube) 3. [docker](#/docker)

Install kubectl

Installation on linux/amd64:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

Installation on macOS:

curl -LO https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/darwin/amd64/kubectl && chmod +x kubectl && sudo mv kubectl /usr/local/bin/

For other platforms, consult the upstream kubectl install doc

To verify kubectl availability, try running:

kubectl help

Install minikube

Installation on linux/amd64:

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Installation on macOS:

curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

For other platforms, see the minikube release notes

Optionally, customize your cluster's memory or cpu allocation:

minikube config set memory 4096
minikube config set cpus 2

to verify minikube availability:

minikube version

Minikube Basics

minikube provides an easy way to run Kubernetes locally:

minikube start

When you are done, halt the VM to free up system resources:

minikube stop

Need a fresh start? Delete your VM instance with:

minikube delete

Minikube troubleshooting

If your minikube environment does not boot correctly:

  1. Minikube requires an OS virtualization back-end
  2. Most OSes include some support for virtualization
  3. You can use the --vm-driver flag to select a specific virt provider
minikube start --vm-driver=virtualbox

Check the project README for more information about supported virtualization plugins

Install docker

Use your package manager, or download a release from Docker

brew cask install docker
dnf install docker
apt-get install docker

To verify docker availability, run:

docker version


Verify that your local Kubernetes environment is ready by running:

kubectl version

The output should include your kubectl version info, and the release version of the kubernetes API server (when available)

Congratulations on completing:

Local Kubernetes Environments with minikube


Next Steps

Continue learning with other k8s-workshops:

  1. Kubernetes Command-Line Basics with kubectl
  2. Kubernetes Architecture (adapted for minikube)
  3. Local Development with minikube
Runs on Kubernetes Presented by: @ryanj