Multiple containers in one pod

橙三吉。 提交于 2020-01-21 14:37:34

问题


I am migrating an application from openshift 2 such consists of a Java(jetty) webserver and a mongo database. Both the webserver and mongo need access to persistent storage, as well as the server accessing the database. As the volume available to me can't (I believe) be accessed by two pods my current goal is to include both the server and dB into the same pod as separate containers. I have tried copying the mongo container into the deploy config for the server but I just get an error saying the config is invalid with no description of why. Is this an approach that could work and how can I find out why it isn't?


回答1:


It is possible to do it if you really needed to, but not normally recommended for production systems.

In doing it, you are limited to a single replica and cannot scale your application, also, you can't use Rolling deployment strategy and must use Recreate.

For some examples of templates which deploy a database with front end together in same pod which you might adapt, see the 'testing' variants of the templates at:

  • https://github.com/openshift-evangelists/wordpress-quickstart/tree/master/templates

For those templates the build of the application image was done as separate manual step and they were just handling the deployment, so you will need to incorporate the build configuration into them yourself after you have copied and modified them for your own purposes.


UPDATE 1

Those templates do now include build configurations as have been tweaking the way they work.



来源:https://stackoverflow.com/questions/46565569/multiple-containers-in-one-pod

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!