45

kubernetes PodPreset 的使用

 6 years ago
source link: https://blog.qikqiak.com/post/how-to-use-podpreset-in-kubernetes/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
最近在kubernetes上安装 sentry 的时候,我将sentry需要运行的3个服务放到同一个POD中的,WEB、Celery Worker、Crontab 分别用一个独立的容器来运行的,但是这三个容器需要用到环境变量基本上都是一样的,比如数据库的配置、消息队列的配置,这样就造成一个问题是我需要把完全一模一样的环境配置复制3份,因为3个容器都需要使用,这样如果需要更改的话也要改3个地方。幸好kubernetes给我们提供了一种新的特性:PodPreset,该对象用来在 Pod 创建的时候向 Pod 中注入某些特定信息,可以包括 secret、volume、volume mount 和环境变量等。

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK