Kubernetes Command Summary set
Kubernetes Command Summary set
Turn off virtual memory
Swapoff-avim / etc/fstabl#/dev/mapper/centos-swap swap
View docker environment variabl
Systemctl show-property=Environment docker
Set up agent to cancel agent
Export http_proxy= "http://127.0.0.1:8123/"unset http_proxy
View token
Kubeadm token list
Get the token command in SA
Kubectl-n kube-system get secret admin-token-nwphb-o jsonpath= {.data.token} | base64-dkubectl-n kube-system describe secret `data.token} | grep admin-token | cut-d ""-f1` | grep "token:" | tr-s "" | cut-d ""-f2
Generate token
Head-c 16 / dev/urandom | od-An-t x | tr-d''
Regenerate token that joins node
Kubeadm token create-print-join-command
View node noready reason
Journalctl-f-u kubelet
View the software version
Yum search-showduplicates xxx
Install a specific version of the software
Apt-get install-y kubelet=1.11.3-00 kubeadm=1.11.3-00 kubectl=1.11.3-00yum install-y kubelet-1.11.3 kubeadm-1.11.3 kubectl-1.11.3
Kubernetes cluster initialization
Kubeadm reset
View the images required for a specific version of kubernetes
Kubeadm-kubernetes-version=1.11.0 config images list
Force deletion of pod that has always belonged to terminating
Kubectl delete pod $POD_ID-force-grace-period=0
Deploy pod,deployment,daemonset, etc.
Kubectl create-f xxxkubectl apply-f xx
Deploy pod,deployment,daemonset, etc.
Kubectl set image deployment/nginx-deployment nginx=nginx:1.91-- recordkubectl apply-f xx (must be created through xx)
Taint the node
Kubectl taint nodes =: NoSchedule
Restore the node from the taint
Kubectl taint nodes =: NoSchedule-
Quarantine node | expel
Kubectl cordon kubectl drain
Restore node from quarantined state
Kubectl uncordon
Add node tags
Kubectl label pod redis role=backend
Delete node tags
Kubectl label pod redis role-
Summary of the record, continue to add!