一、常用操作
### --- 网络规划
~~~ 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