1 2 3 4 5 ··· 53 下一页

2025年10月19日

go 并发赋值安全性

摘要: 32/64位机器读写占用空间小于或等于32/64位的变量是原子操作,超过时属于非原子操作。 安全的赋值类型基本数据类型:字节型、布尔型、整型、浮点型、字符型其他数据类型:指针、函数 不安全的赋值类型基本数据类型:复数型、字符串其他数据类型:数组、切片、字典、通道、接口、结构体 可以通过atomic. 阅读全文

posted @ 2025-10-19 16:41 王景迁 阅读(3) 评论(0) 推荐(0)

2025年9月21日

Linux 内核VRF

摘要: Virtual Routing and Forwarding (VRF) 由路由表+网络设备组成。 加载vrf内核模块 modprobe vrf 基本操作 # 创建并拉起vrf设备 # 自动创建路由表1 ip link add vrf1 type vrf table 1 ip link set de 阅读全文

posted @ 2025-09-21 10:08 王景迁 阅读(9) 评论(0) 推荐(0)

2025年9月17日

k8s node status capacity和allocatable区别

摘要: node statuscapacity: 节点上的总资源,固定值allocatable: 可供pod使用的总资源,固定值 kubectl get node kind-control-plane -oyaml 默认情况下,allocatable和capacity相等,pod可使用节点的所有资源。 为了 阅读全文

posted @ 2025-09-17 08:49 王景迁 阅读(18) 评论(0) 推荐(0)

k8s 配置拉取镜像认证信息

摘要: 创建secret kubectl create secret docker-registry pull-image \ --docker-server=<domain> \ --docker-username=<username> \ --docker-password=<password> Pod 阅读全文

posted @ 2025-09-17 08:21 王景迁 阅读(5) 评论(0) 推荐(0)

2025年9月15日

local-path-provisioner处理pvc和pv事件

摘要: v0.0.30 vendor/sigs.k8s.io/sig-storage-lib-external-provisioner/v10/controller/controller.go syncClaim方法1. 如果pvc上存在注解volume.kubernetes.io/storage-prov 阅读全文

posted @ 2025-09-15 09:27 王景迁 阅读(16) 评论(0) 推荐(0)

2025年9月12日

安装docker和buildx

摘要: wget https://download.docker.com/linux/static/stable/x86_64/docker-25.0.0.tgz tar -zxvf docker-25.0.0.tgz cp docker/* /usr/bin/ rm -rf docker vim /etc 阅读全文

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

2025年8月28日

go http实现长连接

摘要: 服务端 package main import ( "net/http" "time" ) func handler(w http.ResponseWriter, r *http.Request) { f := w.(http.Flusher) for { w.Write([]byte("1\n") 阅读全文

posted @ 2025-08-28 22:32 王景迁 阅读(13) 评论(0) 推荐(0)

Linux Ubuntu上安装helm

摘要: apt update apt install -y apt-transport-https curl -fsSL https://baltocdn.com/helm/signing.asc | sudo apt-key add - apt install -y software-properties 阅读全文

posted @ 2025-08-28 22:08 王景迁 阅读(14) 评论(0) 推荐(0)

2025年8月24日

kubelet自注册

摘要: v1.19.0 kubelet是否自注册由参数register-node决定,默认是true。 pkg/kubelet/kubelet_node_status.goregisterWithAPIServer不断尝试创建node,直到成功。 阅读全文

posted @ 2025-08-24 15:14 王景迁 阅读(8) 评论(0) 推荐(0)

2025年8月17日

go http trace分析耗时

摘要: package main import ( "crypto/tls" "fmt" "log" "net/http" "net/http/httptrace" "time" ) func main() { req, _ := http.NewRequest("GET", "https://www.ba 阅读全文

posted @ 2025-08-17 20:45 王景迁 阅读(8) 评论(0) 推荐(0)

1 2 3 4 5 ··· 53 下一页

导航