Node1_master


fahussain@node-1:~$ history
    1  sudo usermod -aG sudo fahussain
    2  groups fahussain
    3  sudo cat <<EOF | sudo tee /etc/modules-load.d/containerd.conf 
    4  overlay 
    5  br_netfilter 
    6  EOF
    7  sudo modprobe overlay 
    8  sudo modprobe br_netfilter
    9  cat <<EOF | sudo tee /etc/sysctl.d/99-kubernetes-cri.conf net.bridge.bridge-nf-call-iptables = 1 
   10  net.ipv4.ip_forward = 1 
   11  net.bridge.bridge-nf-call-ip6tables = 1 
   12  EOF
   13  sudo sysctl --system
   14  sudo apt-get update && sudo apt-get install -y containerd
   15  sudo mkdir -p /etc/containerd
   16  sudo containerd config default | sudo tee /etc/containerd/config.toml
   17  sudo systemctl restart containerd
   18  sudo swapoff -a
   19  sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
   20  sudo apt-get update && sudo apt-get install -y apt-transport-https curl
   21  curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
   22  cat <<EOF | sudo tee /etc/apt/sources.list.d/kubernetes.list
   23  deb https://apt.kubernetes.io/ kubernetes-xenial main
   24  EOF
   25  sudo apt-get update
   26  sudo apt-get install -y kubelet=1.20.1-00 kubeadm=1.20.1-00 kubectl=1.20.1-00
   27  sudo apt-mark hold kubelet kubeadm kubectl
   28  sudo kubeadm init --pod-network-cidr 192.168.0.0/16
   29  mkdir -p $HOME/.kube
   30  sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config
   31  sudo chown $(id -u):$(id -g) $HOME/.kube/config
   32  kubectl get pods
   33  kubectl version
   34  kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml
   35  kubectl get pods -n kube-system
   36  kubeadm token create --print-join-command
   37  kubectl get nodes
   38  kubectl version
   39  kubectl get nodes
   40  apt update
   41  sudo apt update
   42  apt-cache madison kubeadm
   43  apt-mark unhold kubeadm && apt-get update && apt-get install -y kubeadm=1.21.x-00 && apt-mark hold kubeadm
   44  sudo apt-mark unhold kubeadm && sudo apt-get update && sudoapt-get install -y kubeadm=1.21.x-00 && sudo apt-mark hold kubeadm
   45  -sudo apt-get install -y kubeadm=1.21.x-00 && sudo apt-mark hold kubeadm
   46  sudo apt-get install -y kubeadm=1.21.x-00 && sudo apt-mark hold kubeadm
   47  -sudo apt-get install -y kubeadm=1.21.0
   48  sudo apt-get install -y kubeadm=1.21.0
   49  sudo apt-get install -y kubeadm=1.21.0-00
   50  kubectl get nodes
   51  kubeadm version
   52  kubeadm upgrade plan
   53  sudo apt-mark unhold kubeadm && sudo apt-get update && sudo apt-get install -y kubeadm=1.21.0-00 && sudo apt-mark hold kubeadm
   54  kubeadm upgrade plan
   55  sudo kubeadm upgrade apply v1.21.x
   56  sudo kubeadm upgrade apply v1.21.0
   57  kubectl get nodes
   58  kubectl apply -f https://docs.projectcalico.org/archive/v3.19/manifests/calico.yaml
   59  export CONTROL_PLANE="srv31"
   60  kubectl drain ${CONTROL_PLANE} --ignore-daemonsets
   61  kubectl get nodes
   62  export CONTROL_PLANE="node-1"
   63  kubectl drain ${CONTROL_PLANE} --ignore-daemonsets
   64  sudo yum install -y kubelet-1.21.1-0 kubectl-1.21.1-0 --disableexcludes=kubernetes
   65  sudo apt install -y kubelet-1.21.1-0 kubectl-1.21.1-0 --disableexcludes=kubernetes
   66  sudo apt install -y kubelet-1.21.1-0 kubectl-1.21.1-0
   67  sudo apt-mark unhold kubelet kubectl && sudo apt-get update && sudo apt-get install -y kubelet=1.21.0-00 kubectl=1.21.0-00 && sudo apt-mark hold kubelet kubectl
   68  sudo systemctl daemon-reload
   69  sudo systemctl restart kubelet
   70  kubectl get nodes
   71  kubectl uncordon node-1
   72  sudo apt-mark unhold kubeadm && sudo apt-get update && sudo apt-get install -y kubeadm=1.21.0-00 && \
   73  kubectl drain node-2 --ignore-daemonsets
   74  kubectl uncordon node-2
   75  kubectl drain node-3 --ignore-daemonsets
   76  kubectl get nodes
   77  kubectl uncordon node-3
   78  kubectl get nodes
   79  kubectl get namespaces
   80  kubectl create namespace mysql-namespace
   81  kubectl get namespaces
   82  ls
   83  vim mysql-secret.yaml
   84  kubectl apply -f mysql-secret.yaml
   85  vim mysql-storage.yaml
   86  kubectl apply -f mysql-storage.yaml
   87  vim mysql-deployment.yaml
   88  kubectl apply -f mysql-deployment.yaml --namespace=mysql-namespace
   89  kubectl get pod
   90  kubectl get all -n mysql-namespace
   91  kubectl describe pod mysql-69 -n mysql-namespace
   92  kubectl get all -n mysql-namespace
   93  kubectl describe pod mysql-69 -n mysql-namespace
   94  kubectl apply -f mysql-secret.yaml --namespace=mysql-namespace
   95  kubectl apply -f mysql-storage.yaml --namespace=mysql-namespace
   96  kubectl get all -n mysql-namespace
   97  kubectl delete deployment deployment.apps/mysql --namespace=mysql-namespace
   98  kubectl delete deployment mysql
   99  kubectl delete deployment mysql --namespace=mysql-namespace
  100  kubectl get all -n mysql-namespace
  101  kubectl apply -f mysql-deployment.yaml --namespace=mysql-namespace
  102  kubectl get all -n mysql-namespace
  103  kubectl describe pod mysql-69 -n mysql-namespace
  104  kubectl get all -n mysql-namespace
  105  kubectl describe pod mysql-69 -n mysql-namespace
  106  kubectl exec --stin --ty mysql-69 -- /bin/bash
  107  kubectl exec --stdin --tty mysql-69 -- /bin/bash
  108  kubectl get all -n mysql-namespace
  109  kubectl exec --stdin --tty mysql-694d95668d-rxtfm -- /bin/bash
  110  kubectl exec --stdin --tty mysql-694d95668d-rxtfm -- /bin/bash --namespace=mysql-namespace
  111  kubectl get namespaces
  112  kubectl get all -n mysql-namespace
  113  kubectl describe pod mysql-69 -n mysql-namespace
  114  kubectl get nodes
  115  kubectl get nodes -o wide
  116  kubectl get pv
  117  kubectl get pvc
  118  ls
  119  vim mysql-deployment.yaml 
  120  kubectl get all -n mysql-namespace
  121  kubectl logs pod/mysql-694d95668d-rxtfm
  122  kubectl logs pod/mysql-694d95668d-rxtfm -n mysql-namespace
  123  kubectl describe pod/mysql-694d95668d-rxtfm -n mysql-namespace
  124  kubectl get pvc -n mysql-namespace
  125  kubectl get pvc
  126  kubectl delete pvc mysql-pv-claim
  127  kubectl get pvc -n mysql-namespace
  128  kubectl delete pvc mysql-pv-claim -n mysql-namespace
  129  kubectl get pvc -n mysql-namespace
  130  kubectl get pvc
  131  kubectl delete deployment deployment.apps/mysql --namespace=mysql-namespace
  132  kubectl delete deployment mysql --namespace=mysql-namespace
  133  kubectl apply -f mysql-storage.yaml --namespace=mysql-namespace
  134  kubectl get pvc -n mysql-namespace
  135  kubectl get pvc
  136  kubectl get pvc -n mysql-namespace
  137  kubectl get all -n mysql-namespace
  138  kubectl delete service mysql -n mysql-namespace
  139  kubectl get pvc -n mysql-namespace
  140  kubectl delete pvc  mysql-pv-claim -n mysql-namespace
  141  reboot
  142  reload
  143  sudo reboot
  144  ls
  145  kubectl apply -f mysql-secret.yaml --namespace=mysql-namespace
  146  kubectl get nodes
  147  kubectl get namespaces
  148  kubectl apply -f mysql-secret.yaml --namespace=mysql-namespace
  149  kubectl apply -f mysql-storage.yaml --namespace=mysql-namespace
  150  kubectl apply -f mysql-deployment.yaml --namespace=mysql-namespace
  151  kubectl get all -n mysql-namespace
  152  kubectl get pvc -n mysql-namespace
  153  kubectl describe pvc -n mysql-namespace
  154  ls
  155  vim mysql-storage.yaml 
  156  kubectl get pvc -n mysql-namespace
  157  kubectl delete pvc  mysql-pv-claim -n mysql-namespace
  158  kubectl get pv -n mysql-namespace
  159  kubectl delete pv  mysql-pv-volume -n mysql-namespace
  160  kubectl get pv -n mysql-namespace
  161  kubectl get pv 
  162  kubectl get pvc
  163  kubectl get pv
  164  kubectl get pv -n mysql-namespace
  165  kubectl get pvc -n mysql-namespace
  166  kubectl apply -f mysql-storage.yaml --namespace=mysql-namespace
  167  kubectl get pvc -n mysql-namespace
  168  kubectl apply -f mysql-deployment.yaml --namespace=mysql-namespace
  169  kubectl get all -n mysql-namespace
  170  ip a
  171  kubectl patch svc mysql -p '{"spec":{"externalIPs":["34.72.141.228"]}}'
  172  kubectl get svc -n mysql-namespace
  173  kubectl patch svc mysql -p '{"spec":{"externalIPs":["34.72.141.228"]}}' -n mysql-namespace
  174  kubectl get svc -n mysql-namespace
  175  kubectl get all -n mysql-namespace
  176  kubectl exec --stdin --tty mysql-694d95668d-vbf75 -- /bin/bash -n mysql-namespace
  177  kubectl exec --stdin --tty mysql-694d95668d-vbf75 -n mysql-namespace -- /bin/bash
  178  kubectl get all -n mysql-namespace
  179  ls
  180  cat mysql-secret.yaml 
  181  telnet
  182  telnet 127.0.0.1 3306
  183  netstat -nlp
  184  sudo apt install net-tools
  185  netstat -nlp
  186  netstat -nlp | grep 3306
  187  sudo netstat -nlp | grep 3306
  188  kubectl get svc -n mysql-namespace
  189  ls
  190  vim mysql-deployment.yaml 
  191  kubectl delete deployment mysql --namespace=mysql-namespace
  192  kubectl apply -f mysql-deployment.yaml --namespace=mysql-namespace
  193  kubectl get all -n mysql-namespace
  194  kubectl get svc -n mysql-namespace
  195  kubectl delete svc mysql -n mysql-namespace
  196  kubectl get svc -n mysql-namespace
  197  kubectl patch svc mysql-svc -p '{"spec":{"externalIPs":["34.72.141.228"]}}'
  198  kubectl patch svc mysql-svc -p -n mysql-namespace '{"spec":{"externalIPs":["34.72.141.228"]}}'
  199  kubectl get all -n mysql-namespace
  200  kubectl patch svc mysql-svc -n mysql-namespace -p '{"spec":{"externalIPs":["34.72.141.228"]}}'
  201  kubectl get all -n mysql-namespace
  202  ip a
  203  ls
  204  vim mysql-deployment.yaml 
  205  netstat -tulpn 
  206  netstat -tulpn | grep 31000
  207  kubectl get all -n mysql-namespace
  208  systemctl status ufw
  209  systemctl disable ufw
  210  sudo systemctl stop ufw
  211  sudo systemctl disable ufw
  212  telnet 0.0.0.0 31000
  213  kubectl get all -n mysql-namespace
  214  kubectl describe mysql-svc -n mysql-namespace
  215  kubectl describe svc mysql-svc -n mysql-namespace
  216  netstat -nlp | grep 31000
  217  ls
  218  vim mysql-deployment.yaml 
  219  kubectl get all -n mysql-namespace
  220  kubectl exec --stdin --tty mysql-694d95668d-pt7jq -n mysql-namespace -- /bin/bash
  221  kubectl get all -n mysql-namespace
  222  kubectl get pvc
  223  kubectl get pvc -n mysql-namespace
  224  kubectl get pv -n mysql-namespace
  225  kubectl get nodes
  226  history