minikube installation on Ubuntu

feature image

minikube installation on Ubuntu

Please install Docker in your Ubuntu first.

Install minikube

Run:

curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube

Output:

  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 73.1M  100 73.1M    0     0   133M      0 --:--:-- --:--:-- --:--:--  132M
ubuntu@ip-172-31-4-26:~$ minikube
minikube provisions and manages local Kubernetes clusters optimized for development workflows.

Basic Commands:
  start            Starts a local Kubernetes cluster
[...]

Add permission for non-root user

Run:

sudo usermod -aG docker $USER && newgrp docker
minikube start

Output:

πŸ˜„  minikube v1.28.0 on Ubuntu 22.04
✨  Automatically selected the docker driver. Other choices: none, ssh
πŸ“Œ  Using Docker driver with root privileges
πŸ‘  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
πŸ’Ύ  Downloading Kubernetes v1.25.3 preload ...
    > preloaded-images-k8s-v18-v1...:  385.44 MiB / 385.44 MiB  100.00% 112.87 
    > gcr.io/k8s-minikube/kicbase:  386.27 MiB / 386.27 MiB  100.00% 23.75 MiB 
    > gcr.io/k8s-minikube/kicbase:  0 B [________________________] ?% ? p/s 12s
πŸ”₯  Creating docker container (CPUs=2, Memory=2200MB) ...
🐳  Preparing Kubernetes v1.25.3 on Docker 20.10.20 ...
    β–ͺ Generating certificates and keys ...
    β–ͺ Booting up control plane ...
    β–ͺ Configuring RBAC rules ...
πŸ”Ž  Verifying Kubernetes components...
    β–ͺ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: default-storageclass, storage-provisioner
πŸ’‘  kubectl not found. If you need it, try: 'minikube kubectl -- get pods -A'
πŸ„  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default

Interact with your cluster

Run:

minikube kubectl -- get pods -A

Output:

    > kubectl.sha256:  64 B / 64 B [-------------------------] 100.00% ? p/s 0s
    > kubectl:  42.93 MiB / 42.93 MiB [-----------] 100.00% 29.91 GiB p/s 200ms
NAMESPACE     NAME                               READY   STATUS    RESTARTS       AGE
kube-system   coredns-565d847f94-fkhkq           1/1     Running   0              8m40s
kube-system   etcd-minikube                      1/1     Running   0              8m54s
kube-system   kube-apiserver-minikube            1/1     Running   0              8m52s
kube-system   kube-controller-manager-minikube   1/1     Running   0              8m52s
kube-system   kube-proxy-jspwh                   1/1     Running   0              8m40s
kube-system   kube-scheduler-minikube            1/1     Running   0              8m52s
kube-system   storage-provisioner                1/1     Running   1 (8m9s ago)   8m50s
minikube kubectl cluster-info

Output:

Kubernetes control plane is running at https://192.168.49.2:8443
CoreDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Make alias

Run:

alias kubectl="minikube kubectl --"

Output:

Run:

kubectl cluster-info
Kubernetes control plane is running at https://192.168.49.2:8443
CoreDNS is running at https://192.168.49.2:8443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy

To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.

Run:

minikube dashboard

Output:

πŸ”Œ  Enabling dashboard ...
    β–ͺ Using image docker.io/kubernetesui/metrics-scraper:v1.0.8
    β–ͺ Using image docker.io/kubernetesui/dashboard:v2.7.0
πŸ’‘  Some dashboard features require the metrics-server addon. To enable all features please run:

        minikube addons enable metrics-server


πŸ€”  Verifying dashboard health ...
πŸš€  Launching proxy ...
πŸ€”  Verifying proxy health ...
πŸŽ‰  Opening http://127.0.0.1:45897/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
πŸ‘‰  http://127.0.0.1:45897/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/

Run:

kubectl get nodes

Output:

NAME       STATUS   ROLES           AGE   VERSION
minikube   Ready    control-plane   8h    v1.25.3

Run:

kubectl get namespaces

Output:

NAME                   STATUS   AGE
default                Active   8h
kube-node-lease        Active   8h
kube-public            Active   8h
kube-system            Active   8h
kubernetes-dashboard   Active   4m40s

Run:

kubectl get pods

Output:

No resources found in default namespace.

Run:

kubectl get pods -A

Output:

NAMESPACE              NAME                                        READY   STATUS    RESTARTS     AGE
kube-system            coredns-565d847f94-fkhkq                    1/1     Running   0            8h
kube-system            etcd-minikube                               1/1     Running   0            8h
kube-system            kube-apiserver-minikube                     1/1     Running   0            8h
kube-system            kube-controller-manager-minikube            1/1     Running   0            8h
kube-system            kube-proxy-jspwh                            1/1     Running   0            8h
kube-system            kube-scheduler-minikube                     1/1     Running   0            8h
kube-system            storage-provisioner                         1/1     Running   1 (8h ago)   8h
kubernetes-dashboard   dashboard-metrics-scraper-b74747df5-v5z26   1/1     Running   0            5m31s
kubernetes-dashboard   kubernetes-dashboard-57bbdc5f89-72fsj       1/1     Running   0            5m31s

Run:

kubectl get pods 

Output:

No resources found in default namespace.

,