Friday, April 5, 2024
Kubernetes Linux Mint microk8s

Cara Install MicroK8s Kubernetes Cluster pada Linux Mint 20

microk8s

“Cara Install MicroK8s Kubernetes Cluster pada Linux Mint 20”

Pengantar

MicroK8s adalah distribusi Kubernetes siap produksi yang andal, ringan, dan andal. Ini adalah kubernetes multi-node terkecil dan tercepat dan bekerja di Linux, Windows dan MacOS. MickroK8s dapat dengan mudah diinstal dengan satu perintah dan menghilangkan kerumitan yang terkait dengan penyiapan Kubernetes. MicroK8s sangat bagus untuk pengembangan offline, pembuatan prototipe, dan pengujian.

Cara Install MicroK8s Kubernetes Cluster pada Linux Mint 20

  • Install MicroK8s
sudo snap install microk8s --classic
  • Tambahkan User ke dalam grup microk8s
sudo usermod -a -G microk8s $USER 
sudo chown -f -R $USER ~/.kube
sudo reboot
  • Running Service
$ microk8s start
$ microk8s status
  • Enable/disable
$ sudo snap enable microk8s
microk8s enabled

$ sudo snap disable microk8s
microk8s disabled
  • Command microK8s
$ microk8s kubectl get nodes
$ microk8s kubectl get services
$ microk8s kubectl get all
  • Cara Menambahkan Node
$ microk8s add-node
From the node you wish to join to this cluster, run the following: 
microk8s join <server-ip>:25000/4788df710f77d3fc8d8c3a1e2386132a 

If the node you are adding is not reachable through the default interface you can use one of the following: 
microk8s join <server-ip>:25000/4788df710f77d3fc8d8c3a1e2386132a 
microk8s join 172.17.0.1:25000/4788df710f77d3fc8d8c3a1e2386132a 
microk8s join 10.1.39.64:25000/4788df710f77d3fc8d8c3a1e2386132a
$ microk8s kubectl get no 
NAME        STATUS   ROLES    AGE     VERSION 
linux       Ready    <none>   3h32m   v1.19.0-34+1a52fbf0753680 
app2        Ready    <none>   86s     v1.19.0-34+1a52fbf0753680
$ microk8s leave
$ microk8s remove-node <node-ip/node.name>
$ microk8s.kubectl run nginx --replicas 2 --image nginx
$ microk8s kubectl get pods
NAME    READY   STATUS    RESTARTS   AGE 
nginx   1/1     Running   0          4m57s
  • Mengaktifkan Dashboard
$ microk8s.enable dashboard dns
$ microk8s.enable storage
$ microk8s.enable prometheus
$ microk8s kubectl port-forward -n monitoring service/prometheus-k8s --address 0.0.0.0 9090:9090
$ microk8s kubectl port-forward -n monitoring service/grafana --address 0.0.0.0 3000:3000
$ sudo firewall-cmd --add-port={9090/tcp,3000/tcp} --permanent
$ sudo firewall-cmd --reload
http://<your-server-ip>:9090 
  • Aktifkan registry
$ microk8s.enable registry
service/registry created 
configmap/local-registry-hosting configured 
The registry is enabled
  • Command tambahan
$ microk8s.kubectl get all --all-namespaces
$ microk8s.kubectl cluster-info
$ kubectl get services -n kube-system   
$ microk8s.config

Penutup

Sahabat Blog Learning & Doing demikianlah penjelasan mengenai Cara Install MicroK8s Kubernetes Cluster pada Linux Mint 20. Semoga Bermanfaat . Sampai ketemu lagi di postingan berikut nya.

(Visited 50 times, 1 visits today)

Similar Posts