设置环境变量用于集群中的所有部署或豆荚
我创建了EKS群集,现在需要添加HTTP_PROXY/HTTP_PROXIES和NO_PROXY作为环境变量,以在所有300个部署中。我创建了一个带有变量的配置映射。有没有一种方法可以同时更新所有豆荚而又不一。如果是,我该怎么做?我的配置地图名称是代理 - 环境变量。
感谢您的帮助和帮助!
BR,
马丁
Name: proxy-environment-variables
Namespace: kube-system
Labels: <none>
Annotations: <none>
Data
====
HTTPS_PROXY:
----
http://10.16.11.10:8080
HTTP_PROXY:
----
http://10.16.11.10:8080
NO_PROXY:
----
169.254.169.254,127.0.0.1,localhost,10.0.0.0/8
http_proxy:
----
http://10.16.11.10:8080
https_proxy:
----
http://10.16.11.10:8080
no_proxy:
----
169.254.169.254,127.0.0.1,localhost,10.0.0.0/8
BinaryData
====
Events: <none>
I created EKS cluster and now i need to add http_proxy/http_proxies and no_proxy as environment variable to all 300 deployments. I created a config map with the variables. Is there a way to update all pods simultaneously without doing it one by one? And if yes how can i do it? My config map name is proxy-environment-variables.
Thank you for the help and assistance!
BR,
Martin
Name: proxy-environment-variables
Namespace: kube-system
Labels: <none>
Annotations: <none>
Data
====
HTTPS_PROXY:
----
http://10.16.11.10:8080
HTTP_PROXY:
----
http://10.16.11.10:8080
NO_PROXY:
----
169.254.169.254,127.0.0.1,localhost,10.0.0.0/8
http_proxy:
----
http://10.16.11.10:8080
https_proxy:
----
http://10.16.11.10:8080
no_proxy:
----
169.254.169.254,127.0.0.1,localhost,10.0.0.0/8
BinaryData
====
Events: <none>
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以使用
set env
将环境变量更新为部署:示例:以下示例证明是否有多个部署,如何将env变量添加到其POD中。
//我有以下部署:
//他们各自的pods:
//我的配置映射:
// http_proxy env Variable是已经已经设置为dep-1
// http_proxy envibal 已经 /strong>设置为dep-2
// http_proxy env变量是 ind dep-4,这是我们的焦点 //
// 解决方案:设置所有部署(
- ALL
)的所有部署的设置ENV,该构造映射称为my-env-config
)//注意POD的年龄,只有DEP-4的POD年龄已更改
//现在http_proxy设置为DEP-4的POD。
You can use the
set env
to update the environment variable into the deployment:Example: The following example is demonstrating if there are multiple deployments, how to add env variables to their pods.
// I have the following deployments:
// their respective pods:
// my config map:
// HTTP_PROXY env variable is already set in dep-1
// HTTP_PROXY env variable is already set in dep-2
// HTTP_PROXY env variable is not set in dep-4, this is our focus
// SOLUTION: Setting env for all the deployments(
--all
) from a config map calledmy-env-config
)//Note the age of the pods, only dep-4's pod age is altered
// now HTTP_PROXY is set in dep-4's pod.