Edit HostPath files as a root user in kubernetes

8/27/2018

In Kubernetes when I create a pod it gets deployed in a node. What I want to do is that I want to update the files of the node where that pod is deployed and which require the root permissions. I mount the HostPath where I want to edit the files in my pod yaml. Also, I have a docker image which has a script, this script wants to update the node filesystem lets say /proc/sys/kernel/core_pattern. I have created a ServiceAccount and added it to privileged Security Context Constraints.

When I create the pod I get the error saying "Read-only file system".

Can someone tell what I am doing wrong?

-- sheikh sabeer
docker
kubernetes
openshift

0 Answers