-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvolume-gce-pd.yaml
More file actions
28 lines (25 loc) · 866 Bytes
/
volume-gce-pd.yaml
File metadata and controls
28 lines (25 loc) · 866 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
kind: Pod
apiVersion: v1
metadata:
name: gcepd-pod
spec:
# Volumes are declared by the pod. They share its lifecycle
# and are communal across containers.
volumes:
- name: gcepd-volume
# This GCE PD must already exist.
gcePersistentDisk:
pdName: my-data-disk
fsType: ext4
# Now, one of our containers can mount this volume and use it like
# any other directory.
containers:
- name: my-container
volumeMounts:
- name: gcepd-volume # This is the name of the volume we set at the pod level
mountPath: /var/simple # Where to mount this directory in our container
# Now that we have a directory mounted at /var/simple, let's
# write to a file inside it!
image: alpine
command: ["/bin/sh"]
args: ["-c", "while true; do date >> /var/simple/file.txt; sleep 5; done"]