blob: 43bc9d9593f759c9fc706affbdf20977436d822c [file] [log] [blame]
Woojoong Kimd3c132c2020-08-26 14:46:47 -07001{{- /*
2
3# Copyright 2020-present Open Networking Foundation
4#
5# SPDX-License-Identifier: Apache-2.0
6# SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0
7
8*/ -}}
9
10---
11apiVersion: apps/v1
12kind: Deployment
13metadata:
14 name: tb-kafka
15spec:
16 selector:
17 matchLabels:
18 app: tb-kafka
19 template:
20 metadata:
21 labels:
22 app: tb-kafka
23 spec:
24 serviceAccountName: thingsboard
25 initContainers:
26 - name: kafka-dep-check
27 image: {{ .Values.images.tags.depCheck }}
28 imagePullPolicy: {{ .Values.images.pullPolicy }}
29 env:
30 - name: POD_NAME
31 valueFrom:
32 fieldRef:
33 apiVersion: v1
34 fieldPath: metadata.name
35 - name: NAMESPACE
36 valueFrom:
37 fieldRef:
38 apiVersion: v1
39 fieldPath: metadata.namespace
40 - name: PATH
41 value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/
42 - name: COMMAND
43 value: "echo done"
44 - name: DEPENDENCY_POD_JSON
45 value: '[{"labels": {"app": "zookeeper"}, "requireSameNode": false}]'
46 command:
47 - kubernetes-entrypoint
48 volumeMounts:
49 []
50 containers:
51 - name: server
52 imagePullPolicy: {{ .Values.images.pullPolicy}}
53 image: {{ .Values.images.tags.kafka }}
54 ports:
55 - containerPort: {{ .Values.config.kafka.ports.outPort }}
56 readinessProbe:
57 periodSeconds: 20
58 tcpSocket:
59 port: {{ .Values.config.kafka.ports.outPort }}
60 livenessProbe:
61 initialDelaySeconds: 25
62 periodSeconds: 5
63 tcpSocket:
64 port: {{ .Values.config.kafka.ports.outPort }}
65 env:
66 - name: KAFKA_ZOOKEEPER_CONNECT
67 value: "zookeeper:{{ .Values.config.zookeeper.port }}"
68 - name: KAFKA_LISTENERS
69 value: "INSIDE://:{{ .Values.config.kafka.ports.inPort }},OUTSIDE://:{{ .Values.config.kafka.ports.outPort }}"
70 - name: KAFKA_ADVERTISED_LISTENERS
71 value: "INSIDE://:{{ .Values.config.kafka.ports.inPort }},OUTSIDE://tb-kafka:{{ .Values.config.kafka.ports.outPort }}"
72 - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP
73 value: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT"
74 - name: KAFKA_INTER_BROKER_LISTENER_NAME
75 value: "INSIDE"
76 - name: KAFKA_CREATE_TOPICS
77 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"
78 - name: KAFKA_AUTO_CREATE_TOPICS_ENABLE
79 value: "false"
80 - name: KAFKA_LOG_RETENTION_BYTES
81 value: "1073741824"
82 - name: KAFKA_LOG_SEGMENT_BYTES
83 value: "268435456"
84 - name: KAFKA_LOG_RETENTION_MS
85 value: "300000"
86 - name: KAFKA_LOG_CLEANUP_POLICY
87 value: "delete"
88 restartPolicy: Always