Skip to content

aerOS-Project/cluster_script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

Kubernetes Cluster Installation Script

This script automates the setup of a Kubernetes cluster without the default kube-proxy, using Cilium (eBPF) instead, and includes configurations for Kubeadm, Containerd, Helm, OpenEBS (optional), and Prometheus (optional) monitoring.

Getting Started / Use

To utilize this script:

  1. Ensure your machine meets the prerequisites: Ubuntu or similar Linux distribution, with root or sudo privileges.

  2. Make the script executable.

  3. Run the script with root privileges:

    chmod +x cluster_script.sh
    sudo ./cluster_script.sh
  4. Follow the interactive prompts to choose between AGENT or SERVER installation and input necessary details.

How to Build, Install, or Deploy It

SERVER Installation

Requires input for:

  • Cluster Name: Name of the Kubernetes cluster. (essential for cilium clustermesh)
  • Cluster ID: Numeric identifier for the cluster. (essential for cilium clustermesh)
  • Pod Subnet (Pod CIDR): Subnet for pod networking.
  • Service Subnet (Service IP): Subnet for service networking.

Sets up a Kubernetes master node. After installation, execute the following commands to configure kubectl for use without sudo privileges:

mkdir -p $HOME/.kube
sudo cp /etc/kubernetes/admin.conf $HOME/.kube/config
sudo chown $(id -u):$(id -g) $HOME/.kube/config

At the end of the SERVER installation, a token is generated and saved in the join_worker.sh file. This token is used to join worker nodes to the cluster at the end of the AGENT installation.

AGENT Installation

Prepares a Kubernetes worker node. Use the token generated in the join_worker.sh file from the SERVER installation to join the cluster.

Script Structure

Functions

  1. install_pre(): Installs system prerequisites.
  2. install_docker(): Installs Docker.
  3. containerd_systemd_service(): Configures containerd.
  4. install_kubeadm(): Installs kubeadm.
  5. init_kubeadm(): Initializes kubeadm without kube-proxy.
  6. kube_config_dir(): Sets up Kubernetes config directory.
  7. install_helm(): Installs Helm.
  8. untaint_control_plane_node(): Untaints control plane node.
  9. install_k8s_storageclass(): Installs OpenEBS storage class (optional).
  10. install_cilium(): Installs Cilium CNI.
  11. install_hubble(): Installs Hubble.
  12. install_prometheus(): Installs Prometheus (optional).
  13. is_valid_cidr(): Validates CIDR format.

Further Information

For more detailed information about each component and their role in Kubernetes, refer to the official documentation of Kubernetes, Helm, Cilium, OpenEBS, and Prometheus.

Credits

This initial script, as developed within Assist-IoT project, was provided by Rafael Vaño Garcia (UPV). Updates, enhancements and adaptations to aerOS needs were made by Vasilis Pitsilis and Andreas Sakellaropoulos.

For any inquiries or issues related to this script, please contact Andreas Sakellaropoulos at [email protected].

License

This script is released under the Apache 2.0 License. See the LICENSE file for more details.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages