dd-agent icon indicating copy to clipboard operation
dd-agent copied to clipboard

Logs pointer volume mounted as readonly

Open alphashuro opened this issue 7 years ago • 5 comments

**Output of the info page **

There is no output because the datadog-agent container failed to start

Additional environment details (Operating System, Cloud provider, etc):

Operating System: Container OS Cloud Provider: Google Cloud Platform: Kubernetes 1.9.5

Steps to reproduce the issue:

  1. Add the following volume to a dd-agent daemonset configuration
volumes:
  (...)
  - hostPath:
     path: /opt/datadog-agent/run
  name: pointerdir
  1. Deploy
  2. Observe the pod failing to start, describe the pod

Describe the results you received: I found that it failed to start because it could not create the /opt/datadog-agent folder:

Normal   Created              7m (x3 over 8m)   kubelet  Created container
Warning  Failed               7m (x3 over 8m)   kubelet  Error: failed to start container "dd-agent": Error response from daemon: error while creating mount source path '/opt/datadog-agent/run': mkdir /opt/datadog-agent: read-only file system

This is because Kubernetes now mounts volumes as readonly by default (A change introduced in K8s 1.9). Their stance on it is that this was a bug and no apps should have ever had write access to volumes, which is why I created this as a bug.

Describe the results you expected: I expected it to mount the volume successfuly.

alphashuro avatar May 10 '18 04:05 alphashuro

facing this problem too

yansenarmandau avatar Jun 11 '18 15:06 yansenarmandau

Talked with their support and if you put the mount under /var/run/[something] it will somehow work

ghost avatar Jun 12 '18 08:06 ghost

👍 that fix is a little lame, can't they just add a PVC to the yaml to provision and mount a read/write volume.

JohnDzialo avatar Jul 06 '18 14:07 JohnDzialo

Also seeing this

Tyler-Churchill avatar Jan 18 '19 21:01 Tyler-Churchill

Still seeing this now. Fixed by changing /opt/datadog-agent/run to /var/run/datadog-agent 🤷‍♂

lyzs90 avatar Mar 25 '20 03:03 lyzs90