Skip to content
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

Mounts of main container apply to all sidecars #20987

Closed
disablerBA opened this issue Oct 25, 2021 · 2 comments · Fixed by #23054
Closed

Mounts of main container apply to all sidecars #20987

disablerBA opened this issue Oct 25, 2021 · 2 comments · Fixed by #23054
Assignees
Labels
area/kubernetes kind/bug Something isn't working
Milestone

Comments

@disablerBA
Copy link

disablerBA commented Oct 25, 2021

Describe the bug

I have quarkus 2.3.1.Final, openshift extension and config application.properties:

quarkus.native.container-build=true
quarkus.container-image.build=true
quarkus.container-image.push=false
quarkus.container-image.builder=docker

quarkus.container-image.group=test-group
quarkus.container-image.name=test-name
quarkus.container-image.tag=latest

quarkus.kubernetes.deployment-target=openshift
quarkus.openshift.mounts.main-volume1.path=/main-container/mount1
quarkus.openshift.mounts.main-volume2.path=/main-container/mount2

quarkus.openshift.sidecars.sidecar1.image=sidecar1-image
quarkus.openshift.sidecars.sidecar1.mounts.sidecar1-volume1.path=/sidecar1/mount1
quarkus.openshift.sidecars.sidecar1.mounts.sidecar1-volume2.path=/sidecar1/mount2

quarkus.openshift.sidecars.sidecar2.image=sidecar2-image
quarkus.openshift.sidecars.sidecar2.mounts.sidecar2-volume1.path=/sidecar2/mount1
quarkus.openshift.sidecars.sidecar2.mounts.sidecar2-volume2.path=/sidecar2/mount2

After mvnw -Pnative package generated openshift.yml contains mounts of main container in the all sidecars.

Expected behavior

        - image: sidecar1-image
          imagePullPolicy: IfNotPresent
          name: sidecar1
          volumeMounts:
            - mountPath: /sidecar1/mount1
              name: sidecar1-volume1
              readOnly: false
            - mountPath: /sidecar1/mount2
              name: sidecar1-volume2
              readOnly: false
        - image: sidecar2-image
          imagePullPolicy: IfNotPresent
          name: sidecar2
          volumeMounts:
            - mountPath: /sidecar2/mount1
              name: sidecar2-volume1
              readOnly: false
            - mountPath: /sidecar2/mount2
              name: sidecar2-volume2
              readOnly: false

Actual behavior

        - image: sidecar1-image
          imagePullPolicy: IfNotPresent
          name: sidecar1
          volumeMounts:
            - mountPath: /sidecar1/mount1
              name: sidecar1-volume1
              readOnly: false
            - mountPath: /sidecar1/mount2
              name: sidecar1-volume2
              readOnly: false
            - mountPath: /main-container/mount1
              name: main-volume1
              readOnly: false
            - mountPath: /main-container/mount2
              name: main-volume2
              readOnly: false
        - image: sidecar2-image
          imagePullPolicy: IfNotPresent
          name: sidecar2
          volumeMounts:
            - mountPath: /sidecar2/mount1
              name: sidecar2-volume1
              readOnly: false
            - mountPath: /sidecar2/mount2
              name: sidecar2-volume2
              readOnly: false
            - mountPath: /main-container/mount1
              name: main-volume1
              readOnly: false
            - mountPath: /main-container/mount2
              name: main-volume2
              readOnly: false

How to Reproduce?

Just add any mounts by quarkus.openshift.mounts."mounts".path and add config for sidecar by quarkus.openshift.sidecars."sidecar".image.

Output of uname -a or ver

No response

Output of java -version

No response

GraalVM version (if different from Java)

No response

Quarkus version or git rev

No response

Build tool (ie. output of mvnw --version or gradlew --version)

No response

Additional information

No response

@disablerBA disablerBA added the kind/bug Something isn't working label Oct 25, 2021
@quarkus-bot
Copy link

quarkus-bot bot commented Oct 25, 2021

/cc @geoand, @iocanel

@iocanel
Copy link
Contributor

iocanel commented Nov 1, 2021

So, from what I understand the issue is that the main container mounts are also added to the sidecar containers.

This was kind of intended as a convenience even though the documentation is not that clear about it.
I can see it being confusing and it's something that we need to address. I'll work on that asap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/kubernetes kind/bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants