generated from redhat-gpte-labs/bookbag-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
deploy-with-console-template.yaml
191 lines (183 loc) · 4.84 KB
/
deploy-with-console-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
---
apiVersion: template.openshift.io/v1
kind: Template
message: |
Created ${NAME} DeploymentConfig, ServiceAccount, Role, 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-demo
- name: IMAGE_STREAM_NAME
required: true
value: bookbag-demo
- name: IMAGE_STREAM_NAMESPACE
- name: IMAGE
value: set-by-trigger
- name: WORKSHOP_VARS
required: true
value: '{}'
- name: AUTH_USERNAME
required: true
value: '*'
- name: AUTH_PASSWORD
value: ''
- name: CONSOLE_IMAGE
value: quay.io/openshift/origin-console:4.5
required: true
- name: CONSOLE_BRANDING
value: openshift
required: true
- name: ROLE
description: >-
Role to assign to bookbag service account. Default, 'basic-user'.
Ex: admin, edit, view
required: true
value: edit
objects:
- 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}
initContainers:
- name: setup-console
image: ${IMAGE}
command:
- /opt/workshop/bin/setup-console.sh
volumeMounts:
- name: shared
mountPath: /var/run/workshop
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: CONSOLE_URL
value: http://0.0.0.0:10083
- name: OAUTH_SERVICE_ACCOUNT
value: ${NAME}
- name: DOWNLOAD_URL
- name: WORKSHOP_FILE
- 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:
- name: shared
mountPath: /var/run/workshop
- name: console
image: ${CONSOLE_IMAGE}
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: ${CONSOLE_BRANDING}
volumeMounts:
- name: shared
mountPath: /var/run/workshop
volumes:
- name: shared
emptyDir: {}
- apiVersion: v1
kind: ServiceAccount
metadata:
labels:
app: ${NAME}
name: ${NAME}
- apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ${NAME}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: ${ROLE}
subjects:
- kind: ServiceAccount
name: ${NAME}
- 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}