1  swapoff -a
    2  sudo swapoff -a
    3  sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
    4  sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
    5  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    6  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
    7  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    8  sudo apt-get update -y
    9  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
   10  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   11  sudo apt-get install     ca-certificates     curl     gnupg     lsb-release
   12  sudo mkdir -p /etc/apt/keyrings
   13  curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
   14  echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
   15    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   16  sudo apt-get update -y
   17  sudo apt-get install docker-ce docker-ce-cli containerd.io -y
   18  cat <<EOF | sudo tee /etc/docker/daemon.json
   19  {
   20  "exec-opts": ["native.cgroupdriver=systemd"],
   21  "log-driver": "json-file",
   22  "log-opts": {
   23  "max-size": "100m"
   24  },
   25  "storage-driver": "overlay2"
   26  }
   27  EOF
   28  sudo systemctl enable docker
   29  sudo systemctl restart docker
   30  sudo systemctl status docker
   31  sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
   32  echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
   33  sudo apt-get update
   34  sudo apt-get install -y kubelet kubeadm kubectl
   35  apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y  
   36  sudo apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y  
   37  sudo apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00
   38  sudo kubeadm init --pod-network-cidr 10.0.0.0/16
   39  mkdir -p $HOME/.kube
   40  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
   41  sudo chown $(id -u):$(id -g) $HOME/.kube/config
   42  kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
   43  history
   44  kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
   45  kubectl cluster-info
   46  sudo kubectl get nodes
   47  sudo kubectl get pods --all-namespaces
   48  kubeadm  version
   49  docker ps | grep kube-apiserver
   50  sudo docker ps | grep kube-apiserver
   51  mkdir -p $HOME/.kube
   52  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
   53  sudo chown $(id -u):$(id -g) $HOME/.kube/config
   54  sudo kubectl get nodes
   55  kubectl config view
   56  cat ~/.kube/config 
   57  sudo kubeadm init --pod-network-cidr=10.0.0.0/16
   58  sudo kubectl get nodes
   59  kubeadm  version
   60  clear
   61  kubeadm  version
   62  gcloud container clusters get-credentials 
   63  gcloud container clusters list
   64  kubectl version
   65  kubectl cluster-info
   66  kubeadm token create --print-join-command
   67  sudo kubectl get pod
   68  sudo kubectl get nodes
   69  kubectl create secret generic mysql-root-pass --from-literal=password=Pakistan123
   70  kubectl create secret generic mysql-user-pass --from-literal=username=Evaluation --from-literal=password=Pakistan123
   71  kubectl create secret generic mysql-db-url --from-literal-database=EvaluationTest
   72  kubectl create secret generic mysql-db-url --from-literal=database=EvaluationTest
   73  kubectl get secret
   74  sudo vim /tmp/mysql.yaml
   75  apt-mark unhold kubeadm && apt-get update && apt-get install -y kubeadm=1.21.x-00 && apt-mark hold kubeadm
   76  -
   77  sudo apt-mark unhold kubeadm && apt-get update && apt-get install -y kubeadm=1.21.x-00 && apt-mark hold kubeadm
   78  -
   79  sudo apt-mark unhold kubeadm && sudo apt-get update && apt-get install -y kubeadm=1.21.x-00 && sudo apt-mark hold kubeadm
   80  sudo apt-mark unhold kubeadm
   81  sudo apt-get update
   82  apt-get install kubeadm=1.21.x-00
   83  sudo apt-get install kubeadm=1.21.x-00
   84  sudo apt-get install kubeadm=1.21
   85  sudo apt-get update
   86  sudo apt-get install --allow-change-held-packages kubeadm=1.21
   87  kubeadm version
   88  kubeadm upgrade plan --allow-release-candidate-upgrades
   89  sudo kubeadm upgrade plan --allow-release-candidate-upgrades
   90  sudo kubeadm upgrade plan --allow-experimental-upgrades
   91  sudo apt update
   92  sudo apt-cache madison kubeadm
   93  sudo apt update
   94  sudo apt install kubeadm=1.21.0-00 kubectl=1.21.0-00 kubelet=1.21.0-00  
   95  kubeadm version
   96  gsutils ls
   97  sudo gsutils ls
   98  nano mysql-secret.yaml
   99  kubectl apply -f mysql-secret.yaml
  100  nano mysql-storage.yaml
  101  ssh gs://storage-lab-console731
  102  gsutils ls gs://storage-lab-console731
  103  sudo gsutils ls gs://storage-lab-console731
  104  sudo gsutils ls
  105  cat mysql-secret.yaml 
  106  kubectl apply -f mysql-secret.yaml 
  107  nano mysql-storage.yaml 
  108  kubectl apply -f mysql-storage.yaml 
  109  nano mysql-deployment.yaml
  110  kubectl apply -f mysql-deployment.yaml 
  111  nano mysql-deployment.yaml
  112  kubectl apply -f mysql-deployment.yaml 
  113  kubectl get pod
  114  kubectl exec --stdin --tty mysql-694d95668d-j7qlp  -- /binbash
  115  kubectl exec --stdin --tty mysql-694d95668d-j7qlp  -- /bin/bash
  116  kubectl get deploy
  117  kubectl get svc
  118  nano mysql-deployment.yaml
  119  kubectl delete mysql
  120  kubectl delete deploy mysql
  121  kubectl apply -f mysql-deployment.yaml 
  122  kubeadm service -all
  123  kubeadm -h
  124* nano 
  125  hostname -I
  126  nano mysql-deployment.yaml
  127  ping 34.173.242.39
  128  curl 34.173.242.39:30008
  129  cat mysql-deployment.yaml 
  130  ls
  131  nano mysql-deployment.yaml 
  132  cat mysql-deployment.yaml 
  133  ls
  134  cat mysql-secret.yaml 
  135  cat mysql-storage.yaml 
  136  history
