All Projects → kinvolk → Kube Spawn

kinvolk / Kube Spawn

Licence: apache-2.0
A tool for creating multi-node Kubernetes clusters on a Linux machine using kubeadm & systemd-nspawn. Brought to you by the Kinvolk team.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Kube Spawn

K8s Digitalocean Terraform
Deploy latest Kubernetes cluster on DigitalOcean using Terraform
Stars: ✭ 33 (-91.58%)
Mutual labels:  cluster, kubeadm
Miniswarm
Docker Swarm cluster in one command
Stars: ✭ 130 (-66.84%)
Mutual labels:  containers, cluster
Minimesos
The experimentation and testing tool for Apache Mesos - NO LONGER MAINTANED!
Stars: ✭ 429 (+9.44%)
Mutual labels:  containers, cluster
Minikube
Run Kubernetes locally
Stars: ✭ 22,673 (+5683.93%)
Mutual labels:  containers, cluster
kubernetes-deployment
No description or website provided.
Stars: ✭ 15 (-96.17%)
Mutual labels:  cluster, kubeadm
Kubeadm Ha
Kubernetes high availiability deploy based on kubeadm, loadbalancer included (English/中文 for v1.15 - v1.20+)
Stars: ✭ 614 (+56.63%)
Mutual labels:  cluster, kubeadm
Verwalter
A tool which manages cluster of services
Stars: ✭ 34 (-91.33%)
Mutual labels:  containers, cluster
Kubeadm Playbook
Fully fledged (HA) Kubernetes Cluster using official kubeadm, ansible and helm. Tested on RHEL/CentOS/Ubuntu with support of http_proxy, dashboard installed, ingress controller, heapster - using official helm charts
Stars: ✭ 533 (+35.97%)
Mutual labels:  cluster, kubeadm
Cilium
eBPF-based Networking, Security, and Observability
Stars: ✭ 10,256 (+2516.33%)
Mutual labels:  cni, containers
Sdn Handbook
SDN网络指南(SDN Handbook)
Stars: ✭ 856 (+118.37%)
Mutual labels:  cni, containers
Cni Genie
CNI-Genie for choosing pod network of your choice during deployment time. Supported pod networks - Calico, Flannel, Romana, Weave
Stars: ✭ 408 (+4.08%)
Mutual labels:  cni, kubeadm
Bitnami Docker Redis
Bitnami Redis Docker Image
Stars: ✭ 317 (-19.13%)
Mutual labels:  containers, cluster
K8s Tew
Kubernetes - The Easier Way
Stars: ✭ 269 (-31.38%)
Mutual labels:  containers, cluster
Picluster
A Simplified Docker Swarm or Kubernetes Alternative to Container Scheduling and Orchestration
Stars: ✭ 390 (-0.51%)
Mutual labels:  containers, cluster
Bk Bcs
蓝鲸智云容器管理平台(BlueKing Container Service)
Stars: ✭ 368 (-6.12%)
Mutual labels:  containers
Nfx
C# Server UNISTACK framework [MOVED]
Stars: ✭ 379 (-3.32%)
Mutual labels:  cluster
Grype
A vulnerability scanner for container images and filesystems
Stars: ✭ 362 (-7.65%)
Mutual labels:  containers
Buildkit
concurrent, cache-efficient, and Dockerfile-agnostic builder toolkit
Stars: ✭ 4,537 (+1057.4%)
Mutual labels:  containers
Cinf
Command line tool to view namespaces and cgroups, useful for low-level container prodding
Stars: ✭ 389 (-0.77%)
Mutual labels:  containers
Bastille
Bastille is an open-source system for automating deployment and management of containerized applications on FreeBSD.
Stars: ✭ 377 (-3.83%)
Mutual labels:  containers

kube-spawn Logo

kube-spawn

kube-spawn is a tool for creating a multi-node Kubernetes (>= 1.8) cluster on a single Linux machine, created mostly for developers of Kubernetes but is also a Certified Kubernetes Distribution and, therefore, perfect for running and testing deployments locally.

It attempts to mimic production setups by making use of OS containers to set up nodes.

Demo

asciicast

