client go 原理图
https://zhuanlan.zhihu.com/p/480539462

client-go组件:
Reflector:reflector用来watch特定的k8s API资源。具体的实现是通过ListAndWatch的方法,watch可以是k8s内建的资源或者是自定义的资源。当reflector通过watch API接收到有关新资源实例存在的通知时,它使用相应的列表API获取新创建的对象,并将其放入watchHandler函数内的Delta Fifo队列中。
Informer:informer从Delta Fifo队列中弹出对象。执行此操作的功能是processLoop。base controller的作用是保存对象以供以后检索,并调用我们的控制器将对象传递给它。
Indexer:索引器提供对象的索引功能。典型的索引用例是基于对象标签创建索引。Indexer可以根据多个索引函数维护索引。Indexer使用线程安全的数据存储来存储对象及其键。在Store中定义了一个名为MetaNamespaceKeyFunc的默认函数,该函数生成对象的键作为该对象的 / 组合。
go1.18
1 下载 解压
#进入tmp目录下
wget https://golang.google.cn/dl/go1.18.3.linux-amd64.tar.gz
tar -xzvf go1.18.3.linux-amd64.tar.gz
mv go /usr/local/
2 设置环境变量
# 安装目录
export GOROOT=/usr/local/go
# 代码目录
export GOPATH=~/code
export PATH=$GOPATH:$GOROOT/bin:$PATH
source ~/.bashrc
3 验证
go version
linux go环境基础安装 步骤详细 推荐阅读
https://blog.csdn.net/huang431127/article/details/119574793
推荐国内源:https://blog.csdn.net/qq_42346414/article/details/111151567
go env -w GOPROXY=https://goproxy.cn,direct
安装go环境
原文:https://www.php.cn/be/go/471564.html
第一次linux 成功版本目录结构!!!
[root@test-it-it-alert hello]# pwd
/root/gopath/src/hello # 此目录下执行 go build 编译处理 hello文件!!!棒
[root@test-it-it-alert hello]# tree ../../
../../
├── bin
├── pkg
└── src
├── foo
│ └── foo.go
└── hello
├── hello
└── hello.go
5 directories, 3 files
[root@test-it-it-alert hello]# echo $GOPATH
/root/gopath
[root@test-it-it-alert hello]# echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/go/bin
https://www.php.cn/be/go/471564.html
#!/bin/bash
tar -C /usr/local -zxvf go1.16.3.linux-amd64.tar.gz
echo "export PATH=$PATH:/usr/local/go/bin" >> /etc/profile
echo "export GOPATH=/root/gopath" >> /etc/profile
mkdir /root/gopath
mkdir -p /root/gopath/src
mkdir -p /root/gopath/bin
mkdir -p /root/gopath/pkg
source /etc/profile
go version
linux修改 modle命令
go env -w GO111MODULE=auto
go env -w GO111MODULE=on
下载beego 和安装beego命令
go get github.com/astaxie/beego
go get github.com/beego/bee
cp /root/gopath/bin/bee /usr/local/bin/
kubernetes客户端client-go使用
https://www.jianshu.com/p/48946a317d81
https://blog.csdn.net/huwh_/article/details/78821805
推荐client-go 代码2
https://www.jb51.net/article/220679.htm
用go在github上下载的项目怎样运行它:## 标题
https://www.xp.cn/c.php/111052.html
安装了go语言,并设置了GOPATH在f盘,在github上下载了primitive的项目:
go get -u github.com/fogleman/primitive
go get github.com/astaxie/beego
go get github.com/beego/bee
然后新建一个文件夹,放入一张照片,打开cmd cd到那个文件 执行:
primitive -i input.png -o output.png -n 100
出现如下提示:
bash: primitive: command not found
怎样运行primitive?
三 进阶使用:
https://blog.csdn.net/saynaihe/article/details/124524579
官方文档-推荐:
https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#serviceaccount-v1-core


被折叠的 条评论
为什么被折叠?



