snapd
is install (for snapcraft.)Install softwares, Docker and microk8s.
sudo snap install docker
sudo snap install microk8s --classic --channel=1.18/stable
Granting permission
sudo usermod -a -G microk8s $USER
sudo chown -f -R $USER ~/.kube
After re-login, check the k8s status.
microk8s status --wait-ready
Set useful alias at ~/.bashrc
.
alias kubectl='microk8s kubectl'
microk8s enable dns storage registry ingress istio dashboard
(at istio TLS sidecar NO)
localhost:32000
.”Refer to the official document.
Access to the cluster (SSL portforwarded in my caes, like ssh -L 50443:localhost:16443 atlex@remote-k8s-host.com
. The localhost
here means remote.com
).
You can see credentials for BasicAuth with kubectl config view
.
atlex@remote:~$ kubectl cluster-info
Kubernetes master is running at https://127.0.0.1:16443
CoreDNS is running at https://127.0.0.1:16443/api/v1/namespaces/kube-system/services/kube-dns:dns/proxy
...
Remark: The TLS certificate is self signed.
Check the default objects.
kubectl get nodes
kubectl get pods
kubectl get services
kubectl get deplotment
kubectl get all
Note: Default objects.
$ kubectl get all --all-namespaces
NAMESPACE NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
default service/kubernetes ClusterIP 10.152.183.1 <none> 443/TCP 50m
microk8s stop
Completely reset from initial microk8s state. All related data will be discareded.
microk8s reset --destroy-storage
Some Pods can’t be deleted automatically, so I deleted them manually.
kubectl get all --all-namespaces
kubectl delete pod/heapster-v1.5.2-58fdbb6f4d-tktq7 --grace-period=0 --force -n -system
microk8s status
sudo snap remove microk8s
for dashboard.