• Stars
    star
    2,027
  • Rank 22,234 (Top 0.5 %)
  • Language
    Go
  • License
    Apache License 2.0
  • Created over 4 years ago
  • Updated 4 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons, it supports all-in-one, multi-node, and HA ๐Ÿ”ฅ โŽˆ ๐Ÿณ

CI

English | ไธญๆ–‡

๐Ÿ‘‹ Welcome to KubeKey!

KubeKey is an open-source lightweight tool for deploying Kubernetes clusters. It provides a flexible, rapid, and convenient way to install Kubernetes/K3s only, both Kubernetes/K3s and KubeSphere, and related cloud-native add-ons. It is also an efficient tool to scale and upgrade your cluster.

In addition, KubeKey also supports customized Air-Gap package, which is convenient for users to quickly deploy clusters in offline environments.

KubeKey has passed CNCF kubernetes conformance verification.

Use KubeKey in the following three scenarios.

  • Install Kubernetes/K3s only
  • Install Kubernetes/K3s and KubeSphere together in one command
  • Install Kubernetes/K3s first, then deploy KubeSphere on it using ks-installer

Important: If you have existing Kubernetes clusters, please refer to ks-installer (Install KubeSphere on existing Kubernetes cluster).

Supported Environment

Linux Distributions

  • Ubuntu 16.04, 18.04, 20.04, 22.04
  • Debian Bullseye, Buster, Stretch
  • CentOS/RHEL 7
  • AlmaLinux 9.0
  • SUSE Linux Enterprise Server 15

Recommended Linux Kernel Version: 4.15 or later You can run the uname -srm command to check the Linux Kernel Version.

Kubernetes Versions

  • v1.19: โ€‚ v1.19.15
  • v1.20: โ€‚ v1.20.10
  • v1.21: โ€‚ v1.21.14
  • v1.22: โ€‚ v1.22.15
  • v1.23: โ€‚ v1.23.10 (default)
  • v1.24: โ€‚ v1.24.7
  • v1.25: โ€‚ v1.25.3

Looking for more supported versions:
Kubernetes Versions
K3s Versions

Container Manager

  • Docker / containerd / CRI-O / iSula

Kata Containers can be set to automatically install and configure runtime class for it when the container manager is containerd or CRI-O.

Network Plugins

  • Calico / Flannel / Cilium / Kube-OVN / Multus-CNI

Kubekey also supports users to set the network plugin to none if there is a requirement for custom network plugin.

Requirements and Recommendations

  • Minimum resource requirements (For Minimal Installation of KubeSphere only)๏ผš
    • 2 vCPUs
    • 4 GB RAM
    • 20 GB Storage

/var/lib/docker is mainly used to store the container data, and will gradually increase in size during use and operation. In the case of a production environment, it is recommended that /var/lib/docker mounts a drive separately.

  • OS requirements:
    • SSH can access to all nodes.
    • Time synchronization for all nodes.
    • sudo/curl/openssl should be used in all nodes.
    • docker can be installed by yourself or by KubeKey.
    • Red Hat includes SELinux in its Linux release. It is recommended to close SELinux or switch the mode of SELinux to Permissive
  • It's recommended that Your OS is clean (without any other software installed), otherwise there may be conflicts.
  • A container image mirror (accelerator) is recommended to be prepared if you have trouble downloading images from dockerhub.io. Configure registry-mirrors for the Docker daemon.
  • KubeKey will install OpenEBS to provision LocalPV for development and testing environment by default, this is convenient for new users. For production, please use NFS / Ceph / GlusterFS or commercial products as persistent storage, and install the relevant client in all nodes.
  • If you encounter Permission denied when copying, it is recommended to check SELinux and turn off it first
  • Dependency requirements:

KubeKey can install Kubernetes and KubeSphere together. Some dependencies need to be installed before installing kubernetes after version 1.18. You can refer to the list below to check and install the relevant dependencies on your node in advance.

Kubernetes Version โ‰ฅ 1.18
socat Required
conntrack Required
ebtables Optional but recommended
ipset Optional but recommended
ipvsadm Optional but recommended
  • Networking and DNS requirements:
    • 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 Group๏ผŒyou 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.

Usage

Get the KubeKey Executable File

  • The fastest way to get KubeKey is to use the script:

    curl -sfL https://get-kk.kubesphere.io | sh -
    
  • Binary downloads of the KubeKey also can be found on the Releases page. Unpack the binary and you are good to go!

  • Build Binary from Source Code

    git clone https://github.com/kubesphere/kubekey.git
    cd kubekey
    make kk

Create a Cluster

Quick Start

Quick Start is for all-in-one installation which is a good start to get familiar with Kubernetes and KubeSphere.

