Pod
kube-proxy 异常导致节点上的 Pod 无法访问 Service
· ☕ 3 分钟
1. 问题描述 相关 Pod 1 2 3 4 5 6 kubectl -n istio-system get pod -o wide NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES istiod-647c7c9d95-7n7n6 1/1 Running 0 77m 10.244.173.51 docs-ai-a800-4 <none> <none> istiod-647c7c9d95-k6l88 1/1 Running 0 30m 10.244.210.160 ai-a40-2 <none> <none> istiod-647c7c9d95-pj82r 1/1 Running 0 51m 10.244.229.217 docs-ai-a800-2 <none> <none> 相关 Service 1 2 3 4 kubectl -n istio-system get svc NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE istiod ClusterIP 10.99.225.56 <none> 15010/TCP,15012/TCP,443/TCP,15014/TCP 645d 1 2 3 4 kubectl -n istio-system get endpoints NAME ENDPOINTS AGE istiod 10.244.173.51:15012,10.244.210.160:15012,10.244.229.217:15012 + 9 more... 645d Endpoints 与 Pod 的 IP 是一致的。 测试结果 在异常节点

kubectl logs 无法查看 Pod 日志报错 NotFound
· ☕ 1 分钟
1. 现象 能查看 Pod 的信息 1 2 3 4 kubectl -n my-testns get pod my-testpod NAME READY STATUS RESTARTS AGE my-testpod 1/1 Running 0 2d13h 不能查看 Pod 的日志 1 2 3 kubectl -n my-testns logs my-testpod -f Error from server (NotFound): the server could not find the requested resource ( pods/log my-testpod) 在 Pod 所在主机上可以通过 docker logs 查看容器日志。 测试 Kubelet 的健康状态 OK 1 curl -k https://x.x.x.x:10250/healthz 这里要使用主机的 IP 地址,kubectl logs 命名会直接

使用 Calico 限制 Pod 的带宽
· ☕ 3 分钟
1. 测试全部带宽 在目标主机上启动 iperf3 服务端 1 2 3 4 5 iperf3 -s ----------------------------------------------------------- Server listening on 5201 ----------------------------------------------------------- 在客户端主机上测试 1 iperf3 -c x.x.x.x -p 5201 -t 10 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 Connecting to host x.x.x.x, port 5201 [ ID] Interval Transfer Bitrate Retr Cwnd [ 5] 0.00-1.00 sec 151 MBytes 1.27 Gbits/sec 3562 164 KBytes [ 5] 1.00-2.00 sec 134 MBytes 1.12 Gbits/sec 230 164 KBytes [ 5] 2.00-3.00 sec 124 MBytes 1.04 Gbits/sec 250 213 KBytes [ 5] 3.00-4.00 sec 122 MBytes 1.03 Gbits/sec 229

源码分析 Kubernetes 对 Pod IP 的管理
· ☕ 9 分钟
1. kube-controller-manager 对网段的管理 在 kube-controller-manager 有众多控制器,与 Pod IP 相关的是 NodeIpamController。 NodeIpamController 控制器主要是管理节点的 podcidr,当有新节点加入集群时,分配一个子网段给节点;当节点删除时,回收子网段。 每个节点的子网段不会重叠,每个节点都能够独立

如何给 Kubernetes 应用设置 HPA 以及相关参数
· ☕ 7 分钟
1. 业务背景 当企业达到一定规模时,完全依赖于公有云基础设施,IT 成本会很高。 采购物理机器的成本可以摊薄到未来 3~5 年,之后机器并不会报废,而是会继续超期服役。私有云需要配比一定运维人员、购买专线带宽、机房费用等,IT 服务达到一定规模才能有效降低成