QT-DevOps / DevOpsIssues

This Repo will be used to demonstrate the Skills & Questions in DevOps
Apache License 2.0
27 stars 131 forks source link

issue while installing the kubernetes #1035

Open raj868-dev opened 3 years ago

raj868-dev commented 3 years ago

HI while installing the kubeadm in aws ubuntu 18.04 ec2 instance, i am facing this issues

MicrosoftTeams-image (2)

image

i used the below steps to install the kubeadm

sudo su -

Install Required packages and apt keys.

apt-get update -y apt-get install -y apt-transport-https curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - cat </etc/apt/sources.list.d/kubernetes.list deb https://apt.kubernetes.io/ kubernetes-xenial main EOF apt-get update -y

Turn Off Swap Space

swapoff -a sed -i '/ swap / s/^(.*)$/#\1/g' /etc/fstab

Install And Enable Docker

apt install docker.io -y usermod -aG docker ubuntu systemctl restart docker systemctl enable docker.service

Install kubeadm, Kubelet And Kubectl

apt-get install -y kubelet kubeadm kubectl kubernetes-cni

Enable and start kubelet service

systemctl daemon-reload systemctl start kubelet systemctl enable kubelet.service

===========In Master Node Start====================

Steps Only For Kubernetes Master

Switch to the root user.

sudo su -

Initialize Kubernates master by executing below commond.

kubeadm init

sivasankardevops commented 2 years ago

@raj868-dev follow these steps : 1.kubeadm reset

  1. add this content to this file ----> vi /etc/docker/daemon.json { "exec-opts": ["native.cgroupdriver=systemd"] }
  2. sudo systemctl daemon-reload
  3. sudo systemctl restart docker 5.sudo systemctl restart kubelet