简体   繁体   English

Kubernetes创建秘密并在创建名称空间时更改默认服务帐户

[英]Kubernetes create secret and change default service account upon namespace creation

For reasons (namespaces are created every day) upon namespace creation I would need to do the following two actions: 由于种种原因(每天创建名称空间),在创建名称空间时,我需要执行以下两个操作:

  • Add a gcr-json-key secret 添加gcr-json-key机密
  • Add imagePullSecrets to the default ServiceAccount 将imagePullSecrets添加到默认的ServiceAccount

Is there an automated way to do this in Kubernetes? Kubernetes中有自动的方法吗? Is there a template for the default Service Account created that I can change? 是否为我可以更改的默认服务帐户创建了模板? (I am using Kubernetes 1.11.5 (AWS EKS)) (我正在使用Kubernetes 1.11.5(AWS EKS))

Right now I don't have a very good way to deal with this problem... 现在,我没有一个很好的方法来解决这个问题...

As @Jason Stanley suggested: 正如@Jason Stanley所建议的:

How are the namespaces created ? 如何创建命名空间? If you're using Helm, you could very easily automate the above 2 tasks for every release. 如果您使用的是Helm,则可以轻松地针对每个发行版自动执行上述2个任务。 Every new release would create a new namespace (you get to configure that) and every release also creates the required secret and ServiceAccount. 每个新版本都会创建一个新的名称空间(您可以对其进行配置),每个版本也会创建所需的密钥和ServiceAccount。

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

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