diff --git a/docs/user-guide/volumes.md b/docs/user-guide/volumes.md index 23b884d3bb..84ddfa99cb 100644 --- a/docs/user-guide/volumes.md +++ b/docs/user-guide/volumes.md @@ -117,6 +117,30 @@ Watch out when using this type of volume, because: behave differently on different nodes due to different files on the nodes * when Kubernetes adds resource-aware scheduling, as is planned, it will not be able to account for resources used by a `hostPath` +* the directories created on the underlying hosts are only writable by root, you either need + to run your process as root in a priveleged container or modify the file permissions on + the host to be able to write to a `hostPath` volume + +#### Example pod + +```yaml +apiVersion: v1 +kind: Pod +metadata: + name: test-pd +spec: + containers: + - image: gcr.io/google_containers/test-webserver + name: test-container + volumeMounts: + - mountPath: /test-pd + name: test-volume + volumes: + - name: test-volume + hostPath: + # directory location on host + path: /data +``` #### Example pod