Skip to content

Instantly share code, notes, and snippets.

@mathsigit
Last active September 25, 2020 09:00
Show Gist options
  • Save mathsigit/881683178f6994a91c9fefb2e0ee30b1 to your computer and use it in GitHub Desktop.
Save mathsigit/881683178f6994a91c9fefb2e0ee30b1 to your computer and use it in GitHub Desktop.

Minikube

Install

macOS

Before you begin

To check if virtualization is supported on macOS, run the following command on your terminal.

sysctl -a | grep -E --color 'machdep.cpu.features|VMX'

If you see VMX in the output (should be colored), the VT-x feature is enabled in your machine.

Installing minikube

  • Install kubectl with Homebrew on macOS

    1. Run the installation command:
    brew install kubectl   
    
    1. Test to ensure the version you installed is up-to-date:
    kubectl version --client
    
  • Install a Hypervisor

    If you do not already have a hypervisor installed, install one of these now:

  • Install Minikube with Homebrew on macOS

    brew install minikube
    

Confirm Installation

To confirm successful installation of both a hypervisor and Minikube, you can run the following command to start up a local Kubernetes cluster:

minikube start --driver=<driver_name>

Note: A full list of --driver values is available in specifying the VM driver documentation

Here we start minikube within docker driver. More info about minikube docker driver

minikube start --driver=docker

To make docker the default driver:

minikube config set driver docker

>❗  These changes will take effect upon a minikube delete and then a minikube start

To set resource as default when starting minikube

minikube config set memory 4096
minikube config set cpus 4

Also, you could use specified kubernetes version when starting minikube

minikube start --kubernetes-version v1.15.3

Once minikube start finishes, run the command below to check the status of the cluster:

minikube status

If your cluster is running, the output from minikube status should be similar to:

minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

To stop your cluster, run:

minikube stop

DashBoard

Starting a dashboard to monitoring k8s

minikube dashboard

Or using the IDE Lens

Clean up local state

If you have previously installed Minikube, and run:

minikube start

and minikube start returned an error:

machine does not exist

then you need to clear minikube's local state:

minikube delete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment