Skip to content

Mounting a volume to container is not clear #736

@jamesla

Description

@jamesla

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    custom kube optionsAdding options related to customizing parts of the default Kubernetes resources.documentationImprovements or additions to documentation

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions