Modernizing. Streamlining. Deploying.
K8-Simplified is a lightweight, automated bash utility designed to bootstrap a production-ready Kubernetes cluster on RHEL/CentOS-based systems (CentOS, RHEL, Amazon Linux) with minimal manual intervention.
- Automated Preparation: Automatically handles swap disabling, kernel module loading (
overlay,br_netfilter), andsysctlnetwork configuration. - Optimized Container Runtime: Installs and configures Containerd or Docker (via
cri-dockerd). Includes specialized registry mirrors to bypass rate limits. - Dual Role Support: Single script for both Master (Control Plane) and Worker node initialization.
- Modular Architecture: Clean separation of concerns with specialized modules for environment prep, runtime config, and package management.
- Network Ready: Integrated configuration for Calico CNI (v3.27.3) for instant cross-node communication.
- Latest Stable Version: Configured for Kubernetes v1.29.
graph TD
Main[ks_installer.sh] --> Common[scripts/common.sh]
Main --> Env[scripts/env_prep.sh]
Main --> Runtime[scripts/runtime.sh]
Main --> K8s[scripts/k8s_install.sh]
K8s --> Role{Role Setup}
Role -- Master --> MasterSetup[scripts/master_setup.sh]
Role -- Worker --> WorkerSetup[scripts/worker_setup.sh]
subgraph "Infrastructure Prep"
Env
Runtime
end
subgraph "Kubernetes Core"
K8s
MasterSetup
WorkerSetup
end
style Main fill:black,stroke:#333,stroke-width:4px
style Role fill:black,stroke:#333,stroke-dasharray: 5 5
The project has been modularized for better maintainability:
k8-simplified/
├── ks_installer.sh # Main entry point (orchestrator)
├── banner.png # Project banner
├── scripts/ # Modular component scripts
│ ├── common.sh # Shared utilities and configuration
│ ├── env_prep.sh # System prep (swap, kernel, sysctl)
│ ├── runtime.sh # Containerd installation & config
│ ├── k8s_install.sh # Kubernetes repos & packages
│ ├── master_setup.sh # Master-specific initialization
│ └── worker_setup.sh # Worker-specific join logic
└── README.md # This documentation
- OS: RHEL, CentOS 7/8, or Amazon Linux 2/2023.
- Privileges: Root or
sudoaccess is required. - Resources:
- Master: 2 vCPUs, 2GB RAM minimum.
- Worker: 1 vCPU, 1GB RAM minimum.
- Network: Internet access to pull images and packages.
Clone this repository and ensure the installer is executable:
git clone <your-repo-url>
cd k8-simplified
chmod +x ks_installer.shRun the following command on the node intended to be the control plane:
# Default (containerd)
sudo ./ks_installer.sh master
# Specify Docker
sudo ./ks_installer.sh master <MASTER_IP> dockerOnce complete, the script will output a kubeadm join command. Copy this command for the next step.
Run the following command on each worker node:
# Default (containerd)
sudo ./ks_installer.sh worker <MASTER-IP>
# Example: sudo ./ks_installer.sh worker 192.168.1.10
# Specify Docker
sudo ./ks_installer.sh worker <MASTER-IP> docker
# Example: sudo ./ks_installer.sh worker 192.168.1.10 dockerWhen prompted, paste the kubeadm join command generated by the Master node.
Example of what you'll paste:
kubeadm join 192.168.1.10:6443 --token abcdef.1234567890abcdef \
--discovery-token-ca-cert-hash sha256:7c22...After setting up all nodes, run this on the Master node to verify the cluster status:
kubectl get nodesYou should see all your nodes listed with a status of Ready.
- Kubernetes: v1.29
- CNI: Calico v3.27.3
- Runtimes: Containerd, Docker (with cri-dockerd shim)
Whether you choose Containerd or Docker, the script automatically configures a mirror for registry.k8s.io to avoid ImagePullBackOff issues caused by public registry rate limits.
This project is licensed under the MIT License - see the LICENSE file for details.
