Install Kubernetes Cluster with Minikube on Ubuntu

Install Kubernetes Cluster dengan Minikube pada Ubuntu

Install Kubernetes Cluster with Kubeadm on CentOS

Install Kubernetes Cluster with Kubeadm on Ubuntu

Install Kubernetes Cluster with MicroK8s on Ubuntu

  • Minimum requirement: 2 CPU & 4GB RAM
  • Update repository index ubuntu
apt update && apt upgrade -y
  • Install docker runtime
apt install -y curl wget apt-transport-https
apt install -y docker.io
systemctl start docker && systemctl enable docker
  • Install Minikube
wget https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
cp minikube-linux-amd64 /usr/local/bin/minikube
chmod +x /usr/local/bin/minikube
  • Cek versi minikube
minikube version
...<output>...
minikube version: v1.26.0
commit: f4b412861bb746be73053c9f6d2895f12cf78565
  • Install Kubectl
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
mv kubectl /usr/local/bin/
  • Cek versi kubectl
kubectl version -o yaml
...<output>...
clientVersion:
  buildDate: "2022-07-13T14:30:46Z"
  compiler: gc
  gitCommit: aef86a93758dc3cb2c658dd9657ab4ad4afc21cb
  gitTreeState: clean
  gitVersion: v1.24.3
  goVersion: go1.18.3
  major: "1"
  minor: "24"
  platform: linux/amd64
kustomizeVersion: v4.5.4
The connection to the server localhost:8080 was refused - did you specify the right host or port?
  • Tambahakan user: sysops untuk menjalankan minikube
adduser sysops
usermod -aG sudo sysops
usermod -aG docker sysops

  • Masuk sebagai user sysops
su - sysops
  • Jalankan Minikube dengan driver: docker, dan buat 3 node masing-masing cpu:2, ram:2560MB, install addons, kubernetes versi stabil, bootstrap: kubeadm, dan network plugin: cni/calico
minikube start --driver=docker --nodes 3 --cpus=2 --memory 2560 --install-addons=true --kubernetes-version=stable --bootstrapper=kubeadm --network-plugin=cni --cni=calico
...<output>...
😄  minikube v1.26.0 on Ubuntu 20.04 (amd64)
✨  Using the docker driver based on user configuration
❗  With --network-plugin=cni, you will need to provide your own CNI. See --cni flag as a user-friendly alternative
📌  Using Docker driver with root privileges
👍  Starting control plane node minikube in cluster minikube
🚜  Pulling base image ...
🔥  Creating docker container (CPUs=2, Memory=2560MB) ...
🐳  Preparing Kubernetes v1.24.1 on Docker 20.10.17 ...
    ▪ Generating certificates and keys ...
    ▪ Booting up control plane ...
    ▪ Configuring RBAC rules ...
🔗  Configuring Calico (Container Networking Interface) ...
🔎  Verifying Kubernetes components...
    ▪ Using image gcr.io/k8s-minikube/storage-provisioner:v5
🌟  Enabled addons: storage-provisioner, default-storageclass

👍  Starting worker node minikube-m02 in cluster minikube
🚜  Pulling base image ...
🔥  Creating docker container (CPUs=2, Memory=2560MB) ...
🌐  Found network options:
    ▪ NO_PROXY=192.168.49.2
🐳  Preparing Kubernetes v1.24.1 on Docker 20.10.17 ...
    ▪ env NO_PROXY=192.168.49.2
🔎  Verifying Kubernetes components...

👍  Starting worker node minikube-m03 in cluster minikube
🚜  Pulling base image ...
🔥  Creating docker container (CPUs=2, Memory=2560MB) ...
🌐  Found network options:
    ▪ NO_PROXY=192.168.49.2,192.168.49.3
🐳  Preparing Kubernetes v1.24.1 on Docker 20.10.17 ...
    ▪ env NO_PROXY=192.168.49.2
    ▪ env NO_PROXY=192.168.49.2,192.168.49.3
🔎  Verifying Kubernetes components...
🏄  Done! kubectl is now configured to use "minikube" cluster and "default" namespace by default
  • Cek konfigurasi kubectl
