Code Monkey home page Code Monkey logo

kubernetes's Introduction

Kubernetes Cluster Setup Scripts

  • This repository contains master and worker node scripts for both Debian and Red-Hat based distributions.
  • The Scripts were tested on (CentOS - Fedora - Debian - Ubuntu) in both Virtual and Cloud VM.
  • The Provided Scripts are used to deploy a basic Development Cluster.

Requirements:

  • 2 Linux Machines (You can use one incase you only need master node)
  • At least 2 CPU on the machine used for the master node
  • 2 GB or more of RAM per machine (any less will leave little room for your apps).
  • yum Package manager for Red-Hat Distributions | apt Package manager for Debian Distributions
  • sudo access for all machines

Automated Setup using Curl

  • You can use start.sh Script to setup both the Master and Worker Node using the following commands
  • Run curl -O https://raw.githubusercontent.com/iYasser95/kubernetes/main/start.sh
  • Run . start.sh
  • You will be promted to enter either 1 to start the Master Node setup or 2 to start the Worker Node setup
  • The Linux Distribution will be detected and the correct Script for it will Run.

Automated Setup using Clone

  • You can use start.sh Script to setup both the Master and Worker Node using the following commands
  • Run git clone https://github.com/iYasser95/kubernetes.git
  • Run cd kubernetes
  • Run . start.sh
  • You will be promted to enter either 1 to start the Master Node setup or 2 to start the Worker Node setup
  • The Linux Distribution will be detected and the correct Script for it will Run.

Master Node Setup:

Red Hat-based distributions Setup
  • In the Master Node Machine run the following commands to start the setup of the Node.
  • Run curl -O https://raw.githubusercontent.com/iYasser95/kubernetes/main/redhat-master.sh
  • Run . redhat-master.sh
Debian-based distributions Setup
  • In the Master Node Machine run the following commands to start the setup of the Node.
  • Run curl -O https://raw.githubusercontent.com/iYasser95/kubernetes/main/debian-master.sh
  • Run . debian-master.sh
After the Master Node setup:

Run the following command after the script is finished to be able to use kubectl commands

  • source ~/.bashrc

Worker Node Setup:

Red Hat-based distributions Setup
  • In the Worker Node Machine run the following commands to start the setup of the Node.
  • Run curl -O https://raw.githubusercontent.com/iYasser95/kubernetes/main/redhat-worker.sh
  • Run . redhat-worker.sh
  • Worker Nodes Name must be unique, you'll be asked to enter the name once the script starts
Debian-based distributions Setup
  • In the Worker Node Machine run the following commands to start the setup of the Node.
  • Run curl -O https://raw.githubusercontent.com/iYasser95/kubernetes/main/debian-worker.sh
  • Run . debian-worker.sh
  • Worker Nodes Name must be unique, you'll be asked to enter the name once the script starts
After the Worker Node setup:

Run the following command on the Master Node to get the command to join the Worker node to the Master:

  • sudo kubeadm token create --print-join-command

Exceptions

If you get connection error while running kubectl commands then make sure the following commands were run correctly:
  • echo 'export KUBECONFIG=/etc/kubernetes/admin.conf' >> ~/.bashrc
  • source ~/.bashrc
If the Node is showing status NotReady then make sure the Networking pods were installed correctly using the following command:
  • kubectl get pod -nkube-flannel
  • If the pods were not installed then run the following command:
  • kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml

Resources:

License

MIT

kubernetes's People

Contributors

iyasser95 avatar abdullayusuf3 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.