generated from redhat-gpte-devopsautomation/bookbag-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-template.yaml
211 lines (203 loc) · 5.38 KB
/
deploy-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
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
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
---
apiVersion: template.openshift.io/v1
kind: Template
message: |
Created ${NAME} Deployment, Service, and Route
metadata:
annotations:
openshift.io/display-name: Bookbag
tags: gpte
template.openshift.io/bindable: "false"
name: bookbag
parameters:
- name: NAME
required: true
value: bookbag
- name: IMAGE_STREAM_NAME
required: true
value: bookbag
- name: IMAGE_STREAM_NAMESPACE
- name: IMAGE
value: set-by-trigger
- name: OPENSHIFT_CONSOLE_IMAGE
required: true
value: quay.io/openshift/origin-console:4.2
- name: WORKSHOP_VARS
required: true
value: '{}'
- name: AUTH_USERNAME
required: true
value: '*'
- name: AUTH_PASSWORD
value: ''
objects:
- apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: ${NAME}
name: ${NAME}
- apiVersion: v1
kind: RoleBinding
metadata:
labels:
app: ${NAME}
name: ${NAME}
roleRef:
name: admin
subjects:
- kind: ServiceAccount
name: ${NAME}
- apiVersion: apps.openshift.io/v1
kind: DeploymentConfig
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
replicas: 1
selector:
name: ${NAME}
strategy:
type: Recreate
triggers:
- type: ConfigChange
- type: ImageChange
imageChangeParams:
automatic: true
containerNames:
- setup-console
- terminal
from:
kind: ImageStreamTag
name: ${IMAGE_STREAM_NAME}:latest
namespace: ${IMAGE_STREAM_NAMESPACE}
template:
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
dnsPolicy: ClusterFirst
restartPolicy: Always
serviceAccountName: ${NAME}
volumes:
- name: envvars
configMap:
defaultMode: 0644
name: ${NAME}-env
- name: shared
emptyDir: {}
initContainers:
- name: setup-console
command:
- /opt/workshop/bin/setup-console.sh
env:
- name: CLUSTER_SUBDOMAIN
- name: OPENSHIFT_PROJECT
- name: OPENSHIFT_USERNAME
- name: OPENSHIFT_PASSWORD
- name: OPENSHIFT_TOKEN
- name: OC_VERSION
- name: ODO_VERSION
- name: KUBECTL_VERSION
image: ${IMAGE}
imagePullPolicy: IfNotPresent
resources: {}
volumeMounts:
- mountPath: /var/run/workshop
name: shared
containers:
- name: terminal
env:
- name: APPLICATION_NAME
value: ${NAME}
- name: AUTH_USERNAME
value: ${AUTH_USERNAME}
- name: AUTH_PASSWORD
value: ${AUTH_PASSWORD}
- name: CLUSTER_SUBDOMAIN
- name: OAUTH_SERVICE_ACCOUNT
value: ${NAME}
- name: DOWNLOAD_URL
- name: WORKSHOP_FILE
- name: CONSOLE_URL
value: http://0.0.0.0:10083
- name: OC_VERSION
- name: ODO_VERSION
- name: KUBECTL_VERSION
- name: WORKSHOP_VARS
value: ${WORKSHOP_VARS}
image: ${IMAGE}
imagePullPolicy: IfNotPresent
ports:
- containerPort: 10080
protocol: TCP
resources: {}
volumeMounts:
- mountPath: /opt/workshop/envvars
name: envvars
- mountPath: /var/run/workshop
name: shared
- name: console
command:
- /var/run/workshop/start-console.sh
env:
- name: BRIDGE_K8S_MODE
value: in-cluster
- name: BRIDGE_LISTEN
value: http://0.0.0.0:10083
- name: BRIDGE_BASE_PATH
value: /console/
- name: BRIDGE_PUBLIC_DIR
value: /opt/bridge/static
- name: BRIDGE_USER_AUTH
value: disabled
- name: BRIDGE_BRANDING
value: openshift
image: ${OPENSHIFT_CONSOLE_IMAGE}
imagePullPolicy: IfNotPresent
resources: {}
volumeMounts:
- mountPath: /var/run/workshop
name: shared
- apiVersion: v1
kind: Service
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
ports:
- name: 10080-tcp
port: 10080
protocol: TCP
targetPort: 10080
selector:
name: ${NAME}
type: ClusterIP
- apiVersion: route.openshift.io/v1
kind: Route
metadata:
labels:
app: ${NAME}
name: ${NAME}
spec:
port:
targetPort: 10080-tcp
tls:
insecureEdgeTerminationPolicy: Redirect
termination: edge
to:
kind: Service
name: ${NAME}
- apiVersion: v1
data:
gateway.sh: ""
terminal.sh: ""
workshop.sh: ""
kind: ConfigMap
metadata:
labels:
app: ${NAME}
name: ${NAME}-env