Mounting a ConfigMap with volumes as file fails

Solution Verified - Updated -

Issue

Mounting a ConfigMap and specifying a path for a config file replacement fails with one of the following errors when the goal is to specify a configuration file, not create a directory:

Cannot start service xxxxx: oci runtime error: container_linux.go:247: starting container process caused "container init exited prematurely"

container_linux.go:247: starting container process caused "process_linux.go:364: container init caused \"rootfs_linux.go:54: mounting \\\"/var/lib/origin/openshift.local.volumes/pods/5d7b39aa-99aa-11e9-889a-005056874791/volumes/kubernetes.io~configmap/t9-setenv\\\" to rootfs \\\"/var/lib/docker/overlay2/623548c818d1f06b66ffe57de2a99625c7a64b3ba57fb1756d5b4625633207d2/merged\\\" at \\\"/var/lib/docker/overlay2/623548c818d1f06b66ffe57de2a99625c7a64b3ba57fb1756d5b4625633207d2/merged/app/tomcat/instances/docker/bin/setenv.sh\\\" caused \\\"not a directory\\\"\""

Or, the container will mount properly, but configuration files will not be present. Instead, an "oc rsh" into the pod shows that the path has been created as a directory rather than a configuration file. The deployment should instead overwrite a configuration file as described in the documentation.

Environment

  • OpenShift Container Platform 3.9
  • OpenShift Container Platform 3.11

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content