標籤(空格分隔): kubernetes系列node
- 一: kubernetes 的命令介紹
- 二: kubernetes 的 生命週期管理
- 三: kubernetes 的遠程鏈接處理
kubectl get all
kubectl get all -o wide
kubectl get all -o wide -n kube-system
kubectl get pods,svc,nodes -o wide -n kube-system --all-namespaces
kubectl 部署一個nginx 一、建立 kubectl run nginx --replicas=3 --image=nginx:1.14 --port=80 kubectl get deploy,pods 二、發佈 kubectl expose deployment nginx --port=80 --type=NodePort --target-port=80 --name=nginx-service kubectl get service 三、更新 kubectl set image deployment/nginx nginx=nginx:1.15 四、回滾 kubectl rollout history deployment/nginx kubectl rollout undo deployment/nginx kubectl rollout undo deployment/nginx --to-revision=1 五、刪除 kubectl delete deploy/nginx kubectl delete svc/nginx-service
login:192.168.100.11 master 節點 cd /opt/kubernetes/ssl vim config.sh ---- kubectl config set-cluster kubernetes \ --certificate-authority=ca.pem \ --embed-certs=true \ --server=https://192.168.100.11:6443 \ --kubeconfig=config kubectl config set-credentials cluster-admin \ --certificate-authority=ca.pem \ --embed-certs=true \ --client-key=admin-key.pem \ --client-certificate=admin.pem \ --kubeconfig=config kubectl config set-context default --cluster=kubernetes --user=cluster-admin --kubeconfig=config kubectl config use-context default --kubeconfig=config ---- ./config.sh 生成config 文件 scp config root@192.168.100.13:/root
login : 192.168.100.13 node 節點 kubectl --kubeconfig=./config get pods
mv config /root/.kube/ kubectl get node