kubectl config get-contexts
...<output>...
CURRENT   NAME       CLUSTER    AUTHINFO   NAMESPACE
*         minikube   minikube   minikube   default
kubectl config view
...<output>...
apiVersion: v1
clusters:
- cluster:
    certificate-authority: /home/sysops/.minikube/ca.crt
    extensions:
    - extension:
        last-update: Sat, 23 Jul 2022 16:26:10 UTC
        provider: minikube.sigs.k8s.io
        version: v1.26.0
      name: cluster_info
    server: https://192.168.49.2:8443
  name: minikube
contexts:
- context:
    cluster: minikube
    extensions:
    - extension:
        last-update: Sat, 23 Jul 2022 16:26:10 UTC
        provider: minikube.sigs.k8s.io
        version: v1.26.0
      name: context_info
    namespace: default
    user: minikube
  name: minikube
current-context: minikube
kind: Config
preferences: {}
users:
- name: minikube
  user:
    client-certificate: /home/sysops/.minikube/profiles/minikube/client.crt
    client-key: /home/sysops/.minikube/profiles/minikube/client.key
  • Cek cluster info
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'.
  • Cek profile minikube
minikube profile list
...<output>...
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| Profile  | VM Driver | Runtime |      IP      | Port | Version | Status  | Nodes | Active |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
| minikube | docker    | docker  | 192.168.49.2 | 8443 | v1.24.1 | Running |     3 | *      |
|----------|-----------|---------|--------------|------|---------|---------|-------|--------|
  • Cek status node
kubectl get nodes -o wide
...<output>...
NAME           STATUS   ROLES           AGE    VERSION   INTERNAL-IP    EXTERNAL-IP   OS-IMAGE             KERNEL-VERSION      CONTAINER-RUNTIME
minikube       Ready    control-plane   13m    v1.24.1   192.168.49.2   <none>        Ubuntu 20.04.4 LTS   5.4.0-110-generic   docker://20.10.17
minikube-m02   Ready    <none>          10m    v1.24.1   192.168.49.3   <none>        Ubuntu 20.04.4 LTS   5.4.0-110-generic   docker://20.10.17
minikube-m03   Ready    <none>          9m9s   v1.24.1   192.168.49.4   <none>        Ubuntu 20.04.4 LTS   5.4.0-110-generic   docker://20.10.17
  • Cek status service, pastikan running semua
kubectl get pods --all-namespaces
...<output>...
NAMESPACE     NAME                                     READY   STATUS    RESTARTS      AGE
kube-system   calico-kube-controllers-c44b4545-sfl47   1/1     Running   0             13m
kube-system   calico-node-7ptkj                        1/1     Running   0             10m
kube-system   calico-node-85r4t                        1/1     Running   0             11m
kube-system   calico-node-dn8p6                        1/1     Running   0             13m
kube-system   coredns-6d4b75cb6d-c5s49                 1/1     Running   0             13m
kube-system   etcd-minikube                            1/1     Running   0             14m
kube-system   kube-apiserver-minikube                  1/1     Running   0             14m
kube-system   kube-controller-manager-minikube         1/1     Running   1 (14m ago)   14m
kube-system   kube-proxy-8lf6t                         1/1     Running   0             13m
kube-system   kube-proxy-pcdgz                         1/1     Running   0             11m
kube-system   kube-proxy-zsmsr                         1/1     Running   0             10m
kube-system   kube-scheduler-minikube                  1/1     Running   0             14m
kube-system   storage-provisioner                      1/1     Running   1 (11m ago)   13m
  • Cek status minikube
minikube status
...<output>...
minikube
type: Control Plane
host: Running
kubelet: Running
apiserver: Running
kubeconfig: Configured

minikube-m02
type: Worker
host: Running
kubelet: Running

minikube-m03
type: Worker
host: Running
kubelet: Running
  • Cek addons list
