kubernetes command summary Set

kubernetes command summary Set

  1. Turn off virtual memory

    swapoff -a
    vim /etc/fstabl
    #/dev/mapper/centos-swap swap
  2. View docker environment variables

    systemctl show --property=Environment docker
  3. Set agent cancel agent

    export http_proxy="http://127.0.0.1:8123/"
    unset http_proxy
  4. View token

    kubeadm token list
  5. Get token command in SA

    kubectl -n kube-system get secret admin-token-nwphb -o jsonpath={.data.token}|base64 -d
    kubectl -n kube-system describe secret `kubectl -n kube-system get secret|grep admin-token|cut -d " " -f1`|grep "token:"|tr -s " "|cut -d " " -f2
    
  6. Generate token

    head -c 16 /dev/urandom | od -An -t x | tr -d ' '
  7. Regenerate the token added to the node

    kubeadm token create --print-join-command
  8. View the reason for node noready

    journalctl -f -u kubelet
  9. View software version

    yum search --showduplicates  xxx
  10. Install a specific version of software

    apt-get install -y kubelet=1.11.3-00 kubeadm=1.11.3-00 kubectl=1.11.3-00
    yum  install -y kubelet-1.11.3 kubeadm-1.11.3 kubectl-1.11.3
  11. kubernetes cluster initialization

    kubeadm reset
  12. View the required images for a specific version of kubernetes

    kubeadm --kubernetes-version=1.11.0 config images list
  13. Force deletion of pod that always belongs to terminating

    kubectl delete pod $POD_ID --force --grace-period=0
  14. Deploy pod, deployment, daemonset, etc

    Kubectl create -f xxx
    kubectl apply -f xx
  15. Deploy pod, deployment, daemonset, etc

    kubectl set image deployment/nginx-deployment nginx=nginx:1.91 --record
    kubectl apply -f xx(Must pass xx Create)
  16. Tail the node

    kubectl taint nodes <node_name> <key>=<value>:NoSchedule
  17. Restore nodes from taint

    kubectl taint nodes <node_name> <key>=<value>:NoSchedule-
  18. Isolate and expel the node s

    kubectl cordon <node>
    kubectl drain <node>
  19. Restore a node from an isolated state

    kubectl uncordon <node>
  20. Add node label

    kubectl label pod redis  role=backend
  21. Delete node label

    kubectl label pod redis role-

    Summary record, continue to add!

Keywords: Linux Kubernetes kubelet Nginx Docker

Added by bobc on Sat, 07 Dec 2019 13:28:49 +0200