Note: Since Kubernetes temporarily does not support uppercase NodeName, contains uppercase letters in the hostname will lead to subsequent installation error

Command

If you have problem to access https://storage.googleapis.com, execute first export KKZONE=cn.

./kk create cluster [--with-kubernetes version] [--with-kubesphere version]
Examples
  • Create a pure Kubernetes cluster with default version (Kubernetes v1.23.10).

    ./kk create cluster
  • Create a Kubernetes cluster with a specified version.

    ./kk create cluster --with-kubernetes v1.24.1 --container-manager containerd
  • Create a Kubernetes cluster with KubeSphere installed.

    ./kk create cluster --with-kubesphere v3.2.1

Advanced

You have more control to customize parameters or create a multi-node cluster using the advanced installation. Specifically, create a cluster by specifying a configuration file.

If you have problem to access https://storage.googleapis.com, execute first export KKZONE=cn.

  1. First, create an example configuration file

    ./kk create config [--with-kubernetes version] [--with-kubesphere version] [(-f | --filename) path]

    examples:

    • create an example config file with default configurations. You also can specify the file that could be a different filename, or in different folder.
    ./kk create config [-f ~/myfolder/abc.yaml]
    • with KubeSphere
    ./kk create config --with-kubesphere v3.2.1
  2. Modify the file config-sample.yaml according to your environment

