Microk8s: setup awal: Difference between revisions
Appearance
Created page with "= Setup microk8s = Install di semua server atau node <syntaxhighlight lang=bash> sudo snap install microk8s --classic sudo usermod -a -G microk8s $USER mkdir -p ~/.kube chmod 0700 ~/.kube echo "alias kubectl='microk8s kubectl'" >> .bashrc </syntaxhighlight> Tambah node, jalankan command dengan flag <code>--worker</code> di node lain <syntaxhighlight lang=bash> microk8s add-node # Output From the node you wish to join to this cluster, run the following: microk8s join 19..." |
No edit summary |
||
| (One intermediate revision by the same user not shown) | |||
| Line 1: | Line 1: | ||
Install di semua server atau node | Install di semua server atau node | ||
<syntaxhighlight lang=bash> | <syntaxhighlight lang=bash> | ||
Latest revision as of 08:14, 26 May 2025
Install di semua server atau node
sudo snap install microk8s --classic
sudo usermod -a -G microk8s $USER
mkdir -p ~/.kube
chmod 0700 ~/.kube
echo "alias kubectl='microk8s kubectl'" >> .bashrc
Tambah node, jalankan command dengan flag --worker di node lain
microk8s add-node
# Output
From the node you wish to join to this cluster, run the following:
microk8s join 192.168.1.120:25000/45d9f42aed4574d7324deea887f8f3cd/c12b4518f7c7
Use the '--worker' flag to join a node as a worker not running the control plane, eg:
microk8s join 192.168.1.120:25000/45d9f42aed4574d7324deea887f8f3cd/c12b4518f7c7 --worker
If the node you are adding is not reachable through the default interface you can use one of the following:
microk8s join 192.168.1.120:25000/45d9f42aed4574d7324deea887f8f3cd/c12b4518f7c7
microk8s join 172.17.0.1:25000/45d9f42aed4574d7324deea887f8f3cd/c12b4518f7c7
Cek
kubectl get nodes
kubectl get services
Testing run nginx
kubectl create deployment nginx --image=nginx
kubectl get pods