Infrastructure as Code CLI and engine that lets you define and deploy cloud resources using general-purpose programming languages.
kubernetes-sigs/kubespray
Ansible-based toolkit that deploys production-ready, highly available Kubernetes clusters on AWS, GCE, Azure, OpenStack, vSphere or bare metal.
- Stars
- 18,798
- Forks
- 6,938
- Open issues
- 188
- Last commit
- 2 days ago
What is it?
Kubespray is a set of Ansible playbooks and roles for installing and configuring a Kubernetes cluster. It targets operators who want to provision clusters on public clouds such as AWS, GCE and Azure, on private clouds like OpenStack and vSphere, or directly on bare-metal servers, and it supports a highly available control plane.
The project is composable. Users choose among several CNI network plugins, including Calico, Cilium, flannel, kube-ovn, kube-router, macvlan and Multus, and can select container runtimes and storage plugins through variables. Supported operating systems include Debian, Ubuntu, RHEL-family distributions, Fedora, openSUSE and Flatcar, and an offline installation path is available for air-gapped environments.
Kubespray can be run from a Docker image, from a local Ansible installation, or through a Vagrant setup for testing. It is maintained under Kubernetes SIG Cluster Lifecycle.
Key features
- 01Deploys highly available Kubernetes clusters on AWS, GCE, Azure, OpenStack, vSphere or bare metal.
- 02Lets you choose among several network plugins such as Calico, Cilium and flannel.
- 03Supports many Linux distributions, including Debian, Ubuntu, RHEL-family, Fedora and openSUSE.
- 04Provides an offline installation path for air-gapped environments.
- 05Includes continuous integration tests.
Use cases
- Provisioning a self-managed Kubernetes cluster on bare-metal servers.
- Standing up clusters on OpenStack or vSphere private cloud infrastructure.
- Deploying Kubernetes in air-gapped networks with a local mirror.
- Integrating cluster setup into an existing Ansible-managed infrastructure.
Quick start
- 1
Ensure Docker is installed
- 2
Start the Kubespray container with your inventory and SSH key mounted
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 - 3
Inside the container, run the cluster playbook
ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml
Things to know
- Target servers need Internet access to pull container images unless you configure an offline setup.
- The README says to disable host firewalls during deployment, since Kubespray does not manage them.
- Oracle Cloud Infrastructure support is marked experimental.
Topics
FAQ
- What is kubespray?
- Ansible-based toolkit that deploys production-ready, highly available Kubernetes clusters on AWS, GCE, Azure, OpenStack, vSphere or bare metal. Kubespray is a set of Ansible playbooks and roles for installing and configuring a Kubernetes cluster. It targets operators who want to provision clusters on public clouds such as AWS, GCE and Azure, on private clouds like OpenStack and vSphere, or directly on bare-metal servers, and it supports a highly available control plane.
- Is kubespray free to use? What license does it have?
- kubespray is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is kubespray still maintained?
- Actively maintained. The last commit to kubespray was on Oct 21, 2026.
- What can I use kubespray for?
- Provisioning a self-managed Kubernetes cluster on bare-metal servers. Standing up clusters on OpenStack or vSphere private cloud infrastructure. Deploying Kubernetes in air-gapped networks with a local mirror. Integrating cluster setup into an existing Ansible-managed infrastructure.
- How do I install kubespray?
- Ensure Docker is installed Start the Kubespray container with your inventory and SSH key mounted: 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, run the cluster playbook: ansible-playbook -i /inventory/inventory.ini --private-key /root/.ssh/id_rsa cluster.yml
- Where can I get kubespray?
- The source code and installation instructions are on GitHub: https://github.com/kubernetes-sigs/kubespray
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source PostgreSQL distribution that deploys HA clusters, point-in-time recovery, monitoring and 575 extensions on bare Linux.
A network-bootable iPXE menu that lets you boot and install many operating systems and rescue utilities without downloading ISOs first.
A Terraform provider that lets Terraform create, change and destroy AWS resources through declarative configuration.
A terminal UI for navigating, observing and managing applications across your Kubernetes clusters.
An open-source framework for defining AWS cloud infrastructure in TypeScript, Python, Java, .NET or Go and provisioning it via CloudFormation.