上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 38 下一页

2024年3月22日

go 网络包用法

摘要: 获取网卡IPv4地址 package main import ( "fmt" "net" ) func main() { ifname := "ens33" netIf, err := net.InterfaceByName(ifname) if err != nil { fmt.Printf("g 阅读全文

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

2024年3月13日

制作Ubuntu qcow2镜像

摘要: 下载云主机镜像 https://cloud-images.ubuntu.com/releases/ wget https://cloud-images.ubuntu.com/releases/23.10/release-20240307/ubuntu-23.10-server-cloudimg-am 阅读全文

posted @ 2024-03-13 09:11 王景迁 阅读(72) 评论(0) 推荐(0) 编辑

client-go使用技巧

摘要: Pod使用集群kubeconfig import "k8s.io/client-go/rest" cfg, err := rest.InClusterConfig() if err != nil { klog.Fatalf("Error building kubeconfig: %s", err.E 阅读全文

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

2024年3月10日

ubuntu容器配置北京时间

摘要: docker pull ubuntu:23.10 # 默认ubuntu容器时间是0时区 docker run -v /usr/share/zoneinfo/Asia/Shanghai:/etc/localtime -itd ubuntu:23.10 bash 阅读全文

posted @ 2024-03-10 21:36 王景迁 阅读(6) 评论(0) 推荐(0) 编辑

Python scapy模拟dhcp客户端

摘要: 安装scapy apt install -y python3-scapy 1. 发送dhcp discover广播报文2. sniff抓包,收到dhcp offer广播报文(可能来自多个dhcp服务端)3. 向1个dhcp服务端发送dhcp request广播报文4. sniff抓包,收到dhcp 阅读全文

posted @ 2024-03-10 17:14 王景迁 阅读(125) 评论(0) 推荐(0) 编辑

2024年3月8日

DHCP协议

摘要: 图中单位是字节。 字段op 值 含义 1 客户端发送Discover广播请求,包括自身mac。 2 服务端回复Offer广播响应。 3 客户端发送Request广播,告知选择的服务端,希望获得分配的IP。 IP租期达到50%后,发送Request单播请求,请求续约。 IP租期达到87.5%后,发送R 阅读全文

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

2024年2月26日

go 同一个https端口实现多种认证方式

摘要: 参考kube-apiserver,访问https端口时,-k允许跳过默认的证书认证,从而实现多种认证方式。 package main import ( "crypto/tls" "fmt" "net/http" klog "k8s.io/klog/v2" ) func healthCheck(w h 阅读全文

posted @ 2024-02-26 09:08 王景迁 阅读(14) 评论(0) 推荐(0) 编辑

2024年2月21日

分析kube-apiserver单次创建namespace耗时

摘要: 日志输出 # 业务日志 I0220 22:12:39.149364 40965 multi_config_multi_clientset.go:63] begin to wait cache sync I0220 22:12:39.250461 40965 multi_config_multi_cl 阅读全文

posted @ 2024-02-21 23:37 王景迁 阅读(10) 评论(0) 推荐(0) 编辑

2024年2月20日

eBPF demo

摘要: ubuntu server 23.10 eBPF介绍 eBPF(Extended Berkeley Packet Filter,扩展的伯克利数据包过滤器)前身是BPF(Berkeley Packet Filter,伯克利数据包过滤器)。BPF合入linux kernel,在tcpdump中应用。eB 阅读全文

posted @ 2024-02-20 08:48 王景迁 阅读(21) 评论(0) 推荐(0) 编辑

2024年2月15日

编译调试kube-apiserver

摘要: k8s v1.19.0 cd kubernetes && make generated_filescd cmd/kube-apiserver && go build 报错app/server.go:467:87: undefined: openapi.GetOpenAPIDefinitionscd 阅读全文

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

上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 38 下一页

导航