-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcephfs-loop.yaml
More file actions
68 lines (68 loc) · 1.57 KB
/
cephfs-loop.yaml
File metadata and controls
68 lines (68 loc) · 1.57 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
---
apiVersion: v1
kind: Namespace
metadata:
name: my-rwx-storage
spec: {}
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-cephfs
namespace: my-rwx-storage
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: 20Gi
storageClassName: ocs-storagecluster-cephfs
---
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: pvc-cephrbd
namespace: my-rwx-storage
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 50Mi
storageClassName: ocs-storagecluster-ceph-rbd
---
apiVersion: batch/v1
kind: Job
metadata:
name: batch1
namespace: my-rwx-storage
labels:
app: batch1
spec:
template:
metadata:
labels:
app: batch1
spec:
restartPolicy: OnFailure
containers:
- name: batch1
image: amazon/aws-cli:latest
command: ["sh"]
args:
- '-c'
- 'while true; do echo "Creating temporary file"; export mystamp=$(date +%Y%m%d_%H%M%S); dd if=/dev/urandom of=/mnt/file_${mystamp} bs=1M count=1; echo "Copying temporary file"; cp /mnt/file_${mystamp} /tmp/file_${mystamp}; echo "Going to sleep"; sleep 60; echo "Removing temporary file"; rm /mnt/file_${mystamp}; done'
volumeMounts:
- name: tmp-store
mountPath: /tmp
- name: tmp-file
mountPath: /mnt
volumes:
- name: tmp-store
persistentVolumeClaim:
claimName: pvc-cephfs
readOnly: false
- name: tmp-file
persistentVolumeClaim:
claimName: pvc-cephrbd
readOnly: false