Giter Site home page Giter Site logo

k8s's Introduction

Kubernetes :- The Production grade container orchestration Engine

Info about Kubernetes

Kubernetes in the most powerfull container orchestration engine
Its free for everyone

Developement info

  • Developed by Google and CNCF
  • 7 June 2014 is the Release date
  • written in Go lang

Kubernetes multinode setup

we have 4 machines; 1 master and 3 worker nodes

Pre-requisite

Disable selinux in all the nodes

  [root@master ~]# setenforce  0
  [root@master ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/'  /etc/selinux/config
  

Enable the kernel bridge for every system

[root@master ~]# modprobe br_netfilter
[root@master ~]# echo '1' > /proc/sys/net/bridge/bridge-nf-call-iptables

Disable the swap

[root@master ~]# swapoff  -a

Installing docker and kubeadm in all the nodes

[root@master ~]# yum  install  docker kubeadm  -y

if kubeadm is not present in your repo

you can browse this link kubernetes repo

yum can be configured by running this command

cat  <<EOF  >/etc/yum.repos.d/kube.repo
[kube]
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
gpgcheck=0
EOF

You may have to change docker cgroup driver from overlay to Systemd (since kubernetes 1.20)

cat  <<X  >/etc/docker/daemon.json
{
  "exec-opts": ["native.cgroupdriver=systemd"]
}

X

Start service of docker & kubelet in all the nodes

[root@master ~]# systemctl enable --now  docker kubelet

Do this only on Kubernetes Master

We are here using Calico Networking, so we need to pass some parameter you can start Kubernetes_networking from this

[root@master ~]# kubeadm  init --pod-network-cidr=192.168.0.0/16

this is optional

In case of cloud services like aws, azure if want to bind public with certificate of kubernetes

[root@master ~]# kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=0.0.0.0   --apiserver-cert-extra-sans=publicip,privateip,serviceip

Note: IF you want to bind your controlplane with public IP also

[root@master ~]# kubeadm init --pod-network-cidr=192.168.0.0/16 --apiserver-advertise-address=0.0.0.0   --apiserver-cert-extra-sans=publicip,privateip,serviceip  --control-plane-endpoint=publicIP

Use the output of above command and paste it to all the worker nodes

Do this step in master node

[root@master ~]# mkdir -p $HOME/.kube
[root@master ~]#  cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
[root@master ~]# chown $(id -u):$(id -g) $HOME/.kube/config

Now apply calico project

kubectl apply -f https://docs.projectcalico.org/v3.8/manifests/calico.yaml

Or Download 3.16 latest version as now october 2020

wget https://docs.projectcalico.org/manifests/calico.yaml
kubectl apply -f calico.yaml

INstalling calico in minikube cluster..

minikube start --network-plugin=cni --cni=calico

ADding new node in minikube

  minikube node add

After this all nodes will be in ready state

Now you can check nodes status

[root@master ~]# kubectl get nodes
NAME                 STATUS   ROLES    AGE     VERSION
master.example.com   Ready    master   11m     v1.12.2
node1.example.com    Ready    <none>   9m51s   v1.12.2
node2.example.com    Ready    <none>   9m25s   v1.12.2
node3.example.com    Ready    <none>   9m3s    v1.12.2

Good luck guys !!

k8s's People

Contributors

jagz-git avatar redashu 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.