Install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons, it supports all-in-one, multi-node, and HA 🔥🐳
Go to file
Forest-L ff3d84bf1d add motivation 2020-05-05 21:23:55 +08:00
build add K2Cluster object 2020-04-26 10:40:50 +08:00
cmd transfer to kubesphere 2020-05-01 16:13:59 +08:00
deploy add K2Cluster object 2020-04-26 10:40:50 +08:00
docs update storage-client.md 2020-04-29 20:24:59 +08:00
pkg transfer to kubesphere 2020-05-01 16:13:59 +08:00
scripts update command 2020-04-30 23:52:41 +08:00
version add K2Cluster object 2020-04-26 10:40:50 +08:00
OWNERS add owners 2020-05-01 16:04:53 +08:00
README.md add motivation 2020-05-05 21:23:55 +08:00
build.sh update build.sh 2020-04-29 23:10:29 +08:00
go.mod transfer to kubesphere 2020-05-01 16:13:59 +08:00
kubekey.go transfer to kubesphere 2020-05-01 16:13:59 +08:00
tools.go add K2Cluster object 2020-04-26 10:40:50 +08:00

KubeKey

Start Kubernetes and KubeSphere flexibly and easily.

Motivation

The Kubernetes installation script in Kubekey is developed by go language, which replaces ansible, which was previously developed in python language. It greatly reduces the dependence on the OS environment and enhances the robustness of successful installation. Kubekey integrates the mainstream Kubeadm method to install Kubernetes instead of the relatively complex Kubespray, which greatly reduces the installation time, and makes it easier for developers to understand the installation process. In contrast to previous installation methods, the allinone environment offers capacity augmentation from a stand-alone to a multi-machine environment. In a multi-node installation, the configuration parameters take the customary prompt and enter values.

Quick Start

Prepare

Please follow the list to prepare environment.

Supported Linux Distributions

  • Ubuntu 16.04, 18.04
  • Debian Buster, Stretch
  • CentOS/RHEL 7

Requirements and Recommendations

  • Require SSH can access to all nodes, sudo and curl can be used in all nodes.
  • It's recommended that Your OS is clean (without any other software installed), otherwise there may be conflicts.
  • OS requirements (For Minimal Installation of KubeSphere only)at least 2 vCPUs and 4GB RAM.
  • Make sure the storage service is available if you want to deploy a cluster with KubeSphere.
    The relevant client should be installed on all nodes in cluster, if you storage server is nfs / ceph / glusterfs.
  • Make sure the DNS address in /etc/resolv.conf is available. Otherwise, it may cause some issues of DNS in cluster.
  • If your network configuration uses Firewall or Security Groupyou must ensure infrastructure components can communicate with each other through specific ports.
    It's recommended that you turn off the firewall or follow the link configuriation: NetworkAccess
  • A container image mirror (accelerator) is recommended to be prepared, if you have trouble downloading images from dockerhub.io.

Usage

  • Download binary
curl -O -k https://kubernetes.pek3b.qingstor.com/tools/kubekey/kk
chmod +x kk
  • Deploy a cluster
# allinone
./kk create cluster

# multiNodes
# 1. Create a example configuration file by following command or reference docs/config-example.md
./kk create config      # Only kubernetes
./kk create config --add localVolume      # Add plugins (eg: localVolume / nfsClient / localVolume,nfsClient)

# 2. Please fill in the configuration file under the current path (k2cluster-example.yaml) according to the environmental information.

# 3. Deploy cluster
./kk create cluster -f ./k2cluster-example.yaml
  • Add Nodes

Add new node's information to the cluster config file

./kk scale -f ./k2cluster-example.yaml
  • Reset Cluster
# allinone
./kk reset

# multinodes
./kk reset -f ./k2cluster-example.yaml

Build

git clone https://github.com/kubesphere/kubekey.git
cd kubekey
./build.sh

Note: Docker needs to be installed before building.

Road Map

  • CaaO (Cluster as a Object)
  • Support more container runtimes: cri-o containerd