This is the second day of my participation in the August More text Challenge. For details, see: August More Text Challenge

A background

In addition to Minikube /kind, there are many other excellent K8s environment deployment tools. MicroK8s is the smallest and fastest Kubernetes compatible cluster system, mainly used for workstations and small teams. However, the image is not currently packaged with Snap and is still available on gCR. IO, so there are still problems with domestic downloads. MicroK8s is ideal for off-line development, prototyping, and testing, especially for running VM as a small, inexpensive, reliable K8S for CI/CD. It supports ARM architecture and is also suitable for developing IoT applications on small Linux devices through MicroK8s deployment.

Two MicroK8s characteristics

  • MicroK8 Lightweight: Team members wanted minimal Kubernetes for laptop and workstation development. MicroK8s offers lightweight standalone Kubernetes that are compatible with Azure AKS, Amazon EKS, and Google GKE when running on Ubuntu.
  • MicroK8 is simple: MicroK8s minimises management and operation by being installed in a single package that has no moving parts (out of the box) and includes all dependencies.
  • MicroK8 is secure: Updates are always available for all security issues and can be applied immediately or scheduled to suit the enterprise’s maintenance cycle. In addition, MicroK8 has the latest isolation features that make it safe to run on your workstation. This isolation is achieved by packaging all the binaries of Kubernetes, docker. IO, iptables, and CNI into a single SNAP package.
  • MicroK8 is up to date: MicroK8s tracks upstream Kubernetes and releases beta, release candidate and final on the same day upstream Kubernetes is released. You can keep track of the latest Kubernetes or stick with any version of Kubernetes from 1.10 onwards. When a new major Kubernetes version comes along, you can upgrade it automatically or with a single command.
  • MicroK8 is comprehensive: MicroK8s includes selected listings for common Kubernetes features and services. MicroK8 comes with a Docker registry that allows users to create, push, and deploy containers on their laptops.

Iii Installation and Deployment

3.1 Operating Environment

  • Operating system Ubuntu 18.04 LTS or 16.04 LTS environment (or other supportsnapdOperating system – See thesnapd documentation).
  • At least 20 GB of disk space and (recommended) 4 GB of memory.
$ snap install microk8s --classic
2021-08-06T16:56:05+08:00 INFO Waiting for automatic snapd restart...
microk8s (1.21/stable) v1.21.3 from Canonical✓ installed
Copy the code

4 use

$ microk8s kubectl get nodesNAME STATUS ROLES AGE VERSION Vm-0-17 - Ubuntu NotReady < None > 2m7s v1.21.3-3+ 90FD5F3D2AEA0a$ microk8s kubectl get servicesNAME TYPE cluster-ip external-ip PORT(S) AGE kubernetes ClusterIP 10.152.183.1 < None > 443/TCP 2m27s
#Checking service Status
$ microk8s status --wait-ready

#Enabling related Components
$ microk8s enable dashboard dns registry istio

#Check the k8s
$ microk8s kubectl get all --all-namespaces

#Access to the dashboard
$ microk8s dashboard-proxy

#Use with kubectl management
$ sudo microk8s kubectl config view --raw > $HOME/.kube/config

#Check the plugin
$ microk8s.status
Copy the code

Use the host kubectl to manage the cluster

$Curl - LO, https://storage.googleapis.com/kubernetes-release/release/v1.18.0/bin/linux/amd64/kubectl && \ chmod + x ./kubectl &&\ $ mv ./kubectl /usr/bin/kubectl

$ microk8s kubectl config view --raw > $HOME/.kube/config
$ kubectl get po -A
NAMESPACE     NAME                                      READY   STATUS     RESTARTS   AGE
kube-system   calico-kube-controllers-f7868dd95-s4c5m   0/1     Pending    0          5m33s
kube-system   calico-node-8mxlc                         0/1     Init:0/3   0          5m27s
Copy the code

Five other

Unlike Minikube, MicroK8s can be used by IT administrators or developers to create multi-node clusters. If MicroK8s is running on Linux, you don’t even need a VM. On Windows and macOS, MicroK8s uses a VM framework called Multipass to create VMS for the Kubernetes cluster.

Refer to the link

  • Github.com/ubuntu/micr…

  • microk8s.io/