k3s

Official website: www.rancher.cn/k3s/

K3s is a CNCF conformance certified Kubernetes distribution designed for the Internet of Things and edge computing.

K3s requires only kernel and cgroup mounting. The dependencies required by the K3s package include:

  1. containerd
  2. Flannel
  3. CoreDNS
  4. CNI
  5. Host utilities (iptables, socat, etc.)
  6. Ingress Controller (Traefik)
  7. Embedded Service Load Balancer
  8. Embedded Network Policy Controller

Why call k3s

Quote from the official website

We want the Kubernetes installed to be half the size in terms of memory footprint. Kubernetes is a 10-letter word, abbreviated K8s. So, something half the size of Kubernetes is a five-letter word, abbreviated K3s. K3s has no full name and no official pronunciation.

A single point of installation

# One-click install
curl -sLS https://get.k3sup.dev | sh -
Copy the code

After the preceding command is executed, an All In One K3S single-node environment is deployed. Compared with k8S, the following components are not required:

  • kubelet
  • kube-proxy
  • Docker
  • etcd
  • Ingress, such as ngnix

Applicable scenario

  • Edge computing -Edge
  • The Internet of things – IoT
  • CI
  • Development
  • ARM
  • Embedded K8s

The working principle of

storage

The local store

K3s has deleted k8S built-in Cloud Provider and storage plug-ins (of course, this will not affect the use of external plug-ins installed through manual installation), and built-in Local Path provider.

External storage plugin longhorn

The K3S storage problem can be solved by using external storage plug-ins

GitHub address: github.com/longhorn/lo…

Longhorn is lightweight, reliable and powerful. Longhorn can be installed on an existing Kubernetes cluster using the Kubectl apply command or using Helm Charts. After Longhorn is installed, it will add persistent volume support to the Kubernetes cluster.

network

By default, K3s uses Flannel as the CNI and VXLAN as the default backend.

Flannel

The default Flannel backend is VXLAN.

CLI Flag and the Value describe
--flannel-backend=vxlan(the default) Use the VXLAN back end.
--flannel-backend=ipsec The IPSEC backend is used to encrypt network traffic.
--flannel-backend=host-gw Use the host-gw backend.
--flannel-backend=wireguard Use the WireGuard back end to encrypt network traffic. Additional kernel modules and configurations may be required.

K3s also has built-in CoreDNS, Traefik Ingress Controller, and Service Load Balancer components. If you do not use the default components, you can also deploy other components. Such as using MetalLB instead of the built-in Load Balancer.

Traefik is a modern HTTP reverse proxy and load balancer built for easy deployment of microservices. It simplifies network complexity when designing, deploying, and running applications.

k8s

Kubernetes, also known as K8S or simply “Kube”, is an open source platform that automatically implements Linux container operations.

Kubernetes related terms

As with other technologies, Kubernetes uses some specialized vocabulary, which may cause some obstacles for beginners to understand and master the technology. To help you understand Kubernetes, we explain some common terms below.

  • Master: Computer used to control the Kubernetes node. All task assignments come from this.
  • Node: A computer responsible for executing requests and assigned tasks. The Kubernetes host is responsible for controlling the nodes.
  • Container set (Pod) : A container group containing one or more containers deployed on a single node. All containers in the same container set share the same IP address, IPC, host name, and other resources. Container assembly abstracts network and storage from the underlying container. This makes it easier to move containers around the cluster.
  • Replication Controller: Used to control the number of identical copies of the container set that should be running somewhere in the cluster.
  • Services: Separate the work from the container set. The Kubernetes service proxy automatically dispatches service requests to the correct container set — no matter where the container set is moved in the cluster, it can even be replaced.
  • Kubelet: a service running on a node that reads a container list (container manifest) to ensure that the specified container is up and running.
  • Kubectl: Command line configuration tool for Kubernetes.

Recommended reading

Kubernetes. IO/useful/docs/con…

k3s vs k8s

Functional comparison

  • Remove obsolete functionality, Alpha functionality, non-default functionality that is no longer available in most Kubernetes clusters.
  • Remove built-in plug-ins (such as cloud vendor plug-ins and storage plug-ins) and replace them with external plug-ins. By default, K3s starts only two applications other than its own process: CoreDNS and Traefik.
  • Add SQLite3 as the default data store. Etcd3 is still available, but not the default.
  • The default container is changed from docker to Containerd.
  • Encapsulated in a simple launcher that handles many complex TLS and options.

k9s

K9s is a curses-based full-screen terminal UI management tool that can interact with Kubernetes clusters, observe system resources, switch between resources, check lists, logs, monitor events and execute PODS, etc., to ensure that desktop space is not occupied by a large number of terminal panes

GitHub address: github.com/derailed/k9…

Common commands

# List all available CLI options
$ k9s help

# To get info about K9s runtime (logs, configs, etc..)
$ k9s info

# To run K9s in a given namespace
$ k9s -n mycoolns

# Start K9s in an existing KubeConfig context
$ k9s --context coolCtx

# Start K9s in readonly mode - with all modification commands disabled
$ k9s --readonly
Copy the code

Running effect drawing

Pods

Logs

Deployments

Example

Recommended reading

Cloud native community widget SIG