How kubernetes-sigs/kubespray works
Kubespray is an Ansible-based system for provisioning and operating production Kubernetes clusters across cloud and bare-metal environments. The principal workflow starts with an operator’s inventory and the cluster.yml playbook, then prepares hosts and installs Kubernetes, its container runtime, etcd, and a selected network plugin; optional cluster applications and storage integrations extend the result. The graph also includes documented operations and sampled inventory, certificate, and component-hash utilities. Several role-to-role deployment links are described only at the product level in the README, so unsampled internal call relationships are not asserted.
Main entry points: cluster.yml Cluster playbook · inventory Ansible inventory · control-plane Control plane · k8s-certs-renew.py Certificate renewal
Components 22
Cluster deployment
- Ansible inventory
inventory - Cluster playbook
cluster.yml
Host and Kubernetes
- OS bootstrap
roles/bootstrap_os - Host preparation
roles/kubernetes/preinstall - Container engines
roles/container-engine - etcd
roles/etcd - Kubernetes setup
roles/kubernetes/kubeadm - Control plane
roles/kubernetes/control-plane - Kubernetes nodes
roles/kubernetes/node
Cluster extensions
- Network plugins
roles/network_plugin - Cluster applications
roles/kubernetes-apps - Storage integrations
roles/kubernetes-apps/csi_driver
Cluster operations
- Cluster upgrades
roles/upgrade - Node operations
roles/remove_node - Control-plane recovery
roles/recover_control_plane - Certificate renewal
roles/kubernetes/control-plane/files/k8s-certs-renew.py
Inventory and utilities
- Terraform inventory
contrib/terraform/terraform.py - AWS inventory
contrib/aws_inventory/kubespray-aws-inventory.py - Kubernetes module
plugins/modules/kube.py - Hash updater
scripts/component_hash_update/src/component_hash_update/download.py - Component metadata
scripts/component_hash_update/src/component_hash_update/components.py
Other components
- Cluster operator
Connections 21
- Cluster operator → Ansible inventory: provides hosts
README.md - Cluster operator → Cluster playbook: runs playbook
README.md - Ansible inventory → Cluster playbook: selects hosts
README.md - Cluster playbook → OS bootstrap: provisions hosts
- Cluster playbook → Host preparation: prepares hosts
- Cluster playbook → Container engines: sets up runtime
- Cluster playbook → etcd: deploys etcd
- Cluster playbook → Kubernetes setup: installs Kubernetes
- Cluster playbook → Control plane: configures control plane
- Cluster playbook → Kubernetes nodes: configures nodes
- Cluster playbook → Network plugins: selects network
README.md - Cluster playbook → Cluster applications: deploys applications
- Cluster playbook → Storage integrations: enables storage
- Cluster operator → Cluster upgrades: runs upgrades
README.md - Cluster operator → Node operations: manages nodes
README.md - Cluster operator → Control-plane recovery: recovers cluster
- Terraform inventory → Ansible inventory: generates host data
- AWS inventory → Ansible inventory: generates host data
- Kubernetes module → Cluster operator: manages resources
- Certificate renewal → Control plane: renews certificates
roles/kubernetes/control-plane/files/k8s-certs-renew.py - Hash updater → Component metadata: reads metadata
scripts/component_hash_update/src/component_hash_update/download.py