英文:
Setup Kubernetes Pods via API Call using Go and Operator SDK
问题
我正在尝试使用operator-sdk
和Go
创建一个可以通过API调用创建和删除Pod的控制器。该控制器应该能够接受一个包含信息的POST
调用,例如{imageTag:"", namespace:""}
,以设置一个可以返回podId
的Pod,并且还应该能够使用podId
通过API调用删除Pod。
我已经查阅了一些教程,但我不清楚Go操作符如何拦截API调用。这种操作是否可能?对于这个问题的任何帮助将不胜感激。谢谢。
英文:
I am trying to create a controller that can create and delete Pods via API calls using operator-sdk
with Go
. The controller should be able to accept a POST
call with information such as {imageTag:"", namespace:""}
to setup a Pod that can return a podId
, and also be able to delete a Pod via API call using podId
.
I have reviewed some tutorials, but I am unclear on how the Go operator can intercept API calls. Is this possible? Any help on this matter would be greatly appreciated. Thanks.
答案1
得分: 1
我发现Kubernetes Client和Kubernetes Operator是两个不同的概念。
最终我创建了一个使用Kubernetes Go Client的库,通过它我能够实现我的目标。
你可以在这里参考这个库。
https://github.com/kubernetes/client-go
英文:
Found that Kubernetes Client and Kubernetes Operator are two different concepts.
Ended up creating a Kubernetes Go Client using which I was able achieve my goal.
You can refer the library here.
https://github.com/kubernetes/client-go
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论