AWS Deploy Single Node Kubernetes Cluster
Zahid Ahmed
Posted on September 20, 2023
Instead of a full-blown Kubernetes cluster, the single node instances are best for both development and testing. Let's go with lightweight Kubernetes managed by Canonical, Microk8s.
MicroK8s is the easiest and fastest way to get Kubernetes up and running. Experiment with the latest upstream features and toggle services on and off. Seamlessly move your work from dev to production. 😎✌🏻
Install MicroK8s on Ubuntu Server
Install MicroK8s:
$ sudo snap install microk8s --classic
Check Status:
$ microk8s status --wait-ready
Add Your Current User To MicroK8s Group:
$ sudo usermod -a -G microk8s $USER
$ sudo mkdir ~/.kube && sudo chown -R $USER ~/.kube
$ sudo newgrp microk8s
Enable Services That You Will Need:
$ microk8s enable dns
$ microk8s enable dashboard
$ microk8s enable storage
$ microk8s enable ingress
$ microk8s enable gpu
$ microk8s enable istio
$ microk8s enable registry
To Disable Any Of These Services Later:
$ microk8s disable dns
Check the Status Of Kubernetes Services:
$ microk8s kubectl get all --all-namespaces
To login web-based dashboard generate a token with the following commands, and then paste it into login prompt:
$ token=$(microk8s kubectl -n kube-system get secret | grep default-token | cut -d " " -f1)
$ microk8s kubectl -n kube-system describe secret $token
Get Rid Of Microk8s & Use Kubectl:
$ alias kubectl="microk8s kubectl"
Lookup Pod & Node Details:
$ kubectl get nodes
$ kubectl get pods -o wide
Start & Stop MicroK8s Service:
$ microk8s start
$ microk8s stop
Uninstall MicroK8s
$ sudo snap remove microk8s
Posted on September 20, 2023
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
November 19, 2024
October 31, 2024