Requirements

  • systemd-nspawn in at least version 233

  • Large enough /var/lib/machines partition.

    If /var/lib/machines is not its own filesystem, systemd-nspawn will create /var/lib/machines.raw and loopback mount it as a btrfs filesystem. You may wish to increase the default size:

    machinectl set-limit 20G

    We recommend you create a partition of sufficient size, format it as btrfs, and mount it on /var/lib/machines, rather than letting the loopback mechanism take hold.

    In the event there is a loopback file mounted on /var/lib/machines, kube-spawn will attempt to enlarge the underlying image /var/lib/machines.raw on cluster start, but this can only succeed when the image is not in use by another cluster or machine. Not enough disk space is a common source of error. See doc/troubleshooting for instructions on how to increase the size manually.

  • qemu-img

Installation

kube-spawn should run well on a modern Linux system (for example Fedora 27 or Debian testing). If you want to test it in a controlled environment, you can use Vagrant.

To install kube-spawn on your machine, download a single binary release or build from source.

kube-spawn uses CNI to setup networking for its containers. For that, you need to download the CNI plugins (v.0.6.0 or later) from GitHub.

Example:

cd /tmp
curl -fsSL -O https://github.com/containernetworking/plugins/releases/download/v0.6.0/cni-plugins-amd64-v0.6.0.tgz
sudo mkdir -p /opt/cni/bin
sudo tar -C /opt/cni/bin -xvf cni-plugins-amd64-v0.6.0.tgz

By default, kube-spawn expects the plugins in /opt/cni/bin. The location can be configured with --cni-plugin-dir= from the command line or by setting cni-plugin-dir: ... in the configuration file.

Alternatively, you can use go get to fetch the plugins into your GOPATH:

go get -u github.com/containernetworking/plugins/plugins/...

Quickstart

Create and start a 3 node cluster with the name "default":

sudo ./kube-spawn create
sudo ./kube-spawn start [--nodes 3]

Reminder: if the CNI plugins can't be found in /opt/cni/bin, you need to pass --cni-plugin-dir path/to/plugins.

create prepares the cluster environment in /var/lib/kube-spawn/clusters.

start brings up the nodes and configures the cluster using kubeadm.

Shortly after, the cluster should be initialized:

[...]

Cluster "default" initialized
Export $KUBECONFIG as follows for kubectl:

        export KUBECONFIG=/var/lib/kube-spawn/clusters/default/admin.kubeconfig

After another 1-2 minutes the nodes should be ready:

export KUBECONFIG=/var/lib/kube-spawn/clusters/default/admin.kubeconfig
kubectl get nodes
NAME                          STATUS    ROLES     AGE       VERSION
kube-spawn-c1-master-q9fd4y   Ready     master    5m        v1.9.6
kube-spawn-c1-worker-dj7xou   Ready     <none>    4m        v1.9.6
kube-spawn-c1-worker-etbxnu   Ready     <none>    4m        v1.9.6

Configuration

kube-spawn can be configured by command line flags, configuration file (default /etc/kube-spawn/config.yaml or --config path/to/config.yaml), environment variables or a mix thereof.

Example:

# /etc/kube-spawn/config.yaml
cni-plugin-dir: /home/user/code/go/bin
cluster-name: cluster1
container-runtime: rkt
rktlet-binary-path: /home/user/code/go/src/github.com/kubernetes-incubator/rktlet/bin/rktlet

CNI plugins

kube-spawn supports weave, flannel, calico. It defaults to weave.

To configure with flannel:

kube-spawn create --pod-network-cidr 10.244.0.0/16 --cni-plugin flannel --kubernetes-version=v1.10.5
kube-spawn start --cni-plugin flannel --nodes 5

To configure with calico:

kube-spawn create --pod-network-cidr 192.168.0.0/16 --cni-plugin calico --kubernetes-version=v1.10.5
kube-spawn start --cni-plugin calico --nodes 5

To configure with canal:

kube-spawn create --pod-network-cidr 10.244.0.0/16 --cni-plugin canal --kubernetes-version=v1.10.5
kube-spawn start --cni-plugin canal --nodes 5

Accessing kube-spawn nodes

All nodes can be seen with machinectl list. machinectl shell can be used to access a node, for example:

sudo machinectl shell kube-spawn-c1-master-fubo3j

The password is root.

Documentation

See doc/

Building

To build kube-spawn in a Docker build container, simply run:

make

Optionally, install kube-spawn under a system directory:

sudo make install

PREFIX can be set to override the default target /usr.

Troubleshooting

See doc/troubleshooting

Community

Discuss the project on Slack.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].