k8s client-go使用举例

容器中执行命令:

https://github.com/appscode/searchlight/blob/22632646424bdd34c98bdaec87553fd182a85945/plugins/check_pod_exec/lib.go#L62

创建client和controller:https://zhuanlan.zhihu.com/p/34192361

code-generagtor:

     (1)生成全部功能API server, controler,client:

http://www.infoq.com/cn/articles/kubernetes-status-management-and-extension

    (2)生成client端代码:

       初步使用方法:http://www.mamicode.com/info-detail-2313039.html

http://blog.xbblfz.site/2018/09/19/k8s%E4%BB%A3%E7%A0%81%E8%87%AA%E5%8A%A8%E7%94%9F%E6%88%90%E8%BF%87%E7%A8%8B%E7%9A%84%E8%A7%A3%E6%9E%90/

https://kknews.cc/other/6586rql.html

(3)k8s三种client使用:

https://blog.csdn.net/yevvzi/article/details/52768288

clientset:https://blog.csdn.net/yevvzi/article/details/52768288(k8s核心已经有的资源,使用方便,固定)

dynamicclient:https://blog.csdn.net/yevvzi/article/details/54380944(比clientset灵活,加入thirdparty的各种操作接口,比clientset稍微麻烦,需要自定义参数较多)

restclient:https://blog.csdn.net/yevvzi/article/details/54426775(各种client的底层)

经验分享:https://kknews.cc/other/6586rql.html

猜你喜欢

转载自blog.csdn.net/wasd12121212/article/details/82995243