|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
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 如何调用 DeepSeek 的自然语言处理 API 接口并集成到在线客服系统
· 【译】Visual Studio 中新的强大生产力特性
· 2025年我用 Compose 写了一个 Todo App