Kubernetes with K3S

Distribution Overview

  • Control plane storage: SQLite instead of ETCD (but etcd3 can be configured)
  • CRI: containerd
  • CNI: Flanel
  • Ingress: Traefik Ingress Controller
  • Storage: Custom local storage provider
  • Additional features: Helm controller

Installation Architectures

  • Single Server Setup: One master node, several worker nodes. The master node stores its data in an embedded SQLite database. The master node is started with the command k3 server. Worker nodes first run k3s join $MASTER_NODE_IP, and then start the agent process with k3s agent.
  • Multi Server Setup: Two or more master nodes, several worker nodes. The master nodes use an external database for recording the cluster state. For worker nodes to join the cluster, first, a fixed registration address needs to be configured, and then the worker join exactly to this address.

Installation Process

Single Server Setup

  1. Start the master node by executing the following script:
curl -sfL https://get.k3s.io | sh -
curl -sfL https://get.k3s.io | K3S_URL=$K3S_Server K3S_TOKEN=$K3S_TOKEN sh -

Multi Server Setup

  1. Create an external datastore, such as Postgres, MySQL, MariaDB, or ETCD
  2. Install the K3S binary on the server node
  3. Start the K3S process in server mode, providing the address of the storage server (like in the following example)
k3-server \
--token=$SECRET \
--datastore-endpoint=$DATASTORE_ENDPOINT_URL
  1. One master node needs to have a fixed registration address, like a DNS entry virtual IP, to which the nodes connect: You need to configure one such address, and use this also for connecting to the Kube API of the server
  2. On additional server nodes, start the same command as in step 3, using the same token
  3. Join worker nodes by running the following command that connects to the fixed registration address:
K3S_TOKEN=$SECRET k3s agent --server $FIXED_REGISTRATION_ADDRESS:6443

Upgrade Process

curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=v1.22.1 sh -

Customization

  • Embedded SQLite
  • PostgreSQL
  • MySQL
  • MariaDB
  • Etcd
  • containerd
  • Docker
  • Flanel
  • Canal
  • Calico

Conclusion

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store