minikube addons list
...<output>...
|-----------------------------|----------|--------------|--------------------------------|
|         ADDON NAME          | PROFILE  |    STATUS    |           MAINTAINER           |
|-----------------------------|----------|--------------|--------------------------------|
| ambassador                  | minikube | disabled     | 3rd party (Ambassador)         |
| auto-pause                  | minikube | disabled     | Google                         |
| csi-hostpath-driver         | minikube | disabled     | Kubernetes                     |
| dashboard                   | minikube | disabled     | Kubernetes                     |
| default-storageclass        | minikube | enabled  *   | Kubernetes                     |
| efk                         | minikube | disabled     | 3rd party (Elastic)            |
| freshpod                    | minikube | disabled     | Google                         |
| gcp-auth                    | minikube | disabled     | Google                         |
| gvisor                      | minikube | disabled     | Google                         |
| headlamp                    | minikube | disabled     | kinvolk.io                     |
| helm-tiller                 | minikube | disabled     | 3rd party (Helm)               |
| inaccel                     | minikube | disabled     | InAccel <[email protected]>     |
| ingress                     | minikube | disabled     | 3rd party (unknown)            |
| ingress-dns                 | minikube | disabled     | Google                         |
| istio                       | minikube | disabled     | 3rd party (Istio)              |
| istio-provisioner           | minikube | disabled     | 3rd party (Istio)              |
| kong                        | minikube | disabled     | 3rd party (Kong HQ)            |
| kubevirt                    | minikube | disabled     | 3rd party (KubeVirt)           |
| logviewer                   | minikube | disabled     | 3rd party (unknown)            |
| metallb                     | minikube | disabled     | 3rd party (MetalLB)            |
| metrics-server              | minikube | disabled     | Kubernetes                     |
| nvidia-driver-installer     | minikube | disabled     | Google                         |
| nvidia-gpu-device-plugin    | minikube | disabled     | 3rd party (Nvidia)             |
| olm                         | minikube | disabled     | 3rd party (Operator Framework) |
| pod-security-policy         | minikube | disabled     | 3rd party (unknown)            |
| portainer                   | minikube | disabled     | Portainer.io                   |
| registry                    | minikube | disabled     | Google                         |
| registry-aliases            | minikube | disabled     | 3rd party (unknown)            |
| registry-creds              | minikube | disabled     | 3rd party (UPMC Enterprises)   |
| storage-provisioner         | minikube | enabled  *   | Google                         |
| storage-provisioner-gluster | minikube | disabled     | 3rd party (unknown)            |
| volumesnapshots             | minikube | disabled     | Kubernetes                     |
|-----------------------------|----------|--------------|--------------------------------|
  • Enable addons ingress controller
minikube addons enable ingress
...<output>...
    ▪ Using image k8s.gcr.io/ingress-nginx/controller:v1.2.1
    ▪ Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1
    ▪ Using image k8s.gcr.io/ingress-nginx/kube-webhook-certgen:v1.1.1
🔎  Verifying ingress addon...
🌟  The 'ingress' addon is enabled
  • Cek minikube service list
minikube service list
...<output>...
|---------------|------------------------------------|--------------|---------------------------|
|   NAMESPACE   |                NAME                | TARGET PORT  |            URL            |
|---------------|------------------------------------|--------------|---------------------------|
| default       | kubernetes                         | No node port |
| ingress-nginx | ingress-nginx-controller           | http/80      | http://192.168.49.2:31619 |
|               |                                    | https/443    | http://192.168.49.2:31620 |
| ingress-nginx | ingress-nginx-controller-admission | No node port |
| kube-system   | kube-dns                           | No node port |
|---------------|------------------------------------|--------------|---------------------------|

  • Menambahkan node minikube dan menghapus node minikube
minikube node add --worker=true
...<output>...
😄  Adding node m04 to cluster minikube
👍  Starting worker node minikube-m04 in cluster minikube
🚜  Pulling base image ...
🔥  Creating docker container (CPUs=2, Memory=2560MB) ...
🐳  Preparing Kubernetes v1.24.1 on Docker 20.10.17 ...
🔎  Verifying Kubernetes components...
🏄  Successfully added m04 to minikube!

minikube node list
...<output>...
minikube        192.168.49.2
minikube-m02    192.168.49.3
minikube-m03    192.168.49.4
minikube-m04    192.168.49.5

minikube node delete minikube-m04
...<output>...
🔥  Deleting node minikube-m04 from cluster minikube
✋  Stopping node "minikube-m04"  ...
🛑  Powering off "minikube-m04" via SSH ...
🔥  Deleting "minikube-m04" in docker ...
💀  Node minikube-m04 was successfully deleted.

minikube node list
...<output>...
minikube        192.168.49.2
minikube-m02    192.168.49.3
minikube-m03    192.168.49.4

  • Menjalankan single pod pada minikube
kubectl run hello-minikube --image=gcr.io/google_containers/echoserver:1.8 --port=8080
...<output>...
pod/hello-minikube created
  • Cek status pod
kubectl get pods -o wide
...<output>...
NAME             READY   STATUS    RESTARTS   AGE   IP               NODE           NOMINATED NODE   READINESS GATES
hello-minikube   1/1     Running   0          53s   10.244.205.193   minikube-m02   <none>           <none>
  • Expose pod hello-minikube agar bisa diakses dengan node IP
kubectl expose pod hello-minikube --type=NodePort --port=8080
...<output>...
service/hello-minikube exposed
  • Cek service pod
kubectl get services -o wide
...<output>...
NAME             TYPE        CLUSTER-IP     EXTERNAL-IP   PORT(S)          AGE   SELECTOR
hello-minikube   NodePort    10.99.43.125   <none>        8080:30468/TCP   17s   run=hello-minikube
kubernetes       ClusterIP   10.96.0.1      <none>        443/TCP          48m   <none>
  • Akses pod dengan node IP dan port 30468
curl http://192.168.49.2:30468
...<output>...
Hostname: hello-minikube

Pod Information:
        -no pod information available-

Server values:
        server_version=nginx: 1.13.3 - lua: 10008

Request Information:
        client_address=10.244.120.64
        method=GET
        real path=/
        query=
        request_version=1.1
        request_uri=http://192.168.49.2:8080/

