-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-template-new-pvc.yaml
180 lines (178 loc) · 4.32 KB
/
deploy-template-new-pvc.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
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
---
kind: Template
apiVersion: template.openshift.io/v1
metadata:
name: webdav-server-new-pvc
annotations:
openshift.io/display-name: Webdav Server with new PVC
description: Template for deploying a Webdav Server to allow you to map a PVC to your Windows machine as a drive. This template will create a new PVC.
iconClass: icon-node
tags: node,drive,pvc,mapping
parameters:
- name: APPLICATION_NAME
required: true
value: webdav-server
- name: VOLUME_SIZE
value: 5Gi
required: true
- name: WEBDAV_USER
value: 'coder'
description: Username for WebDav
- name: WEBDAV_PASS
from: '[A-Za-z0-9]{14}'
generate: expression
required: true
description: Password for WebDav
- name: WEBDAV_PATH
value: /opt/app-root/data
description: Path to share via WebDav
- name: WEBDAV_MEM_LIMIT
value: 256M
required: true
description: Consider the Pod Quota Limits on Your namespace
- name: WEBDAV_CPU_LIMIT
value: 300m
required: true
description: Consider the Pod Quota Limits on Your namespace
objects:
- kind: PersistentVolumeClaim
apiVersion: v1
metadata:
name: "${APPLICATION_NAME}-data"
labels:
app: "${APPLICATION_NAME}"
spec:
accessModes:
- ReadWriteMany
resources:
requests:
storage: "${VOLUME_SIZE}"
- kind: DeploymentConfig
apiVersion: apps.openshift.io/v1
metadata:
name: "${APPLICATION_NAME}"
labels:
app: "${APPLICATION_NAME}"
spec:
replicas: 1
selector:
app: "${APPLICATION_NAME}"
strategy:
rollingParams:
intervalSeconds: 1
maxSurge: 25%
maxUnavailable: 25%
timeoutSeconds: 600
updatePeriodSeconds: 1
type: Rolling
template:
metadata:
labels:
app: "${APPLICATION_NAME}"
deploymentconfig: "${APPLICATION_NAME}"
spec:
containers:
- name: webdav-server
image: ${APPLICATION_NAME}:latest
ports:
- containerPort: 8000
protocol: TCP
env:
- name: WEBDAV_USER
value: ${WEBDAV_USER}
- name: WEBDAV_PASS
value: ${WEBDAV_PASS}
- name: WEBDAV_PATH
value: ${WEBDAV_PATH}
resources:
limits:
cpu: ${WEBDAV_CPU_LIMIT}
memory: ${WEBDAV_MEM_LIMIT}
volumeMounts:
- mountPath: ${WEBDAV_PATH}
name: vol-webdav
volumes:
- name: vol-webdav
persistentVolumeClaim:
claimName: "${APPLICATION_NAME}-data"
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- webdav-server
from:
kind: ImageStreamTag
name: '${APPLICATION_NAME}:latest'
- kind: Service
apiVersion: v1
metadata:
name: "${APPLICATION_NAME}"
labels:
app: "${APPLICATION_NAME}"
spec:
ports:
- name: 8000-tcp
protocol: TCP
port: 8000
targetPort: 8000
selector:
app: "${APPLICATION_NAME}"
deploymentconfig: "${APPLICATION_NAME}"
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: "${APPLICATION_NAME}"
labels:
app: "${APPLICATION_NAME}"
spec:
host: ''
to:
kind: Service
name: "${APPLICATION_NAME}"
weight: 100
port:
targetPort: 8000-tcp
tls:
termination: edge
insecureEdgeTerminationPolicy: Redirect
- kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
annotations:
labels:
app: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
lookupPolicy:
local: true
- kind: BuildConfig
apiVersion: build.openshift.io/v1
metadata:
annotations:
labels:
app: ${APPLICATION_NAME}
name: ${APPLICATION_NAME}
spec:
output:
to:
kind: ImageStreamTag
name: '${APPLICATION_NAME}:latest'
runPolicy: Serial
source:
git:
ref: master
uri: 'https://github.com/happykow/webdav.git'
contextDir: /node
type: Git
strategy:
sourceStrategy:
from:
kind: ImageStreamTag
name: 'nodejs:10'
namespace: openshift
type: Source
triggers:
- type: ImageChange
- type: ConfigChange