Skip to content

Instantly share code, notes, and snippets.

@harkamals
Last active December 16, 2021 14:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save harkamals/578a45e75ffbd1421b61f3cbbbb6441c to your computer and use it in GitHub Desktop.
Save harkamals/578a45e75ffbd1421b61f3cbbbb6441c to your computer and use it in GitHub Desktop.
Minikube setup on MacOS High Sierra 10.13.4

Starting a minikube kubernetes cluster locally on macOS

$ brew update
$ brew install virtualbox
$ brew install kubernetes-cli
$ curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.27.0/minikube-darwin-amd64 && chmod +x minikube && sudo mv minikube /usr/local/bin/

Enable bash auto-completion

minikube completion bash > /usr/local/etc/bash_completion.d/minikube-completion
source ~/.bash_profile

Start local cluster

$ minikube start
Starting local Kubernetes v1.10.0 cluster...
Starting VM...
Downloading Minikube ISO
 150.53 MB / 150.53 MB [============================================] 100.00% 0s
Getting VM IP address...
Moving files into cluster...
Downloading kubeadm v1.10.0
Downloading kubelet v1.10.0
Finished Downloading kubelet v1.10.0
Finished Downloading kubeadm v1.10.0
Setting up certs...
Connecting to cluster...
Setting up kubeconfig...
Starting cluster components...
Kubectl is now configured to use the cluster.
Loading cached images from config file.

If you are behind a proxy:

$ minikube start --docker-env HTTP_PROXY=$http_proxy \
                 --docker-env HTTPS_PROXY=$https_proxy

Check status

$ minikube status
minikube: Running
cluster: Running
kubectl: Correctly Configured: pointing to minikube-vm at 192.168.99.100

$ kubectl get all
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.96.0.1    <none>        443/TCP   5m

Open dashboard in the browser

$ minikube dashboard
Opening kubernetes dashboard in default browser...

Check cluster information

$ kubectl cluster-info
Kubernetes master is running at https://192.168.99.100:8443
KubeDNS is running at https://192.168.99.100:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

Check node information

$ kubectl get nodes
NAME       STATUS    ROLES     AGE       VERSION
minikube   Ready     master    33m       v1.10.0

Check pod information

$ kubectl get pods
No resources found.
$ kubectl get pods --all-namespaces
NAMESPACE     NAME                                    READY     STATUS    RESTARTS   AGE
kube-system   etcd-minikube                           1/1       Running   0          32m
kube-system   kube-addon-manager-minikube             1/1       Running   0          32m
kube-system   kube-apiserver-minikube                 1/1       Running   1          32m
kube-system   kube-controller-manager-minikube        1/1       Running   0          33m
kube-system   kube-dns-86f4d74b45-bjgdt               3/3       Running   0          33m
kube-system   kube-proxy-btdhv                        1/1       Running   0          33m
kube-system   kube-scheduler-minikube                 1/1       Running   0          33m
kube-system   kubernetes-dashboard-5498ccf677-rlsgb   1/1       Running   0          33m
kube-system   storage-provisioner                     1/1       Running   0          33m

Get current context, usefull when managing several clusters

$ kubectl config current-context
minikube

Get current context related information

$ kubectl config view
apiVersion: v1
clusters:
- cluster:
    certificate-authority: /Users/hk/.minikube/ca.crt
    server: https://192.168.99.100:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /Users/hk/.minikube/client.crt
    client-key: /Users/hk/.minikube/client.key

Shutdown minikube

$ minikube stop
Stopping local Kubernetes cluster...
Machine stopped.
@manidevi07
Copy link

Ya its working fine , thanks a lot

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