How to Get Up and Running With Kubernetes Using MicroK8s
MicroK8s offers a new way to install Kubernetes. In this blog, we provide detailed instructions for installing Kubernetes with MicroK8s.
What Is MicroK8s?
Back to top
MicroK8s is a single package of k8s (Kubernetes) for Linux. The MicroK8s snap for Kubernetes was created by Google and Canonical in 2018.
Why Is Kubernetes Called K8s?
Back to top
Kubernetes is called K8s, because the numeral "8" replaces the last eight letters in Kubernetes.
How to Install Kubernetes With MicroK8s
Here's how to install Kubernetes using MicroK8s.
Note: Securing your cluster properly is very important. At Tesla, an unsecured administrative console for Kubernetes caused one if its cloud accounts to be compromised. In addition, unsuspecting folks had their microk8s cluster compromised, then used to mine bitcoin.
1. Get MicroK8s
Since this post is about a quick MicroK8s installation, I include some of the snap MicroK8s features prior to the imperative operation commands using the kubectl cli command set.
a. Get and Update the EPEL:
sudo yum install epel-release
b. Install and Update snap core:
sudo yum install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap
2. Use MicroK8s to Install Kubernetes
Now, that the prerequisites are done, we leverage MicroK8s to make Kubernetes installation a snap!
sudo snap install microk8s --classic
a. Check Status of the Freshly Installed MicroK8s Implementation
You can create an alias for kubectl, docker if typing 9 extra characters is undesirable. I chose to leave it as is, as the images below can attest.
On the command span info MicroK8s we are able to see that in the snap channel, the latest version of Kubernetes has been updated.
b. Ensure iptables Are Set to Forward
c. Enable the DNS and the Dashboard
d. Verify the Version
e. Check the Progress of the Cluster on All Namespaces:
microk8s.kubectl get all --all-namespaces
f. Check the Cluster With cluster-info
g. View the Configuration of the New Cluster
As Kubernetes is primarily a cluster management framework, get the list of clusters and verify the cluster name within the specific context.
It uses the following API versions:
Finally, feel free to play around with Kubernetes and MicroK8s. It’s allowed, really!
Don’t worry if the cluster becomes unhealthy. You can reset the cluster using:
microk8s.reset The following was edited to represent the reset steps:
Back to top
More on Kubernetes and MicroK8s
Now that I’ve shown you how to get up and running with Kubernetes, let me tell you about the real fun: making an already unhealthy cluster healthy. On the Ubuntu blog, there's an interesting post on setting up Kubernetes a Raspberry Pi with MicroK8s. Also, I found a post that lists projects using MicroK8s.Back to top
Get Help With MicroK8s and Kubernetes
This blog provided tips to help you install Kubernetes with MicroK8s faster. But the fastest way to get up and running with Kubernetes — and revolutionize your business — is to enlist the help of experts.
OpenLogic experts are skilled in Kubernetes. We can help you:
- Migrate to Kubernetes.
- Deploy a fully automated Kubernetes Production Cluster on any substrate of your choice with our Kubernetes Foundations Service.
- Get ongoing enterprise support for Kubernetes.
Talk to one of our Kubernetes experts today to learn how we can help you.
- Blog - Top 3 Reasons to Choose Kubernetes For Microservices
- Blog - How to Move a Monolithic Application to Kubernetes With Microservices
- Blog - Granting User Access to Your Kubernetes Cluster
- Blog - What Is Kubernetes?
- Resource - The Complete Guide to Enterprise Cloud