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.
-
Install kubectl with Homebrew on macOS
- Run the installation command:
brew install kubectl
- 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
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
Starting a dashboard to monitoring k8s
minikube dashboard
Or using the IDE Lens
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