-
Notifications
You must be signed in to change notification settings - Fork 480
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unwanted container creation in deploymentConfig.yamls due to initContainer #1316
Comments
TODO: try to reproduce |
@fscdf : Thanks for reporting, I can reproduce your issue. From what I see you want to build two images:
At the moment, I think you can work around this issue by separating plugin configuration for building initContainer's image and main container's image. This would take care of building image separately from main application container image. For adding initContainer into DeploymentConfig, you can add a fragment with initContainer details: spec:
template:
spec:
initContainers:
- name: init-image
image: init-image:latest
imagePullPolicy: Always
resources:
limits:
cpu: 1
memory: 1Gi
requests:
cpu: 3
memory: 3Gi
I've created a demo project, you can see configuration here
However, this would add an extra step for building initContainers image into cluster. It doesn't look good. I think we need to discuss and add functionality to support initContainers in generated controllers. Or maybe add filters so that some images can only be considered for certain phases (build only, resource only, etc.) |
To me, it should be a new feature: be able to tell that a container should be an |
I propose adding a new configuration option to our resource configuration:
ContainerHandler would skip ImageConfiguration's which are present in InitContainerHandler should be modified to generate InitContainers from XML configuration. |
Current behavior
The Desired behavior
This would allow to easily add a setting such as: <initContainer>
<name>test</name>
<imageName>busybox</imageName>
<command>
<arg>sh</arg>
<arg>-c</arg>
<arg>until nslookup mydb.$(cat /var/run/secrets/kubernetes.io/serviceaccount/namespace).svc.cluster.local; do echo waiting for mydb; sleep 2; done</arg>
</command>
</initContainer>
|
I'm a little confused about how we should approach providing multiple controller support or whether we should even do it. Typically our plugin is installed per project and it generates a single controller+service only for that specific project. If we introduce multiple controllers, I'm a little confused about how we should handle these scenarios:
If we switch from single controller generation to multiple controller generation, we would need to modify the behavior of these enrichers:
|
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (eclipse-jkube#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
…urce configuration (#1316) + Deprecate all controller specific configuration options in ResourceConfig. Move all controller specific options to nested controller configuration. + Add controller(s) configuration option in ResourceConfig + Add initContainres configuraiton option in Controller configuration Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Description
I want to create two docker images in the pom, then run one in an initContainer and one in a normal container. All generated deploymentConfig yaml's contain, however, an additional unwanted container for the second image in the pom.
Info
The relevant portion of my pom.xml:
The initContainer and container are defined as follows.
In the target/ folder, all generated deploymentConfigs have this container, which shouldn't be there:
It is important to note, that this unwanted container seems to be a copy of the backend container. This is due to the backend image coming second in the pom. If the order is reversed, the above container will have the init-image.
If, instead of an initContainer and a container, I define two containers in the deployment.yaml, everything works fine.
Not sure if this is a bug or flawed setup.
The text was updated successfully, but these errors were encountered: