-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathtemplate.yaml
173 lines (159 loc) · 4.55 KB
/
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
apiVersion: v1
kind: Template
labels:
template: telanlyt-api
metadata:
name: telanlyt-api
annotations:
description: A template that contains the deploymentconfig for telemetry analytics API server deployment.
objects:
- apiVersion: v1
kind: DeploymentConfig
metadata:
labels:
service: telanlyt-api
name: telanlyt-api
spec:
replicas: "${{REPLICAS}}"
selector:
service: telanlyt-api
template:
metadata:
labels:
service: telanlyt-api
spec:
containers:
- command:
- ./entrypoint.sh
envFrom:
- configMapRef:
name: telanlyt-config
- secretRef:
name: telanlyt-secrets
env:
- name: API_SERVER_PORT
value: ${API_SERVER_PORT}
- name: API_SERVER_TIMEOUT
value: ${API_SERVER_TIMEOUT}
- name: NUMBER_WORKER_PROCESS
value: ${NUMBER_WORKER_PROCESS}
- name: WORKER_TYPE
value: ${WORKER_TYPE}
- name: WORKER_CONNECTION_POOL_LIMIT
value: ${WORKER_CONNECTION_POOL_LIMIT}
image: "${DOCKER_REGISTRY}/${DOCKER_IMAGE}:${IMAGE_TAG}"
name: telanlyt-api
ports:
- containerPort: ${{API_SERVER_PORT}}
livenessProbe:
httpGet:
path: /api/v1/
port: ${{API_SERVER_PORT}}
initialDelaySeconds: 60
periodSeconds: 60
timeoutSeconds: 30
failureThreshold: 3
successThreshold: 1
readinessProbe:
httpGet:
path: /api/v1/readiness
port: ${{API_SERVER_PORT}}
failureThreshold: 3
successThreshold: 1
initialDelaySeconds: 60
periodSeconds: 60 # check whether DB is live once every minute.
timeoutSeconds: 30
resources:
requests:
cpu: ${CPU_REQUEST}
memory: ${MEMORY_REQUEST}
limits:
cpu: ${CPU_LIMIT}
memory: ${MEMORY_LIMIT}
- apiVersion: v1
kind: Service
metadata:
labels:
service: telanlyt-api
name: telanlyt-api
spec:
ports:
- port: ${{API_SERVER_PORT}}
name: "${API_SERVER_PORT}"
targetPort: ${{API_SERVER_PORT}}
protocol: TCP
selector:
service: telanlyt-api
- apiVersion: v1
kind: Route
metadata:
name: telanlyt-api
spec:
to:
kind: Service
name: telanlyt-api
parameters:
- description: CPU request
displayName: CPU request
required: true
name: CPU_REQUEST
value: "128m"
- description: CPU limit
displayName: CPU limit
required: true
name: CPU_LIMIT
value: "500m"
- description: Memory request
displayName: Memory request
required: true
name: MEMORY_REQUEST
value: "256Mi"
- description: Memory limit
displayName: Memory limit
required: true
name: MEMORY_LIMIT
value: "1Gi"
- description: Docker registry where the image is
displayName: Docker registry
required: true
name: DOCKER_REGISTRY
value: "quay.io"
- description: Docker image to use
displayName: Docker image
required: true
name: DOCKER_IMAGE
value: "rootavish/telanlyt-api"
- description: Image tag
displayName: Image tag
required: true
name: IMAGE_TAG
value: "latest"
- description: Number of deployment replicas
displayName: Number of deployment replicas
required: true
name: REPLICAS
value: "3"
- description: Port Number
displayName: Port Number
required: true
name: API_SERVER_PORT
value: "6006"
- description: The application gateway timeout for the apiserver for each request
displayName: API Server Timeout
name: API_SERVER_TIMEOUT
value: "90"
- description: Number of gunicorn worker processes
displayName: Number of worker processes
required: true
name: NUMBER_WORKER_PROCESS
value: "4"
- description: Type of gunicorn worker (sync/async)
displayName: Worker type
required: true
name: WORKER_TYPE
value: "gevent"
- description: Connection pool size for each gevent worker
displayName: Worker Pool Size
required: true
name: WORKER_CONNECTION_POOL_LIMIT
value: "1024"