Request Headers:
        accept=*/*
        host=192.168.49.2:30468
        user-agent=curl/7.68.0

Request Body:
        -no body in request-
  • Hapus service pod
kubectl delete service hello-minikube
...<output>...
service "hello-minikube" deleted
  • Hapus pod
kubectl delete pod hello-minikube
...<output>...
pod "hello-minikube" deleted

  • Membuat deployment nginx
kubectl create deployment nginx --image=nginx
...<output>...
deployment.apps/nginx created
  • Cek status deployment nginx
kubectl get deployment -o wide
...<output>...
NAME    READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES   SELECTOR
nginx   1/1     1            1           44s   nginx        nginx    app=nginx
  • Cek status pod
kubectl get pods -o wide
...<output>...
NAME                    READY   STATUS    RESTARTS   AGE     IP               NODE           NOMINATED NODE   READINESS GATES
nginx-8f458dc5b-h9nvr   1/1     Running   0          3m24s   10.244.205.194   minikube-m02   <none>           <none>
  • Scale up/down deployment nginx
kubectl scale --replicas=4 deployment nginx
...<output>...
deployment.apps/nginx scaled
  • Cek status deployment
kubectl get deployments -o wide
...<output>...
NAME    READY   UP-TO-DATE   AVAILABLE   AGE   CONTAINERS   IMAGES   SELECTOR
nginx   4/4     4            4           4m    nginx        nginx    app=nginx
  • Cek status pod
kubectl get pods -o wide
...<output>...
NAME                    READY   STATUS    RESTARTS   AGE     IP               NODE           NOMINATED NODE   READINESS GATES
nginx-8f458dc5b-798p9   1/1     Running   0          21s     10.244.120.73    minikube       <none>           <none>
nginx-8f458dc5b-dx6sl   1/1     Running   0          21s     10.244.151.4     minikube-m03   <none>           <none>
nginx-8f458dc5b-h9nvr   1/1     Running   0          5m24s   10.244.205.194   minikube-m02   <none>           <none>
nginx-8f458dc5b-kr7hk   1/1     Running   0          21s     10.244.205.195   minikube-m02   <none>           <none>
  • Buat file dengan nama index.html dengan isi file seperti berikut lalu Copy file index.html dari host ke dalam pods nginx
### untuk pod nginx-8f458dc5b-798p9
<html>
<title>sys-ops.id - web01</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web01</h5>
</body>
</html>

kubectl cp index.html nginx-8f458dc5b-798p9:/usr/share/nginx/html/index.html

### untuk pod nginx-8f458dc5b-dx6sl
<html>
<title>sys-ops.id - web02</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web02</h5>
</body>
</html>

kubectl cp index.html nginx-8f458dc5b-dx6sl:/usr/share/nginx/html/index.html

### untuk pod nginx-8f458dc5b-h9nvr
<html>
<title>sys-ops.id - web03</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web03</h5>
</body>
</html>

kubectl cp index.html nginx-8f458dc5b-h9nvr:/usr/share/nginx/html/index.html

### untuk pod nginx-8f458dc5b-kr7hk
<html>
<title>sys-ops.id - web04</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web04</h5>
</body>
</html>

kubectl cp index.html nginx-8f458dc5b-kr7hk:/usr/share/nginx/html/index.html
  • Expose deployment nginx agar dapat diakses dengan node IP
kubectl expose deployment nginx --type=NodePort --port=80
...<output>...
service/nginx exposed
  • Cek service deployment
kubectl get services -o wide
...<output>...
NAME         TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)        AGE   SELECTOR
kubernetes   ClusterIP   10.96.0.1       <none>        443/TCP        86m   <none>
nginx        NodePort    10.104.177.19   <none>        80:30252/TCP   40s   app=nginx
  • Cek URL deployment nginx
minikube service nginx
...<output>...
|-----------|-------|-------------|---------------------------|
| NAMESPACE | NAME  | TARGET PORT |            URL            |
|-----------|-------|-------------|---------------------------|
| default   | nginx |          80 | http://192.168.49.2:30252 |
|-----------|-------|-------------|---------------------------|
🎉  Opening service default/nginx in default browser...
👉  http://192.168.49.2:30252
  • Akses pods nginx dengan curl
curl http://192.168.49.2:30252
...<output>...
<html>
<title>sys-ops.id - web02</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web02</h5>
</body>
</html>

curl http://192.168.49.2:30252
...<output>...
<html>
<title>sys-ops.id - web04</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web04</h5>
</body>
</html>

curl http://192.168.49.2:30252
...<output>...
<html>
<title>sys-ops.id - web03</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web03</h5>
</body>
</html>

curl http://192.168.49.2:30252
...<output>...
<html>
<title>sys-ops.id - web01</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web01</h5>
</body>
</html>
  • Aktifkan port-forward agar pods nginx bisa di akses dengan host IP
kubectl port-forward --address 0.0.0.0 service/nginx 8080:80
...<output>...
Forwarding from 0.0.0.0:8080 -> 80
Handling connection for 8080
Handling connection for 8080
  • Akses dengan localhost dan host IP
curl http://localhost:8080
...<output>...
<html>
<title>sys-ops.id</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web03</h5>
</body>
</html>

curl http://103.169.7.39:8080/
...<output>...
<html>
<title>sys-ops.id</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on Ubuntu</h3>
<h5>Nginx - web02</h5>
</body>
</html>

  • Akses kubernetes dashboard
  • Jalankan proxy dengan port 9090 di background
kubectl proxy --address='0.0.0.0' --port=9090 --disable-filter=true &
  • Aktifkan minikube dashboard dengan port 9000
minikube dashboard --port=9000
...<output>...
🔌  Enabling dashboard ...
    ▪ Using image kubernetesui/dashboard:v2.6.0
    ▪ Using image kubernetesui/metrics-scraper:v1.0.8
🤔  Verifying dashboard health ...
🚀  Launching proxy ...
🤔  Verifying proxy health ...
🎉  Opening http://127.0.0.1:9000/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/ in your default browser...
👉  http://127.0.0.1:9000/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/
  • Akses dashboard kubernetes dengan url (gunakan port proxy 9090):
  • http://ip_host_server:9090/api/v1/namespaces/kubernetes-dashboard/services/http:kubernetes-dashboard:/proxy/

  • Cek status node minikube lewat docker
docker ps -a
...<output>...
CONTAINER ID   IMAGE                                 COMMAND                  CREATED       STATUS       PORTS                                                                                                                                  NAMES
b27de0708dba   gcr.io/k8s-minikube/kicbase:v0.0.32   "/usr/local/bin/entr…"   1 hours ago   Up 1 hours   127.0.0.1:49212->22/tcp, 127.0.0.1:49211->2376/tcp, 127.0.0.1:49210->5000/tcp, 127.0.0.1:49209->8443/tcp, 127.0.0.1:49208->32443/tcp   minikube-m03
58aea783598d   gcr.io/k8s-minikube/kicbase:v0.0.32   "/usr/local/bin/entr…"   1 hours ago   Up 1 hours   127.0.0.1:49207->22/tcp, 127.0.0.1:49206->2376/tcp, 127.0.0.1:49205->5000/tcp, 127.0.0.1:49204->8443/tcp, 127.0.0.1:49203->32443/tcp   minikube-m02
3b9f6c124a55   gcr.io/k8s-minikube/kicbase:v0.0.32   "/usr/local/bin/entr…"   1 hours ago   Up 1 hours   127.0.0.1:49202->22/tcp, 127.0.0.1:49201->2376/tcp, 127.0.0.1:49200->5000/tcp, 127.0.0.1:49199->8443/tcp, 127.0.0.1:49198->32443/tcp   minikube
  • Cek images pada minikube
minikube image ls
...<output>...
k8s.gcr.io/pause:3.7
k8s.gcr.io/pause:3.6
k8s.gcr.io/kube-scheduler:v1.24.1
k8s.gcr.io/kube-proxy:v1.24.1
k8s.gcr.io/kube-controller-manager:v1.24.1
k8s.gcr.io/kube-apiserver:v1.24.1
k8s.gcr.io/ingress-nginx/kube-webhook-certgen:<none>
k8s.gcr.io/ingress-nginx/controller:<none>
k8s.gcr.io/etcd:3.5.3-0
k8s.gcr.io/coredns/coredns:v1.8.6
gcr.io/k8s-minikube/storage-provisioner:v5
gcr.io/google_containers/echoserver:1.8
gcr.io/google_containers/echoserver:1.5
docker.io/library/nginx:latest
docker.io/kubernetesui/metrics-scraper:<none>
docker.io/kubernetesui/dashboard:<none>
docker.io/calico/pod2daemon-flexvol:v3.20.0
docker.io/calico/node:v3.20.0
docker.io/calico/kube-controllers:v3.20.0
docker.io/calico/cni:v3.20.0
  • SSH ke dalam minikube
minikube ssh
...<output>...
docker@minikube:~$ hostnamectl
   Static hostname: minikube
         Icon name: computer-container
           Chassis: container
        Machine ID: d8902d1345bb469697278da23257a8d2
           Boot ID: 400ca9e390004d018b3adbe5e56d63ba
    Virtualization: docker
  Operating System: Ubuntu 20.04.4 LTS
            Kernel: Linux 5.4.0-110-generic
      Architecture: x86-64
  • Hapus service nginx
kubectl delete service nginx
...<output>...
service "nginx" deleted
  • Hapus deployment nginx
kubectl delete deployment nginx
...<output>...
deployment.apps "nginx" deleted
  • Stop minikube cluster
minikube stop
...<output>...
✋  Stopping node "minikube"  ...
🛑  Powering off "minikube" via SSH ...
✋  Stopping node "minikube-m02"  ...
🛑  Powering off "minikube-m02" via SSH ...
✋  Stopping node "minikube-m03"  ...
🛑  Powering off "minikube-m03" via SSH ...
🛑  3 nodes stopped.
  • Delete minikube cluster
minikube delete
...<output>...
🔥  Deleting "minikube" in docker ...
🔥  Deleting container "minikube" ...
🔥  Deleting container "minikube-m02" ...
🔥  Deleting container "minikube-m03" ...
🔥  Removing /home/sysops/.minikube/machines/minikube ...
🔥  Removing /home/sysops/.minikube/machines/minikube-m02 ...
🔥  Removing /home/sysops/.minikube/machines/minikube-m03 ...
💀  Removed all traces of the "minikube" cluster.

herdiana3389

A system administrator with skills in system administration, virtualization, linux, windows, networking, cloud computing, container, etc.