About Me

Wednesday, 11 January 2023

Kubernetes

                                                             Kubernetes Installation





  1.     apt update
  2.     clear
  3.     sudo apt-get install docker.io
  4.     docker --version
  5.     sudo systemctl status docker
  6.     curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add
  7.     sudo apt-get install curl
  8.     sudo apt-add-repository "deb http://apt.kubernetes.io/ kubernetes-xenial main"
  9.     sudo apt-get install kubeadm kubelet kubectl
  10.     kubeadm version
Links:

1:https://phoenixnap.com/kb/install-kubernetes-on-ubuntu
2:https://www.edureka.co/blog/install-kubernetes-on-ubuntu


=============K8-installation===============

===================K8-INSTALLATION===============

===ON MASTER===

 1  apt update
    2  clear
    3  apt full upgrade -y
    4  apt-get full upgrade -y
    5  apt-get install full upgrade -y
    6  apt -y full upgrade
    7  sudo apt full upgrade -y
    8  apt update
    9  apt -y full upgrade
   10  hostname K8-MASTER
   11  sudo su -
   12  apt update
   13  apt full-upgrade -y
   14  curl -fsSL https://test.docker.com -o test-docker.sh
   15  sudo sh test-docker.sh
   16  apt -y install curl apt-transport-https
   17  curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
   18  echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
   19  sudo apt update
   20  apt -y install kubelet kubeadm kubectl
   21  apt-mark hold kubelet kubeadm kubectl
   22  cd /etc/containerd/
   23  ls
   24  cat config.toml
   25  cd
   26  rm /etc/containerd/config.toml
   27  systemctl restart containerd
   28  kubeadm init
   29  export KUBECONFIG=/etc/kubernetes/admin.conf
   30  clear
   31  kubectl get nodes
   32  kubectl apply -f https://github.com/coreos/flannel/raw/master/Documentation/kube-flannel.yml
   33  kubectl get nodes
   34  vi pod_ex.yml
   35  kubectl create -f pod_ex.yml
   36  kubectl get nodes
   37  kubectl get pods
   38  vi pod_ex2.yml
   39  kubectl create -f  pod_ex2.yml
   40  kubectl get pods
   41  ls
   42  history
===========================ON SERVER-1===========
 1  pwd
    2  apt full upgrade -y
    3  apt full-upgrade -y
    4  curl -fsSL https://test.docker.com -o test-docker.sh
    5  sudo sh test-docker.sh
    6  apt -y install curl apt-transport-https
    7  curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
    8  echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
    9  sudo apt update
   10  apt -y install kubelet kubeadm kubectl
   11  apt-mark hold kubelet kubeadm kubectl
   12  rm /etc/containerd/config.toml
   13  systemctl restart containerd
   14  clear
   15  kubeadm join 172.31.50.34:6443 --token 85tnw6.sdhj2us92qqtmiyd         --discovery-token-ca-cert-hash sha256:f10a4b7e8a91039d02dab57e544230962769e66943be6ac2c5cd4a1579cf153b
   16  history
========================ON SERVER-2=================
1  apt update
    2  clear
    3  apt full-upgrade -y
    4  curl -fsSL https://test.docker.com -o test-docker.sh
    5  sudo sh test-docker.sh
    6  apt -y install curl apt-transport-https
    7  curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
    8  echo "deb https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
    9  sudo apt update
   10  apt -y install kubelet kubeadm kubectl
   11  apt-mark hold kubelet kubeadm kubectl
   12  rm /etc/containerd/config.toml
   13  systemctl restart containerd
   14  clear
   15  kubeadm join 172.31.50.34:6443 --token 85tnw6.sdhj2us92qqtmiyd         --discovery-token-ca-cert-hash sha256:f10a4b7e8a91039d02dab57e544230962769e66943be6ac2c5cd4a1579cf153b
   16  history



Kubernetes deployment strategies



No comments:

Post a Comment

youtube devops topics

What is LDAP and Active Directory? How LDAP works and the structure of LDAP/AD? https://youtu.be/Xp9kLn9vRmw