2026年3月7日

prometheus增加需要采集数据的pod

摘要: Prometheus serviceMonitorSelector ServiceMonitor(描述监控对象信息) matchLabels Service(k8s服务发现) Service+Deploy yaml定义 kind: Service apiVersion: v1 metadata: n 阅读全文

posted @ 2026-03-07 11:15 王景迁 阅读(1) 评论(0) 推荐(0)

2026年3月5日

go实现单机版限流

摘要: go get golang.org/x/time/rate package main import ( "log" "time" "golang.org/x/time/rate" ) func main() { // 创建一个每秒产生5个令牌,桶容量为10的限流器 log.Printf("调整前") 阅读全文

posted @ 2026-03-05 08:02 王景迁 阅读(3) 评论(0) 推荐(0)

平衡kube-apiserver流量

摘要: 问题现象 多个kube-apiserver,重启单个kube-apiserver,会导致请求集中到其他kube-apiserver上,重启的kube-apiserver几乎没有收到请求。 问题分析 重启kube-apiserver,client因连接断开而重连到其他kube-apiserver。cl 阅读全文

posted @ 2026-03-05 07:47 王景迁 阅读(2) 评论(0) 推荐(0)

2026年2月15日

adb命令总结

摘要: # 切root adb root # 通过ip+端口连接主机 adb connect ip:端口 # 进入主机 adb shell # 拷进文件 adb push xxx /root/ # 拷出文件 adb pull xxx ./ 阅读全文

posted @ 2026-02-15 11:01 王景迁 阅读(2) 评论(0) 推荐(0)

2025年12月25日

ping工具总结

摘要: # 指定网口,大写的i -I eth0 # 指定包长 -s 128 # 不分片 -M do 阅读全文

posted @ 2025-12-25 23:07 王景迁 阅读(3) 评论(0) 推荐(0)

2025年12月20日

docker拉取镜像支持http

摘要: docker默认使用https拉取镜像,无法通过http拉取镜像。创建或修改/etc/docker/daemon.json文件,增加insecure-registries字段。 { "insecure-registries" : ["镜像地址域名或者ip:port"] } 重启docker syst 阅读全文

posted @ 2025-12-20 07:03 王景迁 阅读(13) 评论(0) 推荐(0)

2025年12月14日

shell 判断二进制是否可用

摘要: # 结果是yes checkCmd='docker --version' res=`eval $checkCmd 1>/dev/null 2>&1; echo -n $?` resStr=`echo -n $res` if [[ "$resStr" == "0" ]]; then echo "yes 阅读全文

posted @ 2025-12-14 16:38 王景迁 阅读(6) 评论(0) 推荐(0)

shell 容器执行脚本有异常时直接退出

摘要: # pod.yaml # set -e:当脚本中有命令执行返回非0时,脚本会立即终止执行并异常退出。 # set -u:当脚本中引用了未定义的变量时,脚本会立即终止执行并异常退出。 ... containers: - name: busybox image: docker.io/library/bu 阅读全文

posted @ 2025-12-14 15:49 王景迁 阅读(10) 评论(0) 推荐(0)

k8s Etcd版本号

摘要: # 下载etcdctl二进制并放入容器 curl -O https://github.com/etcd-io/etcd/releases/download/v3.5.0/etcd-v3.5.0-linux-amd64.tar.gz tar -zxvf etcd-v3.5.0-linux-amd64. 阅读全文

posted @ 2025-12-14 15:34 王景迁 阅读(12) 评论(0) 推荐(0)

2025年12月9日

对象存储s5cmd常用命令

摘要: # 安装s5cmd apt install -y gdebi-core apt install -y wget wget https://github.com/peak/s5cmd/releases/download/v2.2.1/s5cmd_2.2.1_linux_amd64.deb echo y 阅读全文

posted @ 2025-12-09 09:11 王景迁 阅读(46) 评论(0) 推荐(0)

导航