All Projects → kubesphere → Kubekey

kubesphere / Kubekey

Licence: apache-2.0
Provides a flexible, rapid and convenient way to install Kubernetes only, both Kubernetes and KubeSphere, and related cloud-native add-ons. It is also an efficient tool to scale and upgrade your cluster.

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to Kubekey

K8s Digitalocean Terraform
Deploy latest Kubernetes cluster on DigitalOcean using Terraform
Stars: ✭ 33 (-88.54%)
Mutual labels:  k8s, kubernetes-cluster, kubeadm
GPU-Kubernetes-Guide
How to setup a production-grade Kubernetes GPU cluster on Paperspace in 10 minutes for $10
Stars: ✭ 34 (-88.19%)
Mutual labels:  kubernetes-cluster, kubeadm, kubernetes-deployment
Metalk8s
An opinionated Kubernetes distribution with a focus on long-term on-prem deployments
Stars: ✭ 217 (-24.65%)
Mutual labels:  k8s, kubernetes-cluster, kubernetes-deployment
ansible-role-k8s
This role render an arbitrary number of Jinja2 templates and deploys or removes them to/from Kubernetes clusters.
Stars: ✭ 26 (-90.97%)
Mutual labels:  kubernetes-cluster, k8s, kubernetes-deployment
eks-anywhere
Run Amazon EKS on your own infrastructure 🚀
Stars: ✭ 1,633 (+467.01%)
Mutual labels:  kubernetes-cluster, k8s, kubernetes-deployment
Kubenow
Deploy Kubernetes. Now!
Stars: ✭ 285 (-1.04%)
Mutual labels:  kubernetes-cluster, kubeadm
k3s-on-prem-production
Playbooks needed to set up an on-premises K3s cluster and securize it
Stars: ✭ 108 (-62.5%)
Mutual labels:  kubernetes-cluster, kubernetes-deployment
rak8s
Stand up a Raspberry Pi based Kubernetes cluster with Ansible
Stars: ✭ 362 (+25.69%)
Mutual labels:  kubernetes-cluster, kubeadm
k8s-istio-demo
Demo showing the capabilities of Istio
Stars: ✭ 22 (-92.36%)
Mutual labels:  kubernetes-cluster, k8s
Kontainerd
Creating a kubernetes kubeadm cluster using Vagrant machines as nodes and Containerd as a container runtime
Stars: ✭ 16 (-94.44%)
Mutual labels:  kubernetes-cluster, kubeadm
terraform-vultr-condor
Kubernetes Deployment Tool for Vultr
Stars: ✭ 60 (-79.17%)
Mutual labels:  kubernetes-cluster, kubernetes-deployment
firework8s
Firework8s is a collection of kubernetes objects (yaml files) for deploying workloads in a home lab.
Stars: ✭ 35 (-87.85%)
Mutual labels:  kubernetes-cluster, k8s
multi-master-kubernetes
Multi-master Kubernetes cluster on Exoscale
Stars: ✭ 65 (-77.43%)
Mutual labels:  kubernetes-cluster, k8s
dashboard
No description or website provided.
Stars: ✭ 18 (-93.75%)
Mutual labels:  k8s, kubernetes-deployment
terraform-provider-kubeadm
A Terraform provider/provisioner for deploying Kubernetes with kubeadm
Stars: ✭ 60 (-79.17%)
Mutual labels:  kubernetes-cluster, kubeadm
k8s-actions
Enable GitHub developers to deploy to Kubernetes service using GitHub Actions
Stars: ✭ 104 (-63.89%)
Mutual labels:  kubernetes-cluster, k8s
aws-eks-orb
An orb to simplify deployments to Amazon Elastic Container Service for Kubernetes (Amazon EKS)
Stars: ✭ 16 (-94.44%)
Mutual labels:  k8s, kubernetes-deployment
k8s-day2-ops
This repository contain scripts for Kubernetes day 2 operations
Stars: ✭ 25 (-91.32%)
Mutual labels:  kubernetes-cluster, kubernetes-deployment
Eksctl
The official CLI for Amazon EKS
Stars: ✭ 3,550 (+1132.64%)
Mutual labels:  kubernetes-cluster, kubernetes-deployment
bulletinApi
Bulletin board scalable API
Stars: ✭ 35 (-87.85%)
Mutual labels:  kubernetes-cluster, kubernetes-deployment

KubeKey

CI

English | 中文

Since v3.0.0, KubeSphere changes the ansible-based installer to the new installer called KubeKey that is developed in Go language. With KubeKey, you can install Kubernetes and KubeSphere separately or as a whole easily, efficiently and flexibly.

There are three scenarios to use KubeKey.

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

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

Motivation

  • Ansible-based installer has a bunch of software dependency such as Python. KubeKey is developed in Go language to get rid of the problem in a variety of environment so that increasing the success rate of installation.
  • KubeKey uses Kubeadm to install K8s cluster on nodes in parallel as much as possible in order to reduce installation complexity and improve efficiency. It will greatly save installation time compared to the older installer.
  • KubeKey supports for scaling cluster from allinone to multi-node cluster, even an HA cluster.
  • KubeKey aims to install cluster as an object, i.e., CaaO.

Supported Environment

Linux Distributions

  • Ubuntu 16.04, 18.04
  • Debian Buster, Stretch
  • CentOS/RHEL 7
  • SUSE Linux Enterprise Server 15

Kubernetes Versions

  • v1.15:   v1.15.12
  • v1.16:   v1.16.13
  • v1.17:   v1.17.9 (default)
  • v1.18:   v1.18.6

Looking for more supported versions Click here

Notice: KubeSphere is currently not supported running on k8s v1.19.x

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. The dependency that needs to be installed may be different based on the Kubernetes version to be installed. You can refer to the list below to see if you need to install relevant dependencies on your node in advance.

Kubernetes Version ≥ 1.18 Kubernetes Version < 1.18
socat Required Optional but recommended
conntrack Required Optional but recommended
ebtables Optional but recommended Optional but recommended
ipset Optional but recommended 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 Installer Executable File

  • Binary downloads of the KubeKey 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
    ./build.sh
    

Note:

  • Docker needs to be installed before building.
  • If you have problem to access https://proxy.golang.org/, excute build.sh -p instead.

Create a Cluster

Quick Start

Quick Start is for all-in-one installation which is a good start to get familiar with 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.

    ./kk create cluster
    
  • Create a Kubernetes cluster with a specified version (supported versions).

    ./kk create cluster --with-kubernetes v1.17.9
    
  • Create a Kubernetes cluster with KubeSphere installed (e.g. --with-kubesphere v3.0.0)

    ./kk create cluster --with-kubesphere [version]
    

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 | --file) 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
    
  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 | --file) 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 | --file) 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

💻 📖

Forest

💻 📖

rayzhou2017

💻 📖

shaowenchen

💻 📖

Zhao Xiaojie

💻 📖

Zack Zhang

💻

Akhil Mohan

💻

pengfei

📖

min zhang

💻 📖

zgldh

💻

xrjk

💻

yonghongshi

💻

Honglei

📖

liucy1983

💻

Lien

📖

Tony Wang

📖

Hongliang Wang

💻

dawn

💻

Duan Jiong

💻

calvinyv

📖

Benjamin Huo

📖

Sherlock113

📖

fu_changjie

📖

yuswift

💻

ruiyaoOps

📖

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

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].