英文:
Automatically update vault secrets into kubernetes
问题
所有我们应用程序使用的秘钥都存储在 Vault 中。在部署过程中,我们使用一个内部工具从 Vault 中检索秘钥并将它们加载到容器中。现在,我们有一个秘钥,每个月都会更新,需要重新启动或部署。是否有一种可用的解决方案,可以在 Vault 上修改秘钥时自动更新容器中的秘钥?FYI - 我们的秘钥以文件的形式加载到容器中。
我在网上查看了一下,看到了两个选项:
1 - 使用 Vault 代理作为侧车容器
2 - Vault 操作员(一些新东西)
英文:
All the secrets used by our application are stored in Vault. During deployment, we utilize an internal tool to retrieve secrets from Vault and load them onto the pods. Now, we have a secret which gets updated every month and it requires a restart or deployment. Is there a solution available that automates the process of updating the secret on the pod whenever it is modified on Vault? FYI - our secrets are loaded as files on the pods.
I checked online and I see two options:
1 - Vault agent used as side car container
2 - Vault operator (something new)
答案1
得分: 1
Sidecar 可以很好地适用。
我猜 Hashicorp Vault Secrets Operator 也可以,老实说,我不知道它。
您可以将密钥附加为 CSI Volumes。
使用 Hashicorp Vault Agent 注入它们。
我们还可以提到:External Secrets Operator,它可以与其他 vaults 集成(例如:aws、远程 Kubernetes 集群 API,...)。
英文:
Sidecar would fit in nicely.
That Hashicorp Vault Secrets Operator could do as well, I guess -- I didn't know about it, TBH.
You could attach secrets as CSI Volumes
Inject them using Hashicorp Vault Agent
And we could mention: the External Secrets Operator, which can integrate with other vaults (eg: aws, a remote kubernetes cluster API, ...)
答案2
得分: 0
-
如果您将一个 Kubernetes 秘钥挂载到部署中,那么就不再需要更新部署了。
-
您可以使用作业(job)或定时作业(cronJob)来自动更新 Kubernetes 秘钥本身,具体取决于您的需求。如果您可以利用触发 Kubernetes 作业来获取新的秘钥并更新 Kubernetes 秘钥的事件,那么您应该这样做。如果您想在每个月的第一天的特定时间运行作业,可以使用 cronJob。
最好的问候
英文:
-
If you mount a kubernetes secret into the deployment, an update of the deployment should not be needed anymore.
-
You can automate the updating of the kubernetes secret itself with a job or a cronJob depending on you needs. If you can utilize an event that trigger a kubernetes job to fetch the new secrets and update the kubernetes secret, you should do that. If you want to run the job like on every first day of the month at a specific time you can use a cronJob.
Best regards
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论