Answers for "install k8s worker"

0

install k8s worker

#!/bin/bash
#the script install basic k8s ..in worket withot script master

 echo "install k8s worker on ubuntu"
#Add host entry for master as well as worker node

sudo chmod -R 777 /etc/hosts   #for lince file   
sudo echo "100.0.0.1 master.jhooq.com master" >> /etc/hosts
sudo echo "100.0.0.2 worker.jhooq.com worker" >> /etc/hosts
sudo chmod 644 /etc/hosts

#Step 3 - Install Docker on both master and worker node
sudo apt-get update -y

#install docker
sudo apt install docker.io -y
sudo systemctl enable docker.service
sudo systemctl start  docker

#Step 4 - Disable the firewall and turnoff the “swapping”
sudo ufw disable
sudo swapoff -a

#Step 5 - Install “apt-transport-https” package
sudo apt-get update && sudo apt-get install -y apt-transport-http

#Step 6 - Download the public keys
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -

#Step 7 - Add kubernetes repo
sudo bash -c 'echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" > /etc/apt/sources.list.d/kubernetes.list'


#Step 8 - Install kubernetes
sudo apt-get update && sudo apt-get install -y kubelet kubeadm kubectl

#Step 9 - Enable and Start kubelet
sudo systemctl enable kubelet
sudo systemctl start kubelet

#the end file meto
sudo echo "this completed thx meto"
Posted by: Guest on October-07-2021

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language