1
0
mirror of https://github.com/openshift/openshift-docs.git synced 2026-02-07 00:48:01 +01:00
Files
openshift-docs/modules/persistent-storage-hostpath-pod.adoc
2020-12-08 15:49:51 -05:00

42 lines
1.2 KiB
Plaintext

// Module included in the following assemblies:
//
// * storage/persistent_storage/persistent-storage-hostpath.adoc
[id="persistent-storage-hostpath-pod_{context}"]
= Mounting the hostPath share in a privileged pod
After the persistent volume claim has been created, it can be used inside by an application. The following example demonstrates mounting this share inside of a pod.
.Prerequisites
* A persistent volume claim exists that is mapped to the underlying hostPath share.
.Procedure
* Create a privileged pod that mounts the existing persistent volume claim:
+
[source,yaml]
----
apiVersion: v1
kind: Pod
metadata:
name: pod-name <1>
spec:
containers:
...
securityContext:
privileged: true <2>
volumeMounts:
- mountPath: /data <3>
name: hostpath-privileged
...
securityContext: {}
volumes:
- name: hostpath-privileged
persistentVolumeClaim:
claimName: task-pvc-volume <4>
----
<1> The name of the pod.
<2> The pod must run as privileged to access the node's storage.
<3> The path to mount the hostPath share inside the privileged pod.
<4> The name of the `PersistentVolumeClaim` object that has been previously created.