|NO.Z.00016|——————————|^^ 标准 ^^|——|KuberNetes&标准.V15|——|常用操作.V01|操作命令|

一、常用操作
### --- 网络规划

~~~     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

 
 
 
 
 
 
 
 
 

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

 

 

posted on   yanqi_vip  阅读(10)  评论(0编辑  收藏  举报

相关博文:
阅读排行:
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App
< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

导航

统计

点击右上角即可分享
微信分享提示