![Image Blog How to Get Up and Running with Kubernetes Image Blog How to Get Up and Running with Kubernetes](/sites/default/files/image/2019-07/image-blog-how-to-get-up-and-running-with-kubernetes-using-microk8s.jpg)
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 topMicroK8s 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 topKubernetes 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
![Get and Update the EPEL Get and Update the EPEL](/sites/default/files/image/2019-07/kubernetes_microk8_1.png)
b. Install and Update snap core:
sudo yum install snapd
![Install and update snap core Install and update snap core](/sites/default/files/image/2019-07/kubernetes_microk8_2.png)
sudo systemctl enable --now snapd.socket
![sudo systemctl enable --now snapd.socket sudo systemctl enable --now snapd.socket](/sites/default/files/image/2019-07/kubernetes_microk8_3.png)
sudo ln -s /var/lib/snapd/snap /snap
![sudo ln -s /var/lib/snapd/snap /snap sudo ln -s /var/lib/snapd/snap /snap](/sites/default/files/image/2019-07/kubernetes_microk8_4.png)
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
![sudo snap install microk8s --classic sudo snap install microk8s --classic](/sites/default/files/image/2019-07/kubernetes_microk8_5.png)
a. Check Status of the Freshly Installed MicroK8s Implementation
![Micro k Micro k](/sites/default/files/image/2019-07/kubernetes_microk8_6.png)
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.
![create an alias for kubectl, docker create an alias for kubectl, docker](/sites/default/files/image/2019-07/kubernetes_microk8_7.png)
![create an alias for kubectl, docker create an alias for kubectl, docker](/sites/default/files/image/2019-07/kubernetes_microk8_8.png)
On the command span info MicroK8s we are able to see that in the snap channel, the latest version of Kubernetes has been updated.
![command span info MicroK8s command span info MicroK8s](/sites/default/files/image/2019-07/kubernetes_microk8_9.png)
![command span info MicroK8s command span info MicroK8s](/sites/default/files/image/2019-07/kubernetes_microk8_10.png)
b. Ensure iptables Are Set to Forward
![Ensure iptables are set to forward. Ensure iptables are set to forward.](/sites/default/files/image/2019-07/kubernetes_microk8_11.png)
c. Enable the DNS and the Dashboard
![Enable the DNS and the dashboard. Enable the DNS and the dashboard.](/sites/default/files/image/2019-07/kubernetes_microk8_12.png)
d. Verify the Version
![Verify the version. Verify the version.](/sites/default/files/image/2019-07/kubernetes_microk8_13.png)
e. Check the Progress of the Cluster on All Namespaces:
microk8s.kubectl get all --all-namespaces
![Check the progress of the cluster on all namespaces Check the progress of the cluster on all namespaces](/sites/default/files/image/2019-07/kubernetes_microk8_14.png)
f. Check the Cluster With cluster-info
![Check the cluster with cluster-info Check the cluster with cluster-info](/sites/default/files/image/2019-07/kubernetes_microk8_15.png)
g. View the Configuration of the New Cluster
![View the configuration of the new cluster View the configuration of the new cluster](/sites/default/files/image/2019-07/kubernetes_microk8_16.png)
As Kubernetes is primarily a cluster management framework, get the list of clusters and verify the cluster name within the specific context.
![Kubernetes is primarily a cluster management framework Kubernetes is primarily a cluster management framework](/sites/default/files/image/2019-07/kubernetes_microk8_16a.png)
It uses the following API versions:
![It uses the following API versions: It uses the following API versions:](/sites/default/files/image/2019-07/kubernetes_microk8_17.png)
Finally, feel free to play around with Kubernetes and MicroK8s. It’s allowed, really!
![Finally – feel free to muck around. It’s allowed, really! Finally – feel free to muck around. It’s allowed, really!](/sites/default/files/image/2019-07/kubernetes_microk8_18.png)
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:
[root@localhost ~]# microk8s.reset
Calling clean_cluster
Cleaning resources in namespace default
endpoints "kubernetes" deleted
secret "default-token-s65lp" deleted
serviceaccount "default" deleted
service "kubernetes" deleted
Cleaning resources in namespace kube-public
Cleaning resources in namespace kube-system
configmap "eventer-config" deleted
service "kubernetes-dashboard" deleted
service "monitoring-grafana" deleted
service "monitoring-influxdb" deleted
deployment.apps "heapster-v1.5.2" deleted
deployment.apps "kube-dns" deleted
deployment.apps "kubernetes-dashboard" deleted
deployment.apps "monitoring-influxdb-grafana-v4" deleted
replicaset.apps "heapster-v1.5.2-6bc7c4965d" deleted
replicaset.apps "kube-dns-6ccd496668" deleted
replicaset.apps "kubernetes-dashboard-654cfb4879" deleted
replicaset.apps "monitoring-influxdb-grafana-v4-6679c46745" deleted
event.events.k8s.io "heapster-v1.5.2-6bc7c4965d-786hb.158a1215c9dbc66a" deleted
event.events.k8s.io "monitoring-influxdb-grafana-v4-6679c46745.158a1215cc8b290c" deleted
configmap "extension-apiserver-authentication" deleted
configmap "heapster-config" deleted
endpoints "monitoring-influxdb" deleted
event "monitoring-influxdb-grafana-v4-6679c46745-7zdfl.158975c8f47bb8c6" deleted
pod "monitoring-influxdb-grafana-v4-6679c46745-7zdfl" deleted
secret "default-token-w4gxg" deleted
serviceaccount "kubernetes-dashboard" deleted
service "monitoring-influxdb" deleted
deployment.apps "monitoring-influxdb-grafana-v4" deleted
replicaset.apps "monitoring-influxdb-grafana-v4-6679c46745" deleted
event.events.k8s.io "monitoring-influxdb-grafana-v4-6679c46745.158a1215cc8b290c" deleted
Waiting for kubernetes resources to be released
[root@localhost ~]#
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 topGet 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.
Related Content
- 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