[Kubernetes (K8S) kubeplay] Use kubeplay to deploy a Production Ready Kubernetes Cluster based on kubespray
kubeplay
kubeplay is a tool for offline deployment of kuberneres clusters based on kubespray.
Feature
-
All dependencies included, installing offline with one single command
-
amd64 and arm64 CPU architectures supported
-
Validity of certificate generated by kubeadm extended to 10 years
-
No docker dependency, seamless migrating container runtime to containerd
-
Ideal for toB privatized deployment scenarios as all rpm/deb packages (e.g. storage client) needed by bootstraping cluster can be installed offline
-
Multi-cluster deployment supported, deploying a new kubernetes cluster with Job Pods within kubernetes cluster
-
Offline installer built with GitHub Actions, no charge, 100% open source 100% free
compose
Running nginx and registry with nerdctl - https://github.com/containerd/nerdctl compose on deploy node where deployment tool would run, which provide offline resource download and image distribution services.
kubespray
Using kubespray - https://github.com/kubernetes-sigs/kubespray which come from kubernetes community as a cluster deployment executor, needed resources during deployment will fetched from compose node.
How to deploy
Download
You can download the package matching your platform from the releases page k8sli/kubeplay/releases - https://github.com/k8sli/kubeplay/releases on GitHub, then copy it to deploy node.
1 | kubeplay-v0.1.0-alpha.3-centos-7.sha256sum.txt # checksum file |
Configuration
1 | tar -xpf kubeplay-x.y.z-xxx-xxx.tar.gz |
The config.yaml
configuration file is divided into the following sections:
-
compose:config for nginx and registry on current deploy node
-
kubespray:kubespray deployment config
-
invenory:ssh config for nodes of kubernetes cluster
-
default:default config values
compose
1 | compose: |
kubespray
1 | kubespray: |
inventory
inventory is the ssh login configuration for nodes of kubernetes cluster , supporting yaml, json, and ini formats.
yaml format
1 | # Cluster nodes inventory info |
default value
The following default parameters are not recommended to be modified without special requirements, just leave them as default. Unmodified ntp_server value will be overrided by internal_ip from compose section; registry_ip and offline_resources_url are automatically generated based on the parameters in compose section thus not need to modify.
1 | default: |
Usages
Deploy a new cluster
1 | bash install.sh |
Add node to existing cluster
1 | bash install.sh add-node $NODE_NAMES |
Delete node from cluster
1 | bash install.sh remove-node $NODE_NAME |
Remove cluster
1 | bash install.sh remove-cluster |
Remove all components
1 | bash install.sh remove |
FAQs
msg: ‘Failed to download metadata for repo ‘‘docker-ce’’: Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried’
1 | yum update |
Copy offline centos/8 resources to resolve it.
1 | wget -c https://github.com/k8sli/kubeplay/releases/download/v0.1.0-alpha.3/kubeplay-v0.1.0-alpha.3-centos-7-amd64.tar.gz |
References
[1] k8sli/kubeplay: Deploy kubernetes by kubespray in offline - https://github.com/k8sli/kubeplay
[2] Deploy a Production Ready Kubernetes Cluster | Readme - https://kubespray.io/
[3] Ansible is Simple IT Automation - https://www.ansible.com/