Giter Site home page Giter Site logo

kubeadm-ansible's Introduction

kubeadm-ansible

Overview

Create Kubernetes Cluster with Kubeadm using ansible on CentOS 8
Kubernetes is a container orchestration system that manages containers at scale.
Kubeadm automates the installation and configuration of Kubernetes components such as the API server, Controller Manager, and Kube DNS.


Prerequisite

  • Ansible master node

    • Install python3 sudo yum install python3
    • Install git sudo yum install git
    • Install ansible sudo yum install epel-release , sudo yum install ansible
    • Set Passwordless authentication between master and hosts (kuberenetes nodes) ssh-keygen , ssh-copy-id root@IP_address
    • Add inventory file has all hosts
    [masters]
    master ansible_host=node_IP  ansible_user=root
    
    [workers]
    worker1 ansible_host=node_IP ansible_user=root
    
  • Kubernetes master and worker nodes

    • in /etc/hosts add
    master_IP   master    masternode_hostname
    worker_IP   worker    workernode_hostname
    

Installation Steps

  • Allow Firewall ports

    • ports needed to be opened on master node
      image
    • ports needed to be opened on worker node
      image
      note: you can also disable Firewall service instead
  • Configure Kubernetes dependencies

    These configurations are done on both master and worker Kubernetes nodes

    • Disable SELinux service
    • Disable Swapping on
    • Install CRI-O a Container runtime
    • Install Kubeadm a CLI tool that will install and configure the various components of a cluster.
    • Install kubelet a system service that runs on all nodes and handles node-level operations.
    • Install kubectl a CLI tool used for issuing commands to the cluster through its API Server.
  • Setting Up the Master Node

    • Initialize the cluster by running kubeadm init
    • Create a .kube directory at /home/cloud. This directory will hold configuration information such as the admin key files, which are required to connect to the cluster, and the cluster’s API address.
      note: cloud is a non-root user should be added before
    • Copy the /etc/kubernetes/admin.conf file that was generated from kubeadm init to your non-root cloud user’s home directory.
    • Run kubectl apply to install Flannel.

kubeadm-ansible's People

Contributors

mariamgad avatar

Stargazers

Ahmed Nabil Sharawy avatar

Watchers

 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.