摘要: 引用来源:https://landscape.cncf.io/card-mode?category=container-runtime&grouping=category 除了dockder外,还有containerd、cri-o等 下图列举了一些常见的container runtime 阅读全文
posted @ 2023-03-17 18:31 cosmoswong 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 关闭swap分区 swapoff -a sed -ri 's/.*swap.*/#&/' /etc/fstab 修改后,通过free -m命令查看结果: $ free -m total used free shared buff/cache available Mem: 3789 383 2515 阅读全文
posted @ 2023-03-17 18:25 cosmoswong 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 使得当在集群内内部运行时,使用ServiceAccount,在集群外部时使用~/.kube/config中的配置,则可以采用如下的方式: var config *rest.Config var kubeConfig *string if home := homeDir(); home != "" { 阅读全文
posted @ 2023-01-10 12:40 cosmoswong 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 在websocket中,目前未提供修改请求头字段的方法,不过可以借助于“Sec-WebSocket-Protocol”,将token放入请求头中,后端收到请求后,从请求头中取得token做校验。 即:在前端websocket中放入token let token=localStorage.getIte 阅读全文
posted @ 2022-12-14 13:26 cosmoswong 阅读(2608) 评论(0) 推荐(1) 编辑
摘要: echo在输出一行信息的时候,会自动加上换行符,然而有些时候,我们不想让它这么做,可以添加上-n选线: -n do not output the trailing newline 阅读全文
posted @ 2022-12-08 10:21 cosmoswong 阅读(243) 评论(0) 推荐(0) 编辑
摘要: 观察下面的程序的输出结果 func main() { sn1 := struct { age int name string }{age: 11, name: "qq"} sn2 := struct { age int name string }{age: 11, name: "qq"} if sn 阅读全文
posted @ 2022-12-08 09:47 cosmoswong 阅读(271) 评论(0) 推荐(0) 编辑
摘要: 1、如何显示文件是否发生了修改? 2、添加自定义模板代码 如想要生成这段代码的模板: func (this *UserClass) Build() { this.Handle("GET", "/User", this.GetUser()) } 通配符定义: 使用: 3、设置变量的值 https:// 阅读全文
posted @ 2022-12-08 09:39 cosmoswong 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 下面这段代码输出什么,说明原因。 func main() { slice := []int{0, 1, 2, 3} m := make(map[int]*int) for key, val := range slice { m[key] = &val } for k, v := range m { 阅读全文
posted @ 2022-12-08 09:20 cosmoswong 阅读(52) 评论(0) 推荐(0) 编辑
摘要: 1)iteration variable重用 for range的idiomatic的使用方式是使用short variable declaration(:=)形式在for expression中声明iteration variable,但需要注意的是这些variable在每次循环体中都会被重用,而 阅读全文
posted @ 2022-12-08 09:08 cosmoswong 阅读(28) 评论(0) 推荐(0) 编辑
摘要: write已经close的channel panic close已经close的chanel panic close nil channel panic 阅读全文
posted @ 2022-12-08 08:55 cosmoswong 阅读(29) 评论(0) 推荐(0) 编辑