Kubernete的ConfigMap是否可写? [英] Are Kubernete's ConfigMaps Writable?

查看:206
本文介绍了Kubernete的ConfigMap是否可写?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以直接修改configMap挂载的文件?我们有一个应用程序读取一个configMap类型的配置文件,并且如果该configMap与其他Pod共享并且该Pod重新启动时,该应用程序应该能够编辑该文件,并且更改应保留.

Is it possible to directly modify the file mounted by configMap? We have an application that reads a configuration file that was configMap type and the application should able to edit the file and the changes should be persisted if the configMap is shared with other pods and when the pod restarts.

如果configMap并非为此目的,那么我们应该在consul上中继什么以保存配置?

If configMap is not meant for this, then what should we relay on consul to save the configuration?

推荐答案

是的,配置映射是可以写.如果要与configmap中的文件进行交互,则可以将文件放在可写的卷中,然后

Yes a configmap is not intended to be writeable. If you're interacting with files from a configmap then you could instead put the files in a writeable volume and mount the volume. Or you could, as you suggest, use centralised configuration like consul. Given, that the app is dynamically writing to this data you could consider it state rather than configuration. Then it could be stored in a database. Another option could be a distributed cache such as redis or hazelcast.

这篇关于Kubernete的ConfigMap是否可写?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