上一页 1 2 3 4 5 6 ··· 35 下一页

2024年4月14日

eBPF指定网口丢弃icmp报文

摘要: ubuntu 23.10 安装eBPF依赖 # 安装编译工具 apt install -y llvm clang # 确认内核具有BTF支持,路径存在,内核没有BTF支持,使用vmlinux.h无法通过编译 ls /sys/kernel/btf # 生成vmlinux.h # apt install 阅读全文

posted @ 2024-04-14 12:35 王景迁 阅读(1) 评论(0) 推荐(0) 编辑

2024年4月11日

go.mod引用git仓库依赖

摘要: 方式1:使用commit id go get k8s.io/client-go@1518fca9f06c6a73fc091535b8966c71704e657b 方式2:使用分支 go get k8s.io/client-go@master 使用分支也是commit id。 阅读全文

posted @ 2024-04-11 21:14 王景迁 阅读(6) 评论(0) 推荐(0) 编辑

2024年4月8日

强删pod是否产生update事件

摘要: k8s v1.19.0 强删Pod产生Update事件 informerFactory.Core().V1().Pods().Informer().AddEventHandler(cache.ResourceEventHandlerFuncs{ UpdateFunc: func(old, new i 阅读全文

posted @ 2024-04-08 23:17 王景迁 阅读(4) 评论(0) 推荐(0) 编辑

go结构体重写String方法从而自定义打印内容

摘要: package main import "fmt" type student struct { name string age int } func (s student) String() string { return fmt.Sprintf("{name is %s, age is %d}", 阅读全文

posted @ 2024-04-08 22:22 王景迁 阅读(6) 评论(0) 推荐(0) 编辑

2024年4月6日

kube-ovn分配vni

摘要: ovn-org/ovn branch-23.06 kube-ovn里面ovn-central的ovn-northd会给logical switch和logical router分配vni,集群内全局唯一,即每个lr和ls都有自己的vni。 northd/northd.covn_datapath_al 阅读全文

posted @ 2024-04-06 11:27 王景迁 阅读(3) 评论(0) 推荐(0) 编辑

2024年4月4日

k8s informer resync机制

摘要: informerFactory创建informer informer一般由informerFactory创建(支持直接创建informer,一般不这么做),informerFactory支持创建多种资源类型的informer,同一个informerFactory中同一种资源类型只创建一个inform 阅读全文

posted @ 2024-04-04 16:31 王景迁 阅读(4) 评论(0) 推荐(0) 编辑

Linux 平均负载

摘要: $ uptime07:44:43 up 1:20, 1 user, load average: 0.47, 0.56, 0.56 07:44:43表示当前时间。up 1:20表示系统运行时间。1 users表示正在登录用户数。0.47, 0.56, 0.56表示过去 1 分钟、5 分钟、15 分钟的 阅读全文

posted @ 2024-04-04 15:46 王景迁 阅读(2) 评论(0) 推荐(0) 编辑

通过ssh隧道实现full nat

摘要: ssh隧道类似于vxlan隧道,ssh隧道是基于ssh协议来实现的。 node1操作 777端口是节点ssh的新增端口如果22端口正常,那么不需要新增777端口。 vim /etc/ssh/sshd_config # SELinux开放给ssh使用的端口增加777 semanage port -a 阅读全文

posted @ 2024-04-04 15:22 王景迁 阅读(5) 评论(0) 推荐(0) 编辑

k8s PV和PVC以及StorageClass

摘要: 本地盘和云磁盘区别 本地盘不支持跨物理机迁移,云磁盘支持跨物理机迁移。 本地目录生命周期 emptyDir、downwardAPI、configMap、secret:kubelet创建本地目录,该目录会随着Pod的消亡而删除。hostPath:本地目录一直存在。 PVC、PV和StorageClas 阅读全文

posted @ 2024-04-04 15:15 王景迁 阅读(13) 评论(0) 推荐(0) 编辑

MySQL问题 left join查询错误

摘要: 使用left join时,左表字段值必须有,右表字段值可以没有。where加右表字段,匹配非空值时,右表字段不能是NULL,必须有具体值。 阅读全文

posted @ 2024-04-04 14:19 王景迁 阅读(1) 评论(0) 推荐(0) 编辑

上一页 1 2 3 4 5 6 ··· 35 下一页

导航