简体   繁体   English

是否可以动态地将新pod添加到现有部署?

[英]Is it possible to dynamically add a new pod to an existing deployment?

Just to be clear: I'm not asking about scaling up the number of replicas of a pod - I'm asking about adding a new pod which provides completely new functionality. 需要明确的是:我不是要求扩大pod的复制数量 - 我要求添加一个提供全新功能的新pod。

So I'm wondering: can I call the Kubernetes API to dynamically add a new pod to an existing deployment? 所以我想知道:我可以调用Kubernetes API来动态地将新pod添加到现有部署吗?

Deployments are meant to be a homogeneous set of replicas of the same pod template, each presumably providing the same functionality. 部署意味着是同一pod模板的同类副本集,每个副本可能提供相同的功能。 Deployments keep the desired number of replicas running in the event of crashes and other failures, and facilitate rolling updates of the pods when you need to change configuration or the version of the container image, for example. 如果发生崩溃和其他故障,部署可以保持所需数量的副本运行,例如,当您需要更改配置或容器映像的版本时,便于滚动更新容器。 If you want to run a pod that provides different functionality, do so via a different deployment. 如果要运行提供不同功能的窗格,请通过其他部署执行此操作。

Adding a different pod to an existing deployment is not a viable option. 向现有部署添加不同的pod不是可行的选择。 If you want to spin up pods in response to API requests to do some work, there are a handful of officially support client libraries you can use in your API business logic: https://kubernetes.io/docs/reference/using-api/client-libraries/#officially-supported-kubernetes-client-libraries . 如果你想根据API请求启动pod来做一些工作,你可以在API业务逻辑中使用一些正式支持的客户端库: https//kubernetes.io/docs/reference/using-api / client-libraries /#official-supported-kubernetes-client-libraries

You can inject a container to an existing Pod. 您可以将容器注入现有Pod。 Not sure whether it would meet your requirement. 不确定它是否符合您的要求。 You can refer to how istio inject a sidecar proxy to an existing Pod manually. 您可以参考istio如何手动将sidecar代理注入现有Pod。 Manual injection 手动注射

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM