Coder Social home page Coder Social logo

k8s-cluster-minhaj's Introduction

k8s-cluster-minhaj

Docker installation

curl -fsSL https://get.docker.com -o install-docker.sh sh install-docker.sh sudo usermod -aG docker ubuntu

#crio dockerd installation wget https://github.com/Mirantis/cri-dockerd/releases/download/v0.3.4/cri-dockerd_0.3.4.3-0.ubuntu-jammy_amd64.deb sudo dpkg -i cri-dockerd_0.3.4.3-0.ubuntu-jammy_amd64.deb #k8s installation sudo apt-get update -y sudo apt-get install -y apt-transport-https ca-certificates curl curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | sudo gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | sudo tee /etc/apt/sources.list.d/kubernetes.list sudo apt-get update -y sudo apt-get install -y kubelet kubeadm kubectl sudo apt-mark hold kubelet kubeadm kubectl

use the command 

kubeadm init --pod-network-cidr "10.244.0.0/16" --cri-socket "unix:///var/run/cri-dockerd.sock"

Copy the token generated after finishing the above command like the below.

kubeadm join 172.31.40.28:6443 --token cmihte.9e1vqpq57uxkluri
--discovery-token-ca-cert-hash sha256:8ec1ac56aff113650ac613d06b31e21514555fbfb38e671b2f88897ce14deef5

Switch to normal user if you running as root user and execute below commands:

mkdir -p $HOME/.kube sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config sudo chown $(id -u):$(id -g) $HOME/.kube/config

kubectl get nodes => will not be ready kubectl apply -f https://github.com/flannel-io/flannel/releases/latest/download/kube-flannel.yml kubectl get nodes => will be ready

##################### To do on Worker Node 1 #######################

Run the command in the worker node  (copy the token generated above) + --crio-socket ...

kubeadm join 172.31.40.28:6443 --token cmihte.9e1vqpq57uxkluri
--discovery-token-ca-cert-hash sha256:8ec1ac56aff113650ac613d06b31e21514555fbfb38e671b2f88897ce14deef5 --cri-socket "unix:///var/run/cri-dockerd.sock" ######### ignore the below ######## " kubeadm join 172.31.46.162:6443 --token onuurh.ajdjohao4og0fuvg \ --discovery-token-ca-cert-hash sha256:48ef0a455dab45986f74141f2267e77558ad8d3cd7f678ea8d12bf8c741d2f2a --cri-socket "unix:///var/run/cri-dockerd.sock" " ######### ignore till here ######## • Comment above in bold is from execution of a command and needs to be copied from the output of the command below is the output: To start using your cluster, you need to run the following as a regular user:

	  mkdir -p $HOME/.kube
	  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
	  sudo chown $(id -u):$(id -g) $HOME/.kube/config
	
	Alternatively, if you are the root user, you can run:
	
	  export KUBECONFIG=/etc/kubernetes/admin.conf
	
	You should now deploy a pod network to the cluster.
	
	Run "kubectl apply -f [podnetwork].yaml" with one of the options listed at:
	
	  https://kubernetes.io/docs/concepts/cluster-administration/addons/
	
	Then you can join any number of worker nodes by running the following on each as root:
	
	kubeadm join 192.168.0.50:6443 --token yx74ts.rwkejehzjndk66hm \

--discovery-token-ca-cert-hash sha256:0a6bcb009d6ac6507e679cb08c86d4b5232cabafbc0f52b056361b7926db12d7

k8s-cluster-minhaj's People

Contributors

mateenzero 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.