Commit 4fd263d3ea1e2697dcd7d13901c976875605932c
1 parent
0d0cdb8d
moved thirdparty services to a separate file
Showing
3 changed files
with
9 additions
and
305 deletions
... | ... | @@ -13,298 +13,6 @@ |
13 | 13 | # See the License for the specific language governing permissions and |
14 | 14 | # limitations under the License. |
15 | 15 | # |
16 | - | |
17 | -apiVersion: apps/v1 | |
18 | -kind: StatefulSet | |
19 | -metadata: | |
20 | - name: zookeeper | |
21 | - namespace: thingsboard | |
22 | -spec: | |
23 | - serviceName: "zookeeper" | |
24 | - replicas: 3 | |
25 | - podManagementPolicy: Parallel | |
26 | - selector: | |
27 | - matchLabels: | |
28 | - app: zookeeper | |
29 | - template: | |
30 | - metadata: | |
31 | - labels: | |
32 | - app: zookeeper | |
33 | - spec: | |
34 | - containers: | |
35 | - - name: zookeeper | |
36 | - imagePullPolicy: Always | |
37 | - image: zookeeper:3.5 | |
38 | - ports: | |
39 | - - containerPort: 2181 | |
40 | - name: client | |
41 | - - containerPort: 2888 | |
42 | - name: server | |
43 | - - containerPort: 3888 | |
44 | - name: election | |
45 | - readinessProbe: | |
46 | - periodSeconds: 60 | |
47 | - tcpSocket: | |
48 | - port: 2181 | |
49 | - livenessProbe: | |
50 | - periodSeconds: 60 | |
51 | - tcpSocket: | |
52 | - port: 2181 | |
53 | - env: | |
54 | - - name: ZOO_SERVERS | |
55 | - value: "server.0=zookeeper-0.zookeeper:2888:3888;2181 server.1=zookeeper-1.zookeeper:2888:3888;2181 server.2=zookeeper-2.zookeeper:2888:3888;2181" | |
56 | - - name: JVMFLAGS | |
57 | - value: "-Dzookeeper.electionPortBindRetry=0" | |
58 | - volumeMounts: | |
59 | - - name: data | |
60 | - mountPath: /data | |
61 | - readOnly: false | |
62 | - initContainers: | |
63 | - - command: | |
64 | - - /bin/bash | |
65 | - - -c | |
66 | - - |- | |
67 | - set -ex; | |
68 | - mkdir -p "$ZOO_DATA_LOG_DIR" "$ZOO_DATA_DIR" "$ZOO_CONF_DIR"; | |
69 | - chown "$ZOO_USER:$ZOO_USER" "$ZOO_DATA_LOG_DIR" "$ZOO_DATA_DIR" "$ZOO_CONF_DIR" | |
70 | - if [[ ! -f "$ZOO_DATA_DIR/myid" ]]; then | |
71 | - echo $HOSTNAME| rev | cut -d "-" -f1 | rev > "$ZOO_DATA_DIR/myid" | |
72 | - fi | |
73 | - env: | |
74 | - - name: HOSTNAME | |
75 | - valueFrom: | |
76 | - fieldRef: | |
77 | - fieldPath: metadata.name | |
78 | - image: zookeeper:3.5 | |
79 | - imagePullPolicy: IfNotPresent | |
80 | - name: zookeeper-init | |
81 | - securityContext: | |
82 | - runAsUser: 0 | |
83 | - volumeMounts: | |
84 | - - name: data | |
85 | - mountPath: /data | |
86 | - readOnly: false | |
87 | - volumeClaimTemplates: | |
88 | - - metadata: | |
89 | - name: data | |
90 | - spec: | |
91 | - accessModes: [ "ReadWriteOnce" ] | |
92 | - resources: | |
93 | - requests: | |
94 | - storage: 1Gi | |
95 | ---- | |
96 | -apiVersion: v1 | |
97 | -kind: Service | |
98 | -metadata: | |
99 | - name: zookeeper | |
100 | - namespace: thingsboard | |
101 | -spec: | |
102 | - type: ClusterIP | |
103 | - ports: | |
104 | - - port: 2181 | |
105 | - targetPort: 2181 | |
106 | - name: client | |
107 | - - port: 2888 | |
108 | - targetPort: 2888 | |
109 | - name: server | |
110 | - - port: 3888 | |
111 | - targetPort: 3888 | |
112 | - name: election | |
113 | - selector: | |
114 | - app: zookeeper | |
115 | ---- | |
116 | -apiVersion: apps/v1 | |
117 | -kind: StatefulSet | |
118 | -metadata: | |
119 | - name: tb-kafka | |
120 | - namespace: thingsboard | |
121 | -spec: | |
122 | - serviceName: "tb-kafka" | |
123 | - replicas: 3 | |
124 | - podManagementPolicy: OrderedReady | |
125 | - selector: | |
126 | - matchLabels: | |
127 | - app: tb-kafka | |
128 | - template: | |
129 | - metadata: | |
130 | - labels: | |
131 | - app: tb-kafka | |
132 | - spec: | |
133 | - containers: | |
134 | - - name: tb-kafka | |
135 | - imagePullPolicy: Always | |
136 | - image: wurstmeister/kafka:2.12-2.2.1 | |
137 | - ports: | |
138 | - - containerPort: 9092 | |
139 | - name: kafka-int | |
140 | - - containerPort: 9093 | |
141 | - name: kafka-ext | |
142 | - readinessProbe: | |
143 | - periodSeconds: 5 | |
144 | - timeoutSeconds: 5 | |
145 | - tcpSocket: | |
146 | - port: 9092 | |
147 | - initialDelaySeconds: 60 | |
148 | - livenessProbe: | |
149 | - timeoutSeconds: 5 | |
150 | - periodSeconds: 5 | |
151 | - tcpSocket: | |
152 | - port: 9092 | |
153 | - initialDelaySeconds: 80 | |
154 | - env: | |
155 | - - name: BROKER_ID_COMMAND | |
156 | - value: "hostname | cut -d'-' -f3" | |
157 | - - name: KAFKA_ZOOKEEPER_CONNECT | |
158 | - value: "zookeeper:2181" | |
159 | - - name: KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS | |
160 | - value: "60000" | |
161 | - - name: KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE | |
162 | - value: "true" | |
163 | - - name: KAFKA_LISTENERS | |
164 | - value: "INSIDE://:9092,OUTSIDE://:9093" | |
165 | - - name: KAFKA_ADVERTISED_LISTENERS | |
166 | - value: "INSIDE://:9092,OUTSIDE://:9093" | |
167 | - - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP | |
168 | - value: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT" | |
169 | - - name: KAFKA_INTER_BROKER_LISTENER_NAME | |
170 | - value: "INSIDE" | |
171 | - - name: KAFKA_CONTROLLER_SHUTDOWN_ENABLE | |
172 | - value: "true" | |
173 | - - name: KAFKA_CREATE_TOPICS | |
174 | - value: "js.eval.requests:100:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.transport.api.requests:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.rule-engine:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600" | |
175 | - - name: KAFKA_AUTO_CREATE_TOPICS_ENABLE | |
176 | - value: "false" | |
177 | - - name: KAFKA_LOG_RETENTION_BYTES | |
178 | - value: "1073741824" | |
179 | - - name: KAFKA_LOG_SEGMENT_BYTES | |
180 | - value: "268435456" | |
181 | - - name: KAFKA_LOG_RETENTION_MS | |
182 | - value: "300000" | |
183 | - - name: KAFKA_LOG_CLEANUP_POLICY | |
184 | - value: "delete" | |
185 | - - name: KAFKA_PORT | |
186 | - value: "9092" | |
187 | - - name: KAFKA_LOG_DIRS | |
188 | - value: "/kafka-logs" | |
189 | - volumeMounts: | |
190 | - - name: logs | |
191 | - mountPath: /kafka-logs | |
192 | - subPath: logs | |
193 | - volumeClaimTemplates: | |
194 | - - metadata: | |
195 | - name: logs | |
196 | - spec: | |
197 | - accessModes: | |
198 | - - ReadWriteOnce | |
199 | - resources: | |
200 | - requests: | |
201 | - storage: 10Gi | |
202 | ---- | |
203 | -apiVersion: v1 | |
204 | -kind: Service | |
205 | -metadata: | |
206 | - name: tb-kafka | |
207 | - namespace: thingsboard | |
208 | -spec: | |
209 | - type: ClusterIP | |
210 | - ports: | |
211 | - - port: 9092 | |
212 | - targetPort: 9092 | |
213 | - name: kafka-int | |
214 | - - port: 9093 | |
215 | - targetPort: 9093 | |
216 | - name: kafka-ext | |
217 | - selector: | |
218 | - app: tb-kafka | |
219 | ---- | |
220 | -apiVersion: v1 | |
221 | -kind: ConfigMap | |
222 | -metadata: | |
223 | - name: tb-redis | |
224 | - namespace: thingsboard | |
225 | -data: | |
226 | - update-node.sh: | | |
227 | - #!/bin/sh | |
228 | - REDIS_NODES="/data/nodes.conf" | |
229 | - sed -i -e "/myself/ s/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/${POD_IP}/" ${REDIS_NODES} | |
230 | - exec "$@" | |
231 | - redis.conf: |+ | |
232 | - cluster-enabled yes | |
233 | - cluster-require-full-coverage no | |
234 | - cluster-node-timeout 15000 | |
235 | - cluster-config-file /data/nodes.conf | |
236 | - cluster-migration-barrier 1 | |
237 | - appendonly yes | |
238 | - protected-mode no | |
239 | ---- | |
240 | -apiVersion: apps/v1 | |
241 | -kind: StatefulSet | |
242 | -metadata: | |
243 | - name: tb-redis | |
244 | - namespace: thingsboard | |
245 | -spec: | |
246 | - serviceName: server | |
247 | - replicas: 6 | |
248 | - selector: | |
249 | - matchLabels: | |
250 | - app: tb-redis | |
251 | - template: | |
252 | - metadata: | |
253 | - labels: | |
254 | - app: tb-redis | |
255 | - spec: | |
256 | - containers: | |
257 | - - name: redis | |
258 | - image: redis:5.0.1-alpine | |
259 | - ports: | |
260 | - - containerPort: 6379 | |
261 | - name: client | |
262 | - - containerPort: 16379 | |
263 | - name: gossip | |
264 | - command: ["/conf/update-node.sh", "redis-server", "/conf/redis.conf"] | |
265 | - env: | |
266 | - - name: POD_IP | |
267 | - valueFrom: | |
268 | - fieldRef: | |
269 | - fieldPath: status.podIP | |
270 | - volumeMounts: | |
271 | - - name: conf | |
272 | - mountPath: /conf | |
273 | - readOnly: false | |
274 | - - name: data | |
275 | - mountPath: /data | |
276 | - readOnly: false | |
277 | - volumes: | |
278 | - - name: conf | |
279 | - configMap: | |
280 | - name: tb-redis | |
281 | - defaultMode: 0755 | |
282 | - volumeClaimTemplates: | |
283 | - - metadata: | |
284 | - name: data | |
285 | - spec: | |
286 | - accessModes: [ "ReadWriteOnce" ] | |
287 | - resources: | |
288 | - requests: | |
289 | - storage: 1Gi | |
290 | ---- | |
291 | -apiVersion: v1 | |
292 | -kind: Service | |
293 | -metadata: | |
294 | - name: tb-redis | |
295 | - namespace: thingsboard | |
296 | -spec: | |
297 | - type: ClusterIP | |
298 | - ports: | |
299 | - - port: 6379 | |
300 | - targetPort: 6379 | |
301 | - name: client | |
302 | - - port: 16379 | |
303 | - targetPort: 16379 | |
304 | - name: gossip | |
305 | - selector: | |
306 | - app: tb-redis | |
307 | ---- | |
308 | 16 | apiVersion: apps/v1 |
309 | 17 | kind: Deployment |
310 | 18 | metadata: | ... | ... |
... | ... | @@ -90,7 +90,7 @@ spec: |
90 | 90 | accessModes: [ "ReadWriteOnce" ] |
91 | 91 | resources: |
92 | 92 | requests: |
93 | - storage: 1Gi | |
93 | + storage: 100Mi | |
94 | 94 | --- |
95 | 95 | apiVersion: v1 |
96 | 96 | kind: Service |
... | ... | @@ -120,7 +120,7 @@ metadata: |
120 | 120 | spec: |
121 | 121 | serviceName: "tb-kafka" |
122 | 122 | replicas: 3 |
123 | - podManagementPolicy: OrderedReady | |
123 | + podManagementPolicy: Parallel | |
124 | 124 | selector: |
125 | 125 | matchLabels: |
126 | 126 | app: tb-kafka |
... | ... | @@ -136,8 +136,6 @@ spec: |
136 | 136 | ports: |
137 | 137 | - containerPort: 9092 |
138 | 138 | name: kafka-int |
139 | - - containerPort: 9093 | |
140 | - name: kafka-ext | |
141 | 139 | readinessProbe: |
142 | 140 | periodSeconds: 5 |
143 | 141 | timeoutSeconds: 5 |
... | ... | @@ -160,17 +158,17 @@ spec: |
160 | 158 | - name: KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE |
161 | 159 | value: "true" |
162 | 160 | - name: KAFKA_LISTENERS |
163 | - value: "INSIDE://:9092,OUTSIDE://:9093" | |
161 | + value: "INSIDE://:9092" | |
164 | 162 | - name: KAFKA_ADVERTISED_LISTENERS |
165 | - value: "INSIDE://:9092,OUTSIDE://:9093" | |
163 | + value: "INSIDE://:9092" | |
166 | 164 | - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP |
167 | - value: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT" | |
165 | + value: "INSIDE:PLAINTEXT" | |
168 | 166 | - name: KAFKA_INTER_BROKER_LISTENER_NAME |
169 | 167 | value: "INSIDE" |
170 | 168 | - name: KAFKA_CONTROLLER_SHUTDOWN_ENABLE |
171 | 169 | value: "true" |
172 | 170 | - name: KAFKA_CREATE_TOPICS |
173 | - value: "js.eval.requests:100:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.transport.api.requests:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb.rule-engine:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600" | |
171 | + value: "js_eval.requests:100:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600,tb_transport.api.requests:30:1:delete --config=retention.ms=60000 --config=segment.bytes=26214400 --config=retention.bytes=104857600" | |
174 | 172 | - name: KAFKA_AUTO_CREATE_TOPICS_ENABLE |
175 | 173 | value: "false" |
176 | 174 | - name: KAFKA_LOG_RETENTION_BYTES |
... | ... | @@ -197,7 +195,7 @@ spec: |
197 | 195 | - ReadWriteOnce |
198 | 196 | resources: |
199 | 197 | requests: |
200 | - storage: 10Gi | |
198 | + storage: 1Gi | |
201 | 199 | --- |
202 | 200 | apiVersion: v1 |
203 | 201 | kind: Service |
... | ... | @@ -210,9 +208,6 @@ spec: |
210 | 208 | - port: 9092 |
211 | 209 | targetPort: 9092 |
212 | 210 | name: kafka-int |
213 | - - port: 9093 | |
214 | - targetPort: 9093 | |
215 | - name: kafka-ext | |
216 | 211 | selector: |
217 | 212 | app: tb-kafka |
218 | 213 | --- |
... | ... | @@ -285,7 +280,7 @@ spec: |
285 | 280 | accessModes: [ "ReadWriteOnce" ] |
286 | 281 | resources: |
287 | 282 | requests: |
288 | - storage: 1Gi | |
283 | + storage: 100Mi | |
289 | 284 | --- |
290 | 285 | apiVersion: v1 |
291 | 286 | kind: Service | ... | ... |