-
Notifications
You must be signed in to change notification settings - Fork 7
/
openshift.yml
248 lines (247 loc) · 7.16 KB
/
openshift.yml
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
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
apiVersion: v1
kind: Template
metadata:
name: quayio-service-tool
parameters:
- name: QUAY_SERVICE_TOOL_CONFIG_SECRET
value: "quay-service-tool-config"
required: true
- name: IMAGE
value: "quay.io/app-sre/quayio-service-tool"
required: true
- name: IMAGE_TAG
value: ""
required: true
- name: ACTIVE_DEADLINE_SECONDS
value: "600"
required: true
- name: CONFIG_MOUNT_PATH
value: "/config"
required: true
- name: SYSLOG_IMAGE
value: ""
displayName: syslog-cloudwatch-bridge image
description: syslog-cloudwatch-bridge docker image.
- name: SYSLOG_IMAGE_TAG
value: ""
displayName: syslog-cloudwatch-bridge version
description: syslog-cloudwatch-bridge version
- name: SYSLOG_PORT
value: "5014"
displayName: syslog port
- name: TICKER_TIME
value: "200"
- name: CLOUDWATCH_SECRET
value: "quay-cloudwatch-iam-user"
displayName: cloudwatch iam user creds secret
- name: LOG_GROUP_NAME
value: "quay-service-tool-stage-audit"
- name: QUAY_SYSLOG_CPU_LIMIT
value: "1"
displayName: "quay syslog CPU limit"
- name: QUAY_SYSLOG_MEMORY_LIMIT
value: "2Gi"
displayName: "quay syslog memory limit"
- name: QUAY_SYSLOG_CPU_REQUEST
value: "1"
displayName: "quay syslog CPU request"
- name: QUAY_SYSLOG_MEMORY_REQUEST
value: "1Gi"
displayName: "quay syslog memory request"
- name: QUAY_SYSLOG_READINESS_PROBE_INITIAL_DELAY_SECONDS
value: "15"
displayName: quay syslog readiness probe initial delay seconds
- name: QUAY_SYSLOG_READINESS_PROBE_PERIOD_SECONDS
value: "30"
displayName: quay syslog readiness probe period seconds
- name: QUAY_SYSLOG_READINESS_PROBE_TIMEOUT_SECONDS
value: "5"
displayName: quay syslog readiness probe timeout
- name: QUAY_SYSLOG_LIVENESS_PROBE_INITIAL_DELAY_SECONDS
value: "30"
displayName: quay syslog liveness probe initial delay seconds
- name: QUAY_SYSLOG_LIVENESS_PROBE_PERIOD_SECONDS
value: "15"
displayName: quay syslog liveness probe period seconds
- name: QUAY_SYSLOG_LIVENESS_PROBE_TIMEOUT_SECONDS
value: "5"
displayName: quay syslog liveness probe timeout
- name: SYSLOG_SERVER
value: "localhost"
displayName: syslog server
- name: SYSLOG_PROTO
value: "udp"
displayName: syslog protocol
- name: QUAY_APP_COMPONENT_ANNOTATIONS_KEY
value: "quay-service-tool-app-deployment"
displayName: quay service tool app annotation
- name: QUAY_APP_COMPONENT_ANNOTATIONS_VALUE
value: "update_me_when_secret_changes"
displayName: quay service tool app annotation value
- name: REPLICAS
value: "1"
displayName: replicas for the deployment
objects:
- apiVersion: apps/v1
kind: Deployment
metadata:
name: quayio-service-tool
labels:
app: quayio-service-tool
spec:
replicas: ${{REPLICAS}}
selector:
matchLabels:
app: quayio-service-tool
template:
metadata:
labels:
app: quayio-service-tool
annotations:
${{QUAY_APP_COMPONENT_ANNOTATIONS_KEY}}: ${{QUAY_APP_COMPONENT_ANNOTATIONS_VALUE}}
spec:
volumes:
- name: config
secret:
secretName: ${{QUAY_SERVICE_TOOL_CONFIG_SECRET}}
containers:
- name: syslog-cloudwatch-bridge
image: ${SYSLOG_IMAGE}:${SYSLOG_IMAGE_TAG}
ports:
- containerPort: ${{SYSLOG_PORT}}
protocol: UDP
name: syslog-udp-port
- containerPort: ${{SYSLOG_PORT}}
protocol: TCP
name: syslog-tcp-port
env:
- name: STREAM_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: TICKER_TIME
value: ${TICKER_TIME}
- name: PORT
value: ${SYSLOG_PORT}
- name: AWS_REGION
valueFrom:
secretKeyRef:
name: ${{CLOUDWATCH_SECRET}}
key: AWS_REGION
- name: AWS_ACCESS_KEY_ID
valueFrom:
secretKeyRef:
name: ${{CLOUDWATCH_SECRET}}
key: AWS_ACCESS_KEY_ID
- name: AWS_SECRET_ACCESS_KEY
valueFrom:
secretKeyRef:
name: ${{CLOUDWATCH_SECRET}}
key: AWS_SECRET_ACCESS_KEY
- name: LOG_GROUP_NAME
valueFrom:
secretKeyRef:
name: ${{CLOUDWATCH_SECRET}}
key: LOG_GROUP_NAME
resources:
limits:
cpu: ${{QUAY_SYSLOG_CPU_LIMIT}}
memory: ${{QUAY_SYSLOG_MEMORY_LIMIT}}
requests:
cpu: ${{QUAY_SYSLOG_CPU_REQUEST}}
memory: ${{QUAY_SYSLOG_MEMORY_REQUEST}}
readinessProbe:
tcpSocket:
port: ${{SYSLOG_PORT}}
initialDelaySeconds: ${{QUAY_SYSLOG_READINESS_PROBE_INITIAL_DELAY_SECONDS}}
periodSeconds: ${{QUAY_SYSLOG_READINESS_PROBE_PERIOD_SECONDS}}
timeoutSeconds: ${{QUAY_SYSLOG_READINESS_PROBE_TIMEOUT_SECONDS}}
livenessProbe:
tcpSocket:
port: ${{SYSLOG_PORT}}
initialDelaySeconds: ${{QUAY_SYSLOG_LIVENESS_PROBE_INITIAL_DELAY_SECONDS}}
periodSeconds: ${{QUAY_SYSLOG_LIVENESS_PROBE_PERIOD_SECONDS}}
timeoutSeconds: ${{QUAY_SYSLOG_LIVENESS_PROBE_TIMEOUT_SECONDS}}
- name: quayio-service-tool
image: ${IMAGE}:${IMAGE_TAG}
command:
- /conf/entrypoint.sh
volumeMounts:
- name: config
mountPath: ${{CONFIG_MOUNT_PATH}}
readOnly: true
ports:
- containerPort: 5000
resources:
limits:
cpu: 100m
memory: 128Mi
requests:
cpu: 100m
memory: 128Mi
env:
- name: CONFIG_PATH
value: ${{CONFIG_MOUNT_PATH}}
- name: SYSLOG_SERVER
value: ${{SYSLOG_SERVER}}
- name: SYSLOG_PORT
value: ${SYSLOG_PORT}
- name: SYSLOG_PROTO
value: ${{SYSLOG_PROTO}}
livenessProbe:
httpGet:
path: /healthcheck
port: 5000
failureThreshold: 3
initialDelaySeconds: 30
timeoutSeconds: 30
periodSeconds: 30
readinessProbe:
httpGet:
path: /healthcheck
port: 5000
failureThreshold: 3
timeoutSeconds: 30
initialDelaySeconds: 30
periodSeconds: 30
- apiVersion: v1
kind: Service
metadata:
name: quayio-service-tool
labels:
run: quayio-service-tool
spec:
ports:
- name: http
port: 80
targetPort: 5000
selector:
app: quayio-service-tool
- apiVersion: v1
kind: Service
metadata:
name: quayio-service-tool-load-balancer
labels:
run: quayio-service-tool-load-balancer
spec:
ports:
- name: http
port: 80
targetPort: 5000
type: LoadBalancer
selector:
app: quayio-service-tool
- apiVersion: v1
kind: NetworkPolicy
apiVersion: networking.k8s.io/v1
metadata:
name: quayio-service-tool-allow-external
spec:
podSelector:
matchLabels:
app: quayio-service-tool
ingress:
- {}
policyTypes:
- Ingress