<p>I have mounted a hostpath volume in a Kubernetes container. Now I want to mount a configmap file onto the hostpath volume.</p>

<p>Is that possible? </p>

<p>Not really, a larger question would be would you'd want to do that?</p>

<p>The standard way to add configurations in Kubernetes is using ConfigMaps. They are stored in etcd and the size limit is <a href="https://github.com/kubernetes/kubernetes/issues/19781" rel="nofollow noreferrer"><code>1MB</code></a>. When your pod comes up the configuration is mounted on a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer">pod mount point</a> that you can specify in the pod spec.</p>

<p>You may want the opposite which is to use a <a href="https://kubernetes.io/docs/tasks/configure-pod-container/configure-pod-configmap/" rel="nofollow noreferrer"><code>hostPath</code></a> that has some configuration and that's possible. Say, that you want to have some config that is larger than 1MB (which is not usual) and have your pod use it. The gotcha here is that you need to put this hostPath and the files in all your cluster nodes where your pod may start.</p>
