-
Notifications
You must be signed in to change notification settings - Fork 0
/
ocs4-block-test-template.yaml
92 lines (92 loc) · 2.12 KB
/
ocs4-block-test-template.yaml
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: ocs-block-template
objects:
- apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: ${PVC}
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 1Mi
storageClassName: ocs-storagecluster-ceph-rbd
- apiVersion: v1
kind: ReplicationController
metadata:
labels:
name: ${LABEL_NAME}
name: ${LABEL_NAME}
selector:
matchLabels:
name: ${LABEL_NAME}
spec:
replicas: 1
selector:
name: ${LABEL_NAME}
template:
metadata:
labels:
name: ${LABEL_NAME}
spec:
containers:
- image: quay.io/dmoessne/fedora-nginx:0.2
imagePullPolicy: IfNotPresent
name: ${LABEL_NAME}
ports:
- containerPort: 80
name: PORT
name: ${PORT}
protocol: TCP
volumeMounts:
- mountPath: /usr/share/nginx/html
name: ${PVC}
volumes:
- name: ${PVC}
persistentVolumeClaim:
claimName: ${PVC}
- apiVersion: v1
kind: Service
metadata:
annotations:
description: Exposes and load balances the application pods
name: ${LABEL_NAME}
spec:
ports:
- name: ${LABEL_NAME}
port: 80
targetPort: 80
selector:
name: ${LABEL_NAME}
- apiVersion: v1
kind: Route
metadata:
annotations:
template.openshift.io/expose-uri: http://{.spec.host}{.spec.path}
name: ${LABEL_NAME}
spec:
host: ${APP_DOM}
port:
targetPort: 80
to:
kind: Service
name: ${LABEL_NAME}
parameters:
- name: PVC
description: random pvc number
generate: expression
from: "ngx-bk-[a-z0-9]{4}-pod"
- name: LABEL_NAME
description: random label name
generate: expression
from: "ngx-bk-[a-z0-9]{4}-pod"
- name: PORT
description: random label name
generate: expression
from: "ngx-bk-[a-z0-9]{4}-pod"
- name: APP_DOM
description: The exposed hostname that will route to the nginx service, if left blank a value will be defaulted.
displayName: Application Hostname