Install Kubernetes Cluster with Minikube on CentOS

Install Kubernetes Cluster dengan Minikube pada CentOS 7

Install Kubernetes Cluster with Kubeadm on CentOS

Install Kubernetes Cluster with Kubeadm on Ubuntu

  • Minimum requirement: 2 CPU & 4GB RAM
  • Update repository index centos
yum update -y && yum install epel-release -y && yum install nano wget net-tools -y
  • Disable firewalld
systemctl disable --now firewalld
  • Install docker runtime
yum install -y yum-utils device-mapper-persistent-data lvm2 epel-release vim git curl wget net-tools
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
yum install -y docker-ce docker-ce-cli containerd.io
  • Enable service docker
systemctl enable --now docker
systemctl status docker
  • Tambahakan user: sysops untuk menjalankan minikube
adduser sysops && passwd sysops
usermod -aG wheel sysops
usermod -aG docker sysops

  • 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
  • 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/

  • Masuk sebagai user sysops
su - sysops
  • Cek versi minikube
minikube version
...<output>...
minikube version: v1.26.0
commit: f4b412861bb746be73053c9f6d2895f12cf78565
  • 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?

  • 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 Centos 7.9.2009 (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 ...
💾  Downloading Kubernetes v1.24.1 preload ...
    > preloaded-images-k8s-v18-v1...: 405.83 MiB / 405.83 MiB  100.00% 12.90 Mi
    > gcr.io/k8s-minikube/kicbase: 386.00 MiB / 386.00 MiB  100.00% 6.65 MiB p/
    > gcr.io/k8s-minikube/kicbase: 0 B [_________________________] ?% ? p/s 33s
🔥  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: default-storageclass, storage-provisioner

👍  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: Tue, 26 Jul 2022 17:45:14 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: Tue, 26 Jul 2022 17:45:14 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   14m     v1.24.1   192.168.49.2   <none>        Ubuntu 20.04.4 LTS   3.10.0-957.27.2.el7.x86_64   docker://20.10.17
minikube-m02   Ready    <none>          10m     v1.24.1   192.168.49.3   <none>        Ubuntu 20.04.4 LTS   3.10.0-957.27.2.el7.x86_64   docker://20.10.17
minikube-m03   Ready    <none>          7m37s   v1.24.1   192.168.49.4   <none>        Ubuntu 20.04.4 LTS   3.10.0-957.27.2.el7.x86_64   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-ccnz6   1/1     Running   0               14m
kube-system   calico-node-2v8d8                        1/1     Running   0               11m
kube-system   calico-node-w8nkn                        1/1     Running   0               14m
kube-system   calico-node-zpvvk                        1/1     Running   0               8m37s
kube-system   coredns-6d4b75cb6d-qdhms                 1/1     Running   0               14m
kube-system   etcd-minikube                            1/1     Running   0               15m
kube-system   kube-apiserver-minikube                  1/1     Running   0               15m
kube-system   kube-controller-manager-minikube         1/1     Running   1 (15m ago)     15m
kube-system   kube-proxy-h72cs                         1/1     Running   0               8m37s
kube-system   kube-proxy-h7hfp                         1/1     Running   0               11m
kube-system   kube-proxy-r6fnl                         1/1     Running   0               14m
kube-system   kube-scheduler-minikube                  1/1     Running   0               15m
kube-system   storage-provisioner                      1/1     Running   4 (8m19s ago)   14m
  • 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:31882 |
|               |                                    | https/443    | http://192.168.49.2:31551 |
| 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          39s   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.105.249.207   <none>        8080:32503/TCP   46s   run=hello-minikube
kubernetes       ClusterIP   10.96.0.1        <none>        443/TCP          27m   <none>
  • Akses pod dengan node IP dan port 32503
curl http://192.168.49.2:32503
...<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:32503
        user-agent=curl/7.29.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           21s   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-8g6k4   1/1     Running   0          54s   10.244.151.1   minikube-m03   <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           2m42s   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-8g6k4   1/1     Running   0          10m     10.244.151.1     minikube-m03   <none>           <none>
nginx-8f458dc5b-lcwzm   1/1     Running   0          8m47s   10.244.151.2     minikube-m03   <none>           <none>
nginx-8f458dc5b-pgkjt   1/1     Running   0          2m35s   10.244.120.74    minikube       <none>           <none>
nginx-8f458dc5b-vh9j2   1/1     Running   0          8m47s   10.244.205.194   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-8g6k4
<html>
<title>sys-ops.id - web01</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on CentOS</h3>
<h5>Nginx - web01</h5>
</body>
</html>

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

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

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

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

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

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

kubectl cp index.html nginx-8f458dc5b-vh9j2:/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        45m   <none>
nginx        NodePort    10.105.64.198   <none>        80:30081/TCP   88s   app=nginx
  • Cek URL deployment nginx
minikube service nginx
...<output>...
|-----------|-------|-------------|---------------------------|
| NAMESPACE | NAME  | TARGET PORT |            URL            |
|-----------|-------|-------------|---------------------------|
| default   | nginx |          80 | http://192.168.49.2:30081 |
|-----------|-------|-------------|---------------------------|
🎉  Opening service default/nginx in default browser...
👉  http://192.168.49.2:30081
  • Akses pods nginx dengan curl
curl http://192.168.49.2:30081
...<output>...
<html>
<title>sys-ops.id - web03</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on CentOS</h3>
<h5>Nginx - web03</h5>
</body>
</html>

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

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

curl http://192.168.49.2:30081
...<output>...
<html>
<title>sys-ops.id - web02</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on UbCentOSuntu</h3>
<h5>Nginx - web02</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 - web01</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on CentOS</h3>
<h5>Nginx - web01</h5>
</body>
</html>

curl http://103.157.27.171:8080
...<output>...
<html>
<title>sys-ops.id - web01</title>
<body>
<h1>sys-ops.id</h1>
<h3>Install Kubernetes Cluster with Minikube on CentOS</h3>
<h5>Nginx - web01</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
1840ac68be00   gcr.io/k8s-minikube/kicbase:v0.0.32   "/usr/local/bin/entr…"   51 minutes ago   Up 51 minutes   127.0.0.1:49167->22/tcp, 127.0.0.1:49166->2376/tcp, 127.0.0.1:49165->5000/tcp, 127.0.0.1:49164->8443/tcp, 127.0.0.1:49163->32443/tcp   minikube-m03
96a1789a4eb8   gcr.io/k8s-minikube/kicbase:v0.0.32   "/usr/local/bin/entr…"   54 minutes ago   Up 54 minutes   127.0.0.1:49162->22/tcp, 127.0.0.1:49161->2376/tcp, 127.0.0.1:49160->5000/tcp, 127.0.0.1:49159->8443/tcp, 127.0.0.1:49158->32443/tcp   minikube-m02
2a9a86789fd4   gcr.io/k8s-minikube/kicbase:v0.0.32   "/usr/local/bin/entr…"   58 minutes ago   Up 58 minutes   127.0.0.1:49157->22/tcp, 127.0.0.1:49156->2376/tcp, 127.0.0.1:49155->5000/tcp, 127.0.0.1:49154->8443/tcp, 127.0.0.1:49153->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
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: 60d00815779d4110a3690b37718c726c
    Virtualization: docker
  Operating System: Ubuntu 20.04.4 LTS
            Kernel: Linux 3.10.0-957.27.2.el7.x86_64
      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.