-
-
Notifications
You must be signed in to change notification settings - Fork 240
/
Copy pathpuppetboard-s2i-template.yaml
182 lines (181 loc) · 4.97 KB
/
puppetboard-s2i-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
apiVersion: template.openshift.io/v1
kind: Template
metadata:
name: puppetboard-template
objects:
- kind: ImageStream
apiVersion: image.openshift.io/v1
metadata:
annotations:
labels:
app: ${PUPPETBOARD_SERVICE_NAME}
name: ${PUPPETBOARD_SERVICE_NAME}
spec:
lookupPolicy:
local: false
- kind: "BuildConfig"
apiVersion: build.openshift.io/v1
metadata:
name: "${PUPPETBOARD_SERVICE_NAME}"
generation: 2
labels:
app: ${PUPPETBOARD_SERVICE_NAME}
spec:
failedBuildsHistoryLimit: 5
nodeSelector: null
runPolicy: "Serial"
triggers:
- type: "GitHub"
github:
secret: "secret101"
- type: "Generic"
generic:
secret: "secret101"
- type: "ConfigChange"
- type: "ImageChange"
imageChange: {}
source:
git:
uri: ${PUPPETBOARD_SOURCE_REPOSITORY_URL}
ref: ${PUPPETBOARD_SOURCE_REPOSITORY_REF}
type: Git
strategy:
dockerStragegy:
from:
kind: "ImageStreamTag"
name: python:3.12-alpine
type: Docker
output:
to:
kind: "ImageStreamTag"
name: "${PUPPETBOARD_SERVICE_NAME}:latest"
successfulBuildsHistoryLimit: 5
- kind: "DeploymentConfig"
apiVersion: "v1"
metadata:
name: "${PUPPETBOARD_SERVICE_NAME}"
labels:
app: ${PUPPETBOARD_SERVICE_NAME}
spec:
template:
metadata:
labels:
name: "${PUPPETBOARD_SERVICE_NAME}"
app: ${PUPPETBOARD_SERVICE_NAME}
spec:
containers:
- name: "${PUPPETBOARD_SERVICE_NAME}"
imagePullPolicy: Always
ports:
- containerPort: ${{PUPPETDB_PORT}}
protocol: "TCP"
env:
- name: PUPPETDB_HOST
value: ${PUPPETDB_HOST}
- name: PUPPETDB_PORT
value: "${PUPPETDB_PORT}"
- name: SECRET_KEY
value: ${PUPPETBOARD_SECRET_KEY}
- name: PUPPETBOARD_PORT
value: "${PUPPETBOARD_PORT}"
restartPolicy: Always
replicas: 3
triggers:
- type: "ConfigChange"
- type: "ImageChange"
imageChangeParams:
automatic: true
containerNames:
- "${PUPPETBOARD_SERVICE_NAME}"
from:
kind: "ImageStreamTag"
name: "${PUPPETBOARD_SERVICE_NAME}:latest"
strategy:
type: "Rolling"
paused: false
revisionHistoryLimit: 2
minReadySeconds: 0
- kind: Service
apiVersion: v1
metadata:
annotations:
name: ${PUPPETBOARD_SERVICE_NAME}
labels:
app: ${PUPPETBOARD_SERVICE_NAME}
spec:
ports:
# TODO: This is kinda confusing.
- name: "${SERVICE_PORT}-tcp"
protocol: TCP
port: ${{SERVICE_PORT}}
targetPort: ${{PUPPETBOARD_PORT}}
selector:
app: ${PUPPETBOARD_SERVICE_NAME}
type: ClusterIP
sessionAffinity: None
- kind: Route
apiVersion: route.openshift.io/v1
metadata:
name: ${PUPPETBOARD_SERVICE_NAME}
labels:
app: ${PUPPETBOARD_SERVICE_NAME}
annotations:
spec:
to:
kind: Service
name: ${PUPPETBOARD_SERVICE_NAME}
weight: 100
port:
targetPort: "${SERVICE_PORT}-tcp"
tls:
termination: edge
wildcardPolicy: None
parameters:
- description: The name of the OpenShift Service exposed for Puppetboard.
displayName: Puppetboard Service Name
name: PUPPETBOARD_SERVICE_NAME
required: true
value: puppetboard
# These values are passed to the Docker container. They are not
# used in the building of the OpenShift app. They are passed via environment
# variables in the DeploymentConfig section above.
- description: Remote server where PuppetDB is running.
displayName: PuppetDB Remote Server
from: '[a-zA-Z0-9]'
name: PUPPETDB_HOST
required: true
value: puppetdb
- description: The remote port on the PuppetDB server where Postgresql is listening.
displayName: PuppetDB port
name: PUPPETDB_PORT
required: true
type: integer
value: "8080"
- description: Secret Key for the Puppetboard.
displayName: Puppetboard Secret Key
from: '[a-zA-Z0-9]'
name: PUPPETBOARD_SECRET_KEY
required: true
value: Secr3t_K3y
- description: The port on which the Puppetboard server offers up the web interface.
displayName: Puppetboard Port
name: PUPPETBOARD_PORT
required: true
value: "1024"
type: integer
- description: The port on which OpenShift offers the Puppetboard service.
displayName: OpenShift Service Port
name: SERVICE_PORT
required: true
value: "80"
type: integer
- description: The URL of the repository with the Puppetboard application code.
displayName: Puppetboard Repository URL
name: PUPPETBOARD_SOURCE_REPOSITORY_URL
required: true
value: https://github.com/voxpupuli/puppetboard.git
- description: The branch name, tag or other ref of the PUPPETBOARD_SOURCE_REPOSITORY_URL.
displayName: Puppetboard Repository Ref
name: PUPPETBOARD_SOURCE_REPOSITORY_REF
required: true
value: "master"