KlusterKit

KlusterKit: An open source toolkit to simplify Kubernetes deployments and work in physically isolated local environments

KlusterKit

Today, we are pleased to announce that Platform9 is open-sourcing Klusterkit, a set of three tools, under the Apache v2.0 license on GitHub.

Our clients roll out software in private data centers, which are often not connected to the Internet (for security or other reasons). These large companies want to take advantage of Kubernetes and modernize their applications while rolling them out in different data centers, which are often disconnected from the outside world. This is where Klusterkit comes in, which makes it easy to provision and manage K8s clusters in physically isolated environments.

Klusterkit includes three independent tools that can be used together or separately to manage the lifecycle of a Kubernetes production cluster:

  1. etcdadm, CLI for simplified etcd cluster management.
  2. nodeadm, a node administration CLI that complements kubeadm and deploys dependencies needed by kubeadm.
  3. cctl, a cluster lifecycle management tool that takes the Cluster API from the Kubernetes community and uses nodeadm and etcdadm to seamlessly provision and maintain highly available Kubernetes clusters in on-premise and physically isolated environments.

Together, these three tools perform the following tasks:

  • Easily provision and manage a highly available etcd cluster and Kubernetes dashboard in physically isolated local environments via the Cluster API.
  • Restoring the cluster control panel after a failure using an etcd backup.
  • Packaging all the artifacts needed to deliver Kubernetes in physically isolated environments.

Klusterkit features

  • Multi-master support (K8s HA cluster).
  • Provision and management of etcd secure clusters.
  • Work in physically isolated environments.
  • Support for sequential upgrade and rollback.
  • Flannel (vxlan) as CNI for backend plans to support other CNIs.
  • Backing up and restoring etcd clusters after quorum loss.
  • Control panel protection against low memory and CPU time.

Klusterkit Solution Architecture

KlusterKit

For fault tolerance and simplicity, Klusterkit uses a single cctl-state.yaml file to store Kubernetes cluster metadata. Through the cctl CLI, you can manage the life cycle of a Kubernetes cluster on any machine that has this state file. This can be an operator's laptop or any other computer that is part of a Kubernetes cluster.

Cctl implements and calls the cluster-api interface from upstream as a library for CRUD operations on clusters. He uses ssh-provider, the open source bare-metal cluster-api provider from Platform9, which in turn calls etcdadm and nodeadm to perform operations on the cluster.

How to use Klusterkit and its components:

1 - Any of the three tools can be easily built with the go get command:

go get -u github.com/platform9/cctl

go get -u github.com/platform9/nodeadm

go get -u github.com/kubernetes-sigs/etcdadm

2 - These executables can then be packaged and copied to the target machines where the highly available Kubernetes cluster should be running. Place the nodeadm and etcdadm files in the version directories:

cp $GOPATH/bin/nodeadm /var/cache/ssh-provider/nodeadm//

cp $GOPATH/bin/etcdadm /var/cache/ssh-provider/etcdadm//

3 - If you need to orchestrate a Kubernetes cluster locally, in a physically isolated environment, the necessary dependencies can be easily downloaded in advance on a computer with Internet access with the nodeadm and etcdadm boot command. The downloaded items (i.e. kubelet and systemd kubelet unit file, CNI executable files, kubeadm file, all container images including Kubernetes, keepalived image and systemd file, etcd container image and related configuration files) can then be easily copied to physically isolated hosts along with cctl, nodeadm and etcdadm. (See details in wiki).

4 - When everything is in place, you can create the first Kubernetes cluster with a couple of commands:

– First, create credentials for the cluster.

$GOPATH/bin/cctl create credential --user root --private-key ~/.ssh/id_rsa

– Then create a cluster object. --help brings up a list of supported options.

$GOPATH/bin/cctl create cluster --pod-network 192.168.0.0/16 --service-network 192.169.0.0/24

– Finally, create the first machine in the cluster.

$GOPATH/bin/cctl create machine --ip $MACHINE_IP --role master

Read more documentation at GitHub.

Source: habr.com

Add a comment