kubespray README

The project's README from github.com/kubernetes-sigs/kubespray. As one markdown file: README.md.

Deploy a Production Ready Kubernetes Cluster

Kubernetes Logo

If you have questions, check the documentation at kubespray.io and join us on the kubernetes slack, channel #kubespray. You can get your invite here

Quick Start

Below are several ways to use Kubespray to deploy a Kubernetes cluster.

Docker

Ensure you have installed Docker then

docker run --rm -it --mount type=bind,source="$(pwd)"/inventory/sample,dst=/inventory \
  --mount type=bind,source="${HOME}"/.ssh/id_rsa,dst=/root/.ssh/id_rsa \
  quay.io/kubespray/kubespray:v2.31.0 bash
# Inside the container you may now run the kubespray playbooks:
ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml

Ansible

Usage

See Getting started

Collection

See here if you wish to use this repository as an Ansible collection

Vagrant

For Vagrant we need to install Python dependencies for provisioning tasks. Check that Python and pip are installed:

python -V && pip -V

If this returns the version of the software, you're good to go. If not, download and install Python from here https://www.python.org/downloads/source/

Install Ansible according to Ansible installation guide then run the following step:

vagrant up

Documents

Supported Linux Distributions

Note:

Supported Components

Container Runtime Notes

Requirements

Hardware: These limits are safeguarded by Kubespray. Actual requirements for your workload can differ. For a sizing guide go to the Building Large Clusters guide.

Network Plugins

You can choose among ten network plugins. (default: calico, except Vagrant uses flannel)

The network plugin to use is defined by the variable kube_network_plugin. There is also an option to leverage built-in cloud provider networking instead. See also Network checker.

Ingress Plugins

Community docs and resources

Tools and projects on top of Kubespray

CI Tests

Build graphs

CI/end-to-end tests sponsored by: CNCF, Equinix Metal, OVHcloud, ELASTX.

See the test matrix for details.

kubespray (kubernetes-sigs/kubespray)

Searching Database…

18.8K ·GitHub
这是什么?Kubespray 是一套 Ansible playbooks,可以在云上的虚拟机或你自己的裸金属服务器上部署一个可用于生产环境、具备高可用性的 Kubernetes 集群。
那它是一个需要安装的工具,还是别的东西?它不是一个安装型的应用,而是一个存放 Ansible playbooks 和 inventory 的仓库,针对你的服务器来运行。这个仓库也可以作为 Ansible collection 来使用。
我怎样让第一个集群跑起来?可以在 Docker 容器里运行 playbooks,在一台装好 Ansible 的机器上运行,或者用 Vagrant 起一个本地测试集群。Getting started 指南会带你完成第一次部署。
运行部署的机器需要什么条件?控制机需要 Ansible v2.14+、Jinja 2.11+ 和 python-netaddr。目标服务器需要一个受支持的 Linux 发行版,除非你配置离线模式,否则还需要能访问互联网来拉取镜像。
有哪些可能导致部署失败的坑?Kubespray 不管理防火墙——你应该把防火墙关掉,以免部署出问题。非 root 运行需要加 --become 标志,不支持 Upstart/SysV 系统,低于 4.19 的内核需要额外注意。
集群可以部署在哪里?集群可以部署到 AWS、GCE、Azure、OpenStack、vSphere、Equinix Metal、Oracle Cloud(实验性),或者普通的裸金属服务器。
它部署的是哪些版本和组件?Kubernetes 1.36.4,搭配 etcd 3.6.14,运行时可选:containerd、Docker 或 CRI-O(实验性)。随附的组件包括 CoreDNS、cert-manager、Argo CD、Helm 和 MetalLB,还有 CSI 存储插件。
节点需要多少硬件配置?最低要求不高:控制平面节点 2 GB 内存,工作节点 1 GB。实际配置取决于你的工作负载——另有一份大规模部署指南可参考。
我能在没有互联网的环境下部署集群吗?可以,有一份专门的 Air-Gap(离线)安装指南。默认情况下目标服务器需要能访问互联网来拉取镜像,所以离线使用需要额外配置。
哪些 Linux 发行版可以作为集群节点?Ubuntu 22.04-26.04、Debian Bookworm/Trixie、RHEL 和 CentOS Stream 9-10、Fedora 39-42、Flatcar、Fedora CoreOS、openSUSE、Oracle、Alma 和 Rocky Linux,另外还有几个标记为实验性的发行版。
Size
29.1 MB
Stars
18.8K
Age
11y
Commits · 90 Days