This script automates the setup process for a Kubernetes cluster on Ubuntu 20.04 LTS, One Master and one Node. It covers the installation of necessary dependencies, kernel settings, and components such as containerd, kubeadm, kubelet, and kubectl.
1. 🐧 Ubuntu 20.04 LTS
2. 🌐 Internet connection
3. ❌ Disable swap
Download the install.sh
script from this repository.
wget https://raw.githubusercontent.com/anouarharrou/K8s-Cluster-Setup-Script-Ubuntu/main/install-k8s.sh
Add the following the /etc/hosts file and save it.
vi /etc/hosts 📁
..
..
10.0.0.2 master-node
10.0.0.3 worker-node1
Grant execute permissions to the script.
chmod +x install-k8s.sh
Execute the script with root or sudo privileges. 😎
sudo ./install-k8s.sh
Checks for existing Kubernetes clusters to prevent accidental reinstallation.
Verifies the presence of Docker or containerd.io before installation.
Automates the setup of hostnames, kernel settings, and CNI prerequisites.
Installs and configures containerd runtime.
Installs kubeadm, kubelet, and kubectl.
Initializes the Kubernetes cluster on the master node.
Deploys Calico network for pod networking.
Provides instructions for adding worker nodes to the cluster.
Verifies the cluster status and displays relevant information.
Kubernetes Architecture
You will find some useful commands line on the folder :
cmd/workingwithyourcluster.sh
cmd/deployingapplications.sh
👋 I'm a State Engineer in Information Technology and Communication Networks, currently serving as a DevOps Engineer at Société Générale Africa Business Services (SGABS). I'm passionate about automating and streamlining deployment processes for infrastructure and applications, and I'm excited to share my journey and ongoing projects with you.
🌱 Currently, I'm deeply engaged in a comprehensive pipeline project designed to automate and facilitate the deployment of both infrastructure and applications. Leveraging a combination of Ansible, Jenkins, and Terraform, our team is crafting a robust system to streamline and expedite the deployment processes within our company. This initiative aims to enhance efficiency and scalability while reducing manual intervention in the deployment lifecycle.
Previously, one of my significant endeavors involved crafting solutions to automate the creation and configuration of a Kubernetes cluster within the Promise environment. This project, set within an environment lacking an internet connection (For security measure, the environment can't get acces to the internet), posed unique challenges that I successfully navigated, further refining my skills in automation and orchestration.
I've also been actively involved in developing Ansible playbooks that automate the setup and configuration of diverse servers and packages within our infrastructure, harnessing the capabilities of the ManageIQ platform. This hands-on experience has bolstered my expertise in infrastructure automation and orchestration.
💡 I am continually driven by a thirst for learning and a passion for enhancing my expertise across various technological domains. Thriving in dynamic environments, I actively seek opportunities to contribute to innovative projects. If you have any collaboration ideas or opportunities aligned with my interests, I'm eager to explore and engage.
- 🌐 Ubuntu Server
- 🐧 CentOS 7
This project is licensed under the GNU AFFERO GENERAL PUBLIC LICENSE - see the LICENSE file for details.
- Inspired by the need for a quick and automated setup of Kubernetes Cluster.
Note: Always ensure your system meets the specified requirements in terms of memory, storage, and CPU before running the script on a production environment. 🚀
Contributions are welcome! If you encounter issues or have suggestions for improvements, please open an issue or submit a pull request.