How to configure a #kubernetes cluster with #kubeadm

preview_player
Показать описание
In this step-by-step tutorial, learn how to create and configure a three node kubernetes cluster with kubeadm. In this video, I'm using three AWS EC2 instances running Ubuntu 18.04.

📚 𝗖𝗛𝗔𝗣𝗧𝗘𝗥𝗦

00:00 Kubeadm Introduction
01:24 Kubeadm Setup Prerequisites
02:32 Setup Overview
03:15 Kubeadm Workflow
05:17 Kubeadm Cluster Setup
12:08 Install Kubernetes Metrics Server
13:48 Deploy Nginx Application
14:47 Configure Kubeconfig File in Workstation

DEMO STEPS
--------------------------

Step 1: Pre-requisites

1.a.. Check the OS, Hardware Configurations & Network connectivity
1.b.. Turn off the swap & firewall

$ sudo swapoff -a
$ sudo systemctl stop firewalld
$ sudo systemctl disable firewalld

Step 2. Configure the local IP tables to see the Bridged Traffic

2.a.. Enable the bridged traffic
$ lsmod | grep br_netfilter
$ sudo modprobe br_netfilter

Content:
br_netfilter

Content:

$ sudo sysctl --system

Step 3. Install Docker as a Container RUNTIME

3.a.. Uninstall any Older versions

$ sudo yum remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-engine

3.b.. Install Yum Utilities | Config Manager

$ sudo yum install -y yum-utils

3.c.. Setup the Docker Repository

3.d.. Install Docker Engine, Docker CLI, Docker RUNTIME

Step 4. Configure Docker Daemon for cgroups management & Start Docker

4.a.. Create directory
$ sudo mkdir /etc/docker

Content:
{
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2"
}

$ sudo systemctl daemon-reload
$ sudo systemctl restart docker
$ sudo systemctl enable docker
$ sudo systemctl status docker

Step 5. Install kubeadm, kubectl, kubelet

Content:

[kubernetes]
name=Kubernetes
enabled=1
gpgcheck=1
repo_gpgcheck=1
exclude=kubelet kubeadm kubectl

5.b.. Set SELinux in permissive mode (effectively disabling it)

$ sudo setenforce 0
$ sudo sed -i 's/^SELINUX=enforcing$/SELINUX=permissive/' /etc/selinux/config
$ sudo yum install -y kubelet kubeadm kubectl --disableexcludes=kubernetes
$ sudo systemctl enable --now kubelet

Step 6. Configuring a cgroup driver

Ignore if docker is used as a CRI

Step 7. Deploy a kubernetes cluster using kubeadm

# Run only in Master node

$ kubeadm init --pod-network-cidr=10.10.0.0/16 --apiserver-advertise-address=master_nodeIP

To start using your cluster, you need to run the following as a regular user:

mkdir -p $HOME/.kube
sudo chown $(id -u):$(id -g) $HOME/.kube/config

Alternatively, if you are the root user, you can run:

You should now deploy a pod network to the cluster.
Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:

Then you can join any number of worker nodes by running the following on each as root:

kubeadm join 192.168.74.10:6443 --token l431j0.0tz0bbuu7hj64lw5 \
--discovery-token-ca-cert-hash sha256:1743115f18a7b8761105ff5465cd1aeed74a2e8a3f326405da61681d07fdb0e0

Step 8. Install CNI for POD Networking

# Run only in Master node

Weave Networks:

Step 9. Join the worker nodes to the master

# Run in Worker Nodes as "Root"

kubeadm join 192.168.74.10:6443 --token l431j0.0tz0bbuu7hj64lw5 \
--discovery-token-ca-cert-hash sha256:1743115f18a7b8761105ff5465cd1aeed74a2e8a3f326405da61681d07fdb0e0

# Make sure to replace your tokens and IP's in the above command accordingly

Step 10. Access the K8s Cluster & Deploy a POD

kubectl run vsparkz --image nginx

We're so excited to announce that the our 2 bestseller courses on udemy i.e., OpenStack and NFV (TelcoCloud) and Kubernetes in NFV (TelcoCloud) is out now!!!

Use Coupon code to get 81% discount - CLOUDGURU

Note: This coupon will be valid for a month. If you want a new coupon code contact us on YouTube or in Facebook.

#kubernetes #k8s #aws
Рекомендации по теме
Комментарии
Автор

💥CloudWays COUPON CODE: CLOUDGURU25
☝☝ USE THE EXCLUSIVE COUPON CODE ABOVE TO GET 25% OFF FOR 3 MONTHS💥

CloudGurus