1. 程式人生 > 其它 >|NO.Z.00016|——————————|^^ 標準 ^^|——|KuberNetes&標準.V15|---------------------------------------------------------|常用操作.V01|操作命令|

|NO.Z.00016|——————————|^^ 標準 ^^|——|KuberNetes&標準.V15|---------------------------------------------------------|常用操作.V01|操作命令|



[CloudNative:KuberNetes&書籤.V15]                                                                      [Applications.KuberNetes] [|DevOps|kubernetes|k8s.二進位制1.20|網路規劃|常用操作|]








一、常用操作
### --- 網路規劃

~~~     10.96.0.0/12                                //  k8s Service網段
~~~     172.16.0.0/12                               //  k8s Pod網段
~~~     centos7.x 10.10.10.11    192,168.1.11       //  master01    2C2G 40G
~~~     centos7.x 10.10.10.12    192,168.1.12       //  master02    2C2G 40G
~~~     centos7.x 10.10.10.13    192,168.1.13       //  master03    2C2G 40G
~~~     centos7.x 10.10.10.20    192.168.1.20       //  VIP                 
~~~     centos7.x 10.10.10.14    192,168.1.14       //  node01      2C2G 40G
~~~     centos7.x 10.10.10.15    192,168.1.15       //  node02      2C2G 40G
二、常用操作引數
### --- 常用操作引數

~~~     # 時間同步服務:
[root@k8s-master01 ~]# ntpdate time2.aliyun.com
 
~~~     # 切換到1.20x分支:
[root@k8s-master01 ~]# cd k8s-ha-install && git checkout manual-installation-v1.20.x
~~~     # 檢視etcd狀態:
[root@k8s-master01 ~]# etcdctl --endpoints="192.168.1.13:2379,192.168.1.12:2379,192.168.1.11:2379" --cacert=/etc/kubernetes/pki/etcd/etcd-ca.pem --cert=/etc/kubernetes/pki/etcd/etcd.pem --key=/etc/kubernetes/pki/etcd/etcd-key.pem  endpoint status --write-out=table

~~~     # vip測試: ping 
[root@k8s-master01 ~]# 192.168.1.20 -t 4
~~~     # telnet測試: 
[root@k8s-master01 ~]# telnet 192.168.1.20 8443
 
~~~     # 系統日誌檢視:
[root@k8s-master01 ~]# cat /var/log/messages        
[root@k8s-master01 ~]# tail -f /var/log/messages 
~~~     # 檢視叢集狀態:
[root@k8s-master01 ~]# kubectl get node

~~~     # 檢視容器狀態:
[root@k8s-master01 ~]# kubectl  get po -n kube-system
~~~     # 檢視CoreDNS:
[root@k8s-master01 ~]# kubectl get po -n kube-system -l k8s-app=kube-dns

~~~     # 檢視metrics server:
[root@k8s-master01 ~]# kubectl get po -n kube-system
~~~     # 檢視node:
[root@k8s-master01 ~]# kubectl top node      
[root@k8s-master01 ~]# kubectl top po -A
 
~~~     # 檢視埠號:
[root@k8s-master01 ~]# kubectl get svc kubernetes-dashboard -n kubernetes-dashboard
~~~     # Dashboard地址:https://192.168.1.20:30008(請更改30008為自己的埠)

~~~     https://192.168.1.20:30008








===============================END===============================


Walter Savage Landor:strove with none,for none was worth my strife.Nature I loved and, next to Nature, Art:I warm'd both hands before the fire of life.It sinks, and I am ready to depart                                                                                                                                                    ——W.S.Landor



來自為知筆記(Wiz)