Note: Since Kubernetes temporarily does not support uppercase NodeName, contains uppercase letters in workerNode`s name will lead to subsequent installation error

A persistent storage is required in the cluster, when kubesphere will be installed. The local volume is used default. If you want to use other persistent storage, please refer to addons.

  1. Create a cluster using the configuration file

    ./kk create cluster -f config-sample.yaml

Enable Multi-cluster Management

By default, KubeKey will only install a solo cluster without Kubernetes federation. If you want to set up a multi-cluster control plane to centrally manage multiple clusters using KubeSphere, you need to set the ClusterRole in config-example.yaml. For multi-cluster user guide, please refer to How to Enable the Multi-cluster Feature.

Enable Pluggable Components

KubeSphere has decoupled some core feature components since v2.1.0. These components are designed to be pluggable which means you can enable them either before or after installation. By default, KubeSphere will be started with a minimal installation if you do not enable them.

You can enable any of them according to your demands. It is highly recommended that you install these pluggable components to discover the full-stack features and capabilities provided by KubeSphere. Please ensure your machines have sufficient CPU and memory before enabling them. See Enable Pluggable Components for the details.

Add Nodes

Add new node's information to the cluster config file, then apply the changes.

./kk add nodes -f config-sample.yaml

Delete Nodes

You can delete the node by the following command๏ผŒthe nodeName that needs to be removed.

./kk delete node <nodeName> -f config-sample.yaml

Delete Cluster

You can delete the cluster by the following command:

  • If you started with the quick start (all-in-one):
./kk delete cluster
  • If you started with the advanced (created with a configuration file):
./kk delete cluster [-f config-sample.yaml]

Upgrade Cluster

Allinone

Upgrading cluster with a specified version.

./kk upgrade [--with-kubernetes version] [--with-kubesphere version] 
  • Support upgrading Kubernetes only.
  • Support upgrading KubeSphere only.
  • Support upgrading Kubernetes and KubeSphere.

Multi-nodes

Upgrading cluster with a specified configuration file.

./kk upgrade [--with-kubernetes version] [--with-kubesphere version] [(-f | --filename) path]
  • If --with-kubernetes or --with-kubesphere is specified, the configuration file will be also updated.
  • Use -f to specify the configuration file which was generated for cluster creation.

Note: Upgrading multi-nodes cluster need a specified configuration file. If the cluster was installed without kubekey or the configuration file for installation was not found, the configuration file needs to be created by yourself or following command.

Getting cluster info and generating kubekey's configuration file (optional).

./kk create config [--from-cluster] [(-f | --filename) path] [--kubeconfig path]
  • --from-cluster means fetching cluster's information from an existing cluster.
  • -f refers to the path where the configuration file is generated.
  • --kubeconfig refers to the path where the kubeconfig.
  • After generating the configuration file, some parameters need to be filled in, such as the ssh information of the nodes.

Documents

Contributors โœจ

Thanks goes to these wonderful people (emoji key):

pixiake
pixiake

๐Ÿ’ป ๐Ÿ“–
Forest
Forest

๐Ÿ’ป ๐Ÿ“–
rayzhou2017
rayzhou2017

๐Ÿ’ป ๐Ÿ“–
shaowenchen
shaowenchen

๐Ÿ’ป ๐Ÿ“–
Zhao Xiaojie
Zhao Xiaojie

๐Ÿ’ป ๐Ÿ“–
Zack Zhang
Zack Zhang

๐Ÿ’ป
Akhil Mohan
Akhil Mohan

๐Ÿ’ป
pengfei
pengfei

๐Ÿ“–
min zhang
min zhang

๐Ÿ’ป ๐Ÿ“–
zgldh
zgldh

๐Ÿ’ป
xrjk
xrjk

๐Ÿ’ป
yonghongshi
yonghongshi

๐Ÿ’ป
Honglei
Honglei

๐Ÿ“–
liucy1983
liucy1983

๐Ÿ’ป
Lien
Lien

๐Ÿ“–
Tony Wang
Tony Wang

๐Ÿ“–
Hongliang Wang
Hongliang Wang

๐Ÿ’ป
dawn
dawn

๐Ÿ’ป
Duan Jiong
Duan Jiong

๐Ÿ’ป
calvinyv
calvinyv

๐Ÿ“–
Benjamin Huo
Benjamin Huo

๐Ÿ“–
Sherlock113
Sherlock113

๐Ÿ“–
fu_changjie
fu_changjie

๐Ÿ“–
yuswift
yuswift

๐Ÿ’ป
ruiyaoOps
ruiyaoOps

๐Ÿ“–
LXM
LXM

๐Ÿ“–
sbhnet
sbhnet

๐Ÿ’ป
misteruly
misteruly

๐Ÿ’ป
John Niang
John Niang

๐Ÿ“–
Michael Li
Michael Li

๐Ÿ’ป
็‹ฌๅญคๆ˜Šๅคฉ
็‹ฌๅญคๆ˜Šๅคฉ

๐Ÿ’ป
Liu Shaohui
Liu Shaohui

๐Ÿ’ป
Leo Li
Leo Li

๐Ÿ’ป
Roland
Roland

๐Ÿ’ป
Vinson Zou
Vinson Zou

๐Ÿ“–
tag_gee_y
tag_gee_y

๐Ÿ’ป
codebee
codebee

๐Ÿ’ป
Daniel Owen van Dommelen
Daniel Owen van Dommelen

๐Ÿค”
Naidile P N
Naidile P N

๐Ÿ’ป
Haiker Sun
Haiker Sun

๐Ÿ’ป
Jing Yu
Jing Yu

๐Ÿ’ป
Chauncey
Chauncey

๐Ÿ’ป
Tan Guofu
Tan Guofu

๐Ÿ’ป
lvillis
lvillis

๐Ÿ“–
Vincent He
Vincent He

๐Ÿ’ป
laminar
laminar

๐Ÿ’ป
tongjin
tongjin

๐Ÿ’ป
Reimu
Reimu

๐Ÿ’ป
Ikko Ashimine
Ikko Ashimine

๐Ÿ“–
Ben Ye
Ben Ye

๐Ÿ’ป
yinheli
yinheli

๐Ÿ’ป
hellocn9
hellocn9

๐Ÿ’ป
Brandan Schmitz
Brandan Schmitz

๐Ÿ’ป
yjqg6666
yjqg6666

๐Ÿ“– ๐Ÿ’ป
ๅคฑ็œ ๆ˜ฏ็œŸๆปด้šพๅ—
ๅคฑ็œ ๆ˜ฏ็œŸๆปด้šพๅ—

๐Ÿ’ป
mango
mango

๐Ÿ‘€
wenwutang
wenwutang

๐Ÿ’ป
Shiny Hou
Shiny Hou

๐Ÿ’ป
zhouqiu0103
zhouqiu0103

๐Ÿ’ป
77yu77
77yu77

๐Ÿ’ป
hzhhong
hzhhong

๐Ÿ’ป
zhang-wei
zhang-wei

๐Ÿ’ป
Deshi Xiao
Deshi Xiao

๐Ÿ’ป ๐Ÿ“–
besscroft
besscroft

๐Ÿ“–
ๅผ ๅฟ—ๅผบ
ๅผ ๅฟ—ๅผบ

๐Ÿ’ป
lwabish
lwabish

๐Ÿ’ป ๐Ÿ“–
qyz87
qyz87

๐Ÿ’ป
ZhengJin Fang
ZhengJin Fang

๐Ÿ’ป
Eric_Lian
Eric_Lian

๐Ÿ’ป
nicognaw
nicognaw

๐Ÿ’ป
ๅ•ๅพทๅบ†
ๅ•ๅพทๅบ†

๐Ÿ’ป
littleplus
littleplus

๐Ÿ’ป
Konstantin
Konstantin

๐Ÿค”
kiragoo
kiragoo

๐Ÿ’ป
jojotong
jojotong

๐Ÿ’ป
littleBlackHouse
littleBlackHouse

๐Ÿ’ป ๐Ÿ“–
guangwu
guangwu

๐Ÿ’ป ๐Ÿ“–
wongearl
wongearl

๐Ÿ’ป
wenwenxiong
wenwenxiong

๐Ÿ’ป

This project follows the all-contributors specification. Contributions of any kind welcome!

More Repositories

1

kubesphere

The container platform tailored for Kubernetes multi-cloud, datacenter, and edge management โŽˆ ๐Ÿ–ฅ โ˜๏ธ
Go
12,855
star
2

kubeeye

KubeEye aims to find various problems on Kubernetes, such as application misconfiguration, unhealthy cluster components and node problems.
Go
786
star
3

console

KubeSphere Console is the web-based UI for KubeSphere clusters.
JavaScript
558
star
4

ks-installer

Install KubeSphere on existing Kubernetes cluster
Jinja
507
star
5

notification-manager

K8s native notification management with multi-tenancy support
Go
218
star
6

kube-events

K8s Event Exporting, Filtering and Alerting in Multi-Tenant Environment
Go
164
star
7

ks-devops

This is a cloud-native application that focuses on the DevOps area.
Go
158
star
8

community

KubeSphere Community
120
star
9

devops-java-sample

SpringBoot demo for DevOps on KubeSphere
Java
117
star
10

helm-charts

Source & Repo of https://charts.kubesphere.io/main & https://charts.kubesphere.io/test
Mustache
97
star
11

kube-design

Kube Design for KubeSphere Console
JavaScript
96
star
12

tower

Proxy for multiple Kubernetes cluster communication
Go
92
star
13

website

KubeSphere website and documentation 3.x
SCSS
78
star
14

devops-agent

Agents for Kubesphere DevOps
Dockerfile
59
star
15

s2ioperator

Operator for Source to image
Go
41
star
16

devops-maven-sample

Java
36
star
17

alert

Go
27
star
18

logsidecar-injector

A MutatingAdmissionWebhook that adds a sidecar to your pod. This sidecar is just for forwarding file log on the volume.
Go
25
star
19

ks-jenkins

Jenkins distribution for Kubesphere
Python
24
star
20

dev-guide

A set of development guidelines for KubeSphere developers.
HTML
19
star
21

s2irun

Run s2i in pod
Go
18
star
22

monitoring-dashboard

Custom Metrics Monitoring Dashboard for Apps on KubeSphere
Go
16
star
23

s2i-java-container

Java S2I Builder image
Shell
15
star
24

event-rule-engine

Go
10
star
25

tutorial

KubeSphere tutorial repo, include samples code, docs etc.
Shell
10
star
26

storageclass-accessor

The storageclass-accessor webhook is an HTTP callback which responds to admission requests.
Go
9
star
27

client-go

Go
9
star
28

devops-go-sample

Go
8
star
29

image-sync-config

8
star
30

im

A general identity management system
Go
8
star
31

api

Go
7
star
32

ksbuilder

A CLI tool helps you to manage the development of kubesphere extensions
Go
7
star
33

s2i-java-runtimeImage

a java runtime image for s2i
Shell
5
star
34

alert-adapter

Go
5
star
35

s2i-python-container

Shell
5
star
36

pvc-autoresizer

pvc-autoresizer resizes PersistentVolumeClaims (PVCs) when the free amount of storage is below the threshold.
Go
5
star
37

test-infra

Dockerfile
4
star
38

prometheus-example-app

Smarty
4
star
39

devops-python-sample

devops-python-sample for Kubesphere
Python
4
star
40

kubeeye-console

TypeScript
3
star
41

sonargo

Go
3
star
42

cluster-api-provider-qingcloud

The QingCloud provider implementation of the Cluster Management API
Go
3
star
43

create-ks-project

A CLI tool enables you to quickly set up a KubeSphere Console extension project.
TypeScript
3
star
44

s2i-nodejs-container

Shell
3
star
45

ks-prometheus

Jsonnet
2
star
46

aks-kubesphere-linux

KubeSphere on Azure AKS
2
star
47

openpitrix-jobs

Go
2
star
48

alertmanager-kit

alertmanager-kit encapsulates the interface to alertmanager in a neat way.
Go
2
star
49

container-common-scripts

Shell
2
star
50

s2i-binary-container

Dockerfile
1
star
51

devops-docs-sample

JavaScript
1
star
52

springboot-sample

Java
1
star
53

extension-samples

JavaScript
1
star
54

s2i-base-container

Shell
1
star
55

artwork

๐ŸŽจKubeSphere-related logos and artwork
1
star
56

.github

1
star
57

kubeocean-api

Go
1
star
58

kubectl

kubectl docker image used in kubesphere.
Dockerfile
1
star
59

design-prototypes

Design prototypes for kubesphere console.
HTML
1
star