Kubernetes
给 Node Exporter 添加抓取凭证
· ☕ 1 分钟
1. 背景 Node Exporter 是 Prometheus 生态系统中用于收集主机指标的常用组件,但默认情况下不提供访问认证。本文介绍如何为 Kubernetes 环境中的 Node Exporter 添加基本认证,提高安全性。 2. Node Exporter 配置凭证 2.1 生成加密密码 使用 htpasswd 工具生成加密密码: 1 htpasswd -nBC 12 "" | tr -d ':\n' 这里需要输入密码,生成的输出将是一个

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 是一致的。 测试结果 在异常节点

容器化部署 DeepSeek 3FS 存储系统
· ☕ 7 分钟
1. 部署方案 在开始容器化部署之前,先提几点要求: 为了简化交付,只需要一个镜像 为了可靠性,尽可能多副本部署 通过不同的参数启动不同的服务 通过环境变量注入配置,渲染到配置文件中 下面是 DeepSeek 3FS 的部署方案: 需要部署: 一个 Monitor 用来收集监控数据,数据存储在 ClickHouse 中 一

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