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

Mounting a volume to container is not clear #736

Open
jamesla opened this issue Dec 12, 2024 · 3 comments
Open

Mounting a volume to container is not clear #736

jamesla opened this issue Dec 12, 2024 · 3 comments

Comments

@jamesla
Copy link

jamesla commented Dec 12, 2024

I am trying to attach a volume from a configmap to an init container but it is not entirely clear how to do it from the CRD spec. I've also been unable to find any examples of somebody doing this:

The code so far:

---
apiVersion: solr.apache.org/v1beta1
kind: SolrCloud
metadata:
  name: test
spec:
  replicas: 1
  customSolrKubeOptions:
    podOptions:
      volumes:
        - source: 
            configMap:
          name: configset
          defaultContainerMount:
            mountPath: /config
            name: config.xml
      sidecarContainer:
        - name: config-loader
          image: alpine/curl:latest
          command:
            - "sh"
            - "-c"
            - "ls -la /config"
          volumeMounts:
            - name: configset
              mountPath: /config

---
kind: ConfigMap
apiVersion: v1
metadata:
  name: configset
data:
  config.xml: |
    <?xml version="1.0" encoding="UTF-8" ?>
     <config>
      ...
     </config>

It runs and the /config mount exists but it is always empty.

  1. Are there any examples of volume mounts with this operator?
  2. What am I doing wrong?
@mcarroll1
Copy link

mcarroll1 commented Dec 16, 2024

I've encountered a similar issue here #675 (referencing an older issue here: #484).

I added a PR documenting an additional volume example: #739

@mcarroll1
Copy link

@jamesla
Copy link
Author

jamesla commented Dec 19, 2024

Thanks @mcarroll1 I did build that example by reading the full spec and I've read it a second time and I still can't seem to see what I'm doing wrong.

Does that example work for you? I'm wondering whether the feature (mapping configmaps as volumes) is broken?

@jamesla jamesla changed the title Mounting a volume to an init container is not clear Mounting a volume to container is not clear Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants