Showing
1 changed file
with
29 additions
and
10 deletions
... | ... | @@ -117,12 +117,10 @@ kind: StatefulSet |
117 | 117 | metadata: |
118 | 118 | name: tb-kafka |
119 | 119 | namespace: thingsboard |
120 | - labels: | |
121 | - app: tb-kafka | |
122 | 120 | spec: |
121 | + serviceName: "tb-kafka" | |
123 | 122 | replicas: 3 |
124 | 123 | podManagementPolicy: OrderedReady |
125 | - serviceName: server | |
126 | 124 | selector: |
127 | 125 | matchLabels: |
128 | 126 | app: tb-kafka |
... | ... | @@ -137,23 +135,40 @@ spec: |
137 | 135 | image: wurstmeister/kafka:2.12-2.2.1 |
138 | 136 | ports: |
139 | 137 | - containerPort: 9092 |
138 | + name: kafka-int | |
139 | + - containerPort: 9093 | |
140 | + name: kafka-ext | |
140 | 141 | readinessProbe: |
141 | - periodSeconds: 20 | |
142 | + periodSeconds: 5 | |
143 | + timeoutSeconds: 5 | |
142 | 144 | tcpSocket: |
143 | 145 | port: 9092 |
146 | + initialDelaySeconds: 60 | |
144 | 147 | livenessProbe: |
148 | + timeoutSeconds: 5 | |
145 | 149 | periodSeconds: 5 |
146 | 150 | tcpSocket: |
147 | 151 | port: 9092 |
152 | + initialDelaySeconds: 80 | |
148 | 153 | env: |
149 | 154 | - name: BROKER_ID_COMMAND |
150 | 155 | value: "hostname | cut -d'-' -f3" |
151 | 156 | - name: KAFKA_ZOOKEEPER_CONNECT |
152 | 157 | value: "zookeeper:2181" |
153 | - - name: KAFKA_ADVERTISED_PORT | |
154 | - value: "9092" | |
158 | + - name: KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS | |
159 | + value: "60000" | |
160 | + - name: KAFKA_UNCLEAN_LEADER_ELECTION_ENABLE | |
161 | + value: "true" | |
155 | 162 | - name: KAFKA_LISTENERS |
156 | - value: "PLAINTEXT://:9092" | |
163 | + value: "INSIDE://:9092,OUTSIDE://:9093" | |
164 | + - name: KAFKA_ADVERTISED_LISTENERS | |
165 | + value: "INSIDE://:9092,OUTSIDE://:9093" | |
166 | + - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP | |
167 | + value: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT" | |
168 | + - name: KAFKA_INTER_BROKER_LISTENER_NAME | |
169 | + value: "INSIDE" | |
170 | + - name: KAFKA_CONTROLLER_SHUTDOWN_ENABLE | |
171 | + value: "true" | |
157 | 172 | - name: KAFKA_CREATE_TOPICS |
158 | 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" |
159 | 174 | - name: KAFKA_AUTO_CREATE_TOPICS_ENABLE |
... | ... | @@ -191,11 +206,15 @@ metadata: |
191 | 206 | namespace: thingsboard |
192 | 207 | spec: |
193 | 208 | type: ClusterIP |
209 | + ports: | |
210 | + - port: 9092 | |
211 | + targetPort: 9092 | |
212 | + name: kafka-int | |
213 | + - port: 9093 | |
214 | + targetPort: 9093 | |
215 | + name: kafka-ext | |
194 | 216 | selector: |
195 | 217 | app: tb-kafka |
196 | - ports: | |
197 | - - name: tb-kafka-port | |
198 | - port: 9092 | |
199 | 218 | --- |
200 | 219 | apiVersion: v1 |
201 | 220 | kind: ConfigMap | ... | ... |