usert5780@instance-1:~$ history > history_master_node.txt
usert5780@instance-1:~$ cat history_master_node.txt 
    1  swapoff -a
    2  sudo swapoff -a
    3  sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
    4  sudo apt-get install -y apt-transport-https ca-certificates curl gnupg lsb-release
    5  curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
    6  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
    7  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
    8  sudo apt-get update -y
    9  echo   "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
   10  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   11  sudo apt-get install     ca-certificates     curl     gnupg     lsb-release
   12  sudo mkdir -p /etc/apt/keyrings
   13  curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
   14  echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
   15    $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
   16  sudo apt-get update -y
   17  sudo apt-get install docker-ce docker-ce-cli containerd.io -y
   18  cat <<EOF | sudo tee /etc/docker/daemon.json
   19  {
   20  "exec-opts": ["native.cgroupdriver=systemd"],
   21  "log-driver": "json-file",
   22  "log-opts": {
   23  "max-size": "100m"
   24  },
   25  "storage-driver": "overlay2"
   26  }
   27  EOF
   28  sudo systemctl enable docker
   29  sudo systemctl restart docker
   30  sudo systemctl status docker
   31  sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://packages.cloud.google.com/apt/doc/apt-key.gpg
   32  echo "deb [signed-by=/usr/share/keyrings/kubernetes-archive-keyring.gpg] https://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee /etc/apt/sources.list.d/kubernetes.list
   33  sudo apt-get update
   34  sudo apt-get install -y kubelet kubeadm kubectl
   35  apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y  
   36  sudo apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00 -y  
   37  sudo apt install kubeadm=1.20.0-00 kubectl=1.20.0-00 kubelet=1.20.0-00
   38  sudo kubeadm init --pod-network-cidr 10.0.0.0/16
   39  mkdir -p $HOME/.kube
   40  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
   41  sudo chown $(id -u):$(id -g) $HOME/.kube/config
   42  kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
   43  history
   44  kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"
   45  kubectl cluster-info
   46  sudo kubectl get nodes
   47  sudo kubectl get pods --all-namespaces
   48  kubeadm  version
   49  docker ps | grep kube-apiserver
   50  sudo docker ps | grep kube-apiserver
   51  mkdir -p $HOME/.kube
   52  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
   53  sudo chown $(id -u):$(id -g) $HOME/.kube/config
   54  sudo kubectl get nodes
   55  kubectl config view
   56  cat ~/.kube/config 
   57  sudo kubeadm init --pod-network-cidr=10.0.0.0/16
   58  sudo kubectl get nodes
   59  kubeadm  version
   60  clear
   61  kubeadm  version
   62  gcloud container clusters get-credentials 
   63  gcloud container clusters list
   64  kubectl version
   65  kubectl cluster-info
   66  kubeadm token create --print-join-command
   67  sudo kubectl get pod
   68  sudo kubectl get nodes
   69  kubectl create secret generic mysql-root-pass --from-literal=password=Pakistan123
   70  kubectl create secret generic mysql-user-pass --from-literal=username=Evaluation --from-literal=password=Pakistan123
   71  kubectl create secret generic mysql-db-url --from-literal-database=EvaluationTest
   72  kubectl create secret generic mysql-db-url --from-literal=database=EvaluationTest
   73  kubectl get secret
   74  sudo vim /tmp/mysql.yaml
   75  apt-mark unhold kubeadm && apt-get update && apt-get install -y kubeadm=1.21.x-00 && apt-mark hold kubeadm
   76  -
   77  sudo apt-mark unhold kubeadm && apt-get update && apt-get install -y kubeadm=1.21.x-00 && apt-mark hold kubeadm
   78  -
   79  sudo apt-mark unhold kubeadm && sudo apt-get update && apt-get install -y kubeadm=1.21.x-00 && sudo apt-mark hold kubeadm
   80  sudo apt-mark unhold kubeadm
   81  sudo apt-get update
   82  apt-get install kubeadm=1.21.x-00
   83  sudo apt-get install kubeadm=1.21.x-00
   84  sudo apt-get install kubeadm=1.21
   85  sudo apt-get update
   86  sudo apt-get install --allow-change-held-packages kubeadm=1.21
   87  kubeadm version
   88  kubeadm upgrade plan --allow-release-candidate-upgrades
   89  sudo kubeadm upgrade plan --allow-release-candidate-upgrades
   90  sudo kubeadm upgrade plan --allow-experimental-upgrades
   91  sudo apt update
   92  sudo apt-cache madison kubeadm
   93  sudo apt update
   94  sudo apt install kubeadm=1.21.0-00 kubectl=1.21.0-00 kubelet=1.21.0-00  
   95  kubeadm version
   96  gsutils ls
   97  sudo gsutils ls
   98  nano mysql-secret.yaml
   99  kubectl apply -f mysql-secret.yaml
  100  nano mysql-storage.yaml
  101  ssh gs://storage-lab-console731
  102  gsutils ls gs://storage-lab-console731
  103  sudo gsutils ls gs://storage-lab-console731
  104  sudo gsutils ls
  105  cat mysql-secret.yaml 
  106  kubectl apply -f mysql-secret.yaml 
  107  nano mysql-storage.yaml 
  108  kubectl apply -f mysql-storage.yaml 
  109  nano mysql-deployment.yaml
  110  kubectl apply -f mysql-deployment.yaml 
  111  nano mysql-deployment.yaml
  112  kubectl apply -f mysql-deployment.yaml 
  113  kubectl get pod
  114  kubectl exec --stdin --tty mysql-694d95668d-j7qlp  -- /binbash
  115  kubectl exec --stdin --tty mysql-694d95668d-j7qlp  -- /bin/bash
  116  kubectl get deploy
  117  kubectl get svc
  118  nano mysql-deployment.yaml
  119  kubectl delete mysql
  120  kubectl delete deploy mysql
  121  kubectl apply -f mysql-deployment.yaml 
  122  kubeadm service -all
  123  kubeadm -h
  124* nano 
  125  hostname -I
  126  nano mysql-deployment.yaml
  127  ping 34.173.242.39
  128  curl 34.173.242.39:30008
  129  cat mysql-deployment.yaml 
  130  ls
  131  nano mysql-deployment.yaml 
  132  cat mysql-deployment.yaml 
  133  ls
  134  cat mysql-secret.yaml 
  135* cat mysql-storage.yaml -master