-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtemplate.yml
137 lines (137 loc) · 3.17 KB
/
template.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
kind: Template
apiVersion: template.openshift.io/v1
parameters:
- name: APP
required: true
value: finbif-geo-convert
- name: PAGE_TITLE
required: true
value: "FinBIF Geo-convert"
- name: APP_PORT
required: true
value: "8000"
- name: APP_HEALTHCHECK
required: true
value: /healthz
- name: FILE_SIZE_LIMIT
required: true
value: "2e8"
- name: BRANCH
required: true
- name: MEMORY
required: true
- name: MAX_CHUNK_SIZE
required: true
- name: FINBIF_PRIVATE_API
required: true
- name: HOST
required: true
- name: SMTP_SERVER
required: true
- name: SMTP_PORT
required: true
- name: ERROR_EMAIL_TO
required: true
- name: ERROR_EMAIL_FROM
required: true
metadata:
name: ${APP}
objects:
- kind: Deployment
apiVersion: apps/v1
metadata:
name: ${APP}-${BRANCH}
labels:
app: ${APP}
spec:
replicas: 1
selector:
matchLabels:
app: ${APP}
strategy:
type: RollingUpdate
template:
metadata:
labels:
app: ${APP}
branch: ${BRANCH}
spec:
containers:
- image: ghcr.io/luomus/${APP}:${BRANCH}
imagePullPolicy: Always
name: ${APP}-${BRANCH}
ports:
- containerPort: ${{APP_PORT}}
startupProbe:
httpGet:
path: ${APP_HEALTHCHECK}
port: ${{APP_PORT}}
failureThreshold: 5
periodSeconds: 10
livenessProbe:
httpGet:
path: ${APP_HEALTHCHECK}
port: ${{APP_PORT}}
failureThreshold: 5
periodSeconds: 30
readinessProbe:
httpGet:
path: ${APP_HEALTHCHECK}
port: ${{APP_PORT}}
periodSeconds: 5
env:
- name: BRANCH
value: ${BRANCH}
- name: PAGE_TITLE
value: ${PAGE_TITLE}
- name: MAX_CHUNK_SIZE
value: ${MAX_CHUNK_SIZE}
- name: FINBIF_FILE_SIZE_LIMIT
value: ${FILE_SIZE_LIMIT}
- name: FINBIF_PRIVATE_API
value: ${FINBIF_PRIVATE_API}
- name: FINBIF_USE_PRIVATE_API
value: "true"
- name: FINBIF_USER_AGENT
value: https://github.com/luomus/${APP}:${BRANCH}
- name: SMTP_SERVER
value: ${SMTP_SERVER}
- name: SMTP_PORT
value: ${SMTP_PORT}
- name: ERROR_EMAIL_TO
value: ${ERROR_EMAIL_TO}
- name: ERROR_EMAIL_FROM
value: ${ERROR_EMAIL_FROM}
resources:
limits:
cpu: 500m
memory: ${MEMORY}
- kind: Service
apiVersion: v1
metadata:
name: ${APP}-${BRANCH}
labels:
app: ${APP}
spec:
ports:
- name: ${APP_PORT}
port: ${{APP_PORT}}
targetPort: ${{APP_PORT}}
selector:
app: ${APP}
branch: ${BRANCH}
- kind: Route
apiVersion: v1
metadata:
name: ${APP}-${BRANCH}
labels:
app: ${APP}
spec:
host: ${HOST}
port:
targetPort: ${{APP_PORT}}
to:
kind: Service
name: ${APP}-${BRANCH}
tls:
insecureEdgeTerminationPolicy: Redirect