<p>I am building containers that are designed to build and publish things.  So i need to configure the <code>.pypirc</code>, etc files.  </p>

<p>I am trying to do it with a configmap.  Creating a configmap with each of the dot files is easy enough, my problem is mapping it into the pod.  </p>

<pre><code>apiVersion: v1
kind: Pod
metadata:
  generateName: jnlp-
labels:
  name: jnlp
  label: jnlp
spec:
  containers:
    - name: jnlp
      image: '(redacted)/agent/cbuild-okd311-cmake3-py36:0.0.2.7'
      tty: true
      securityContext:
        runAsUser: 1001
        allowPrivilegeEscalation: false
      volumeMounts:
        - name: dotfiles
          mountPath: "/home/jenkins"
  volumes:
    - name: dotfiles
      configMap:
        name: jenkins.user.dotfiles
</code></pre>

<p>heres my map (redacted)</p>

<pre><code>apiVersion: v1
data:
  .pypirc: |-
    [distutils]
    index-servers = local
    [local]
    repository: https://(redacted)/api/pypi/pypi 
    username: (redacted)
    password: (redacted)
  .p4config: |-
    P4CLIENT=perf_pan
    P4USER=(redacted)
    P4PASSWD=(redacted)
    P4PORT=p4proxy-pa.(redacted):1666
    P4HOST=(redacted).com%
kind: ConfigMap
metadata:
  name: jenkins.user.dotfiles
  namespace: jenkins
</code></pre>

<p>im pretty sure that the mount command is blowing away everything else thats in the <code>/home/jenkins</code> folder.  But im trying to come up with a mount that will create a dot file for each entry in my configmap.</p>

<p>Thanks</p>

scphantm
<p>Your suspicion is correct. What you can use to fix that is <code>subPath</code> <a href="https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath" rel="nofollow noreferrer">https://kubernetes.io/docs/concepts/storage/volumes/#using-subpath</a></p>

<p>But the downside is you do need a volumeMount entry for each of the dotfiles.</p>
