| {{- /* |
| |
| # Copyright 2020-present Open Networking Foundation |
| # |
| # SPDX-License-Identifier: Apache-2.0 |
| # SPDX-License-Identifier: LicenseRef-ONF-Member-Only-1.0 |
| |
| */ -}} |
| |
| --- |
| apiVersion: apps/v1 |
| kind: Deployment |
| metadata: |
| name: tb-kafka |
| spec: |
| selector: |
| matchLabels: |
| app: tb-kafka |
| template: |
| metadata: |
| labels: |
| app: tb-kafka |
| spec: |
| serviceAccountName: thingsboard |
| initContainers: |
| - name: kafka-dep-check |
| image: {{ .Values.images.tags.depCheck }} |
| imagePullPolicy: {{ .Values.images.pullPolicy }} |
| env: |
| - name: POD_NAME |
| valueFrom: |
| fieldRef: |
| apiVersion: v1 |
| fieldPath: metadata.name |
| - name: NAMESPACE |
| valueFrom: |
| fieldRef: |
| apiVersion: v1 |
| fieldPath: metadata.namespace |
| - name: PATH |
| value: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/ |
| - name: COMMAND |
| value: "echo done" |
| - name: DEPENDENCY_POD_JSON |
| value: '[{"labels": {"app": "zookeeper"}, "requireSameNode": false}]' |
| command: |
| - kubernetes-entrypoint |
| volumeMounts: |
| [] |
| containers: |
| - name: server |
| imagePullPolicy: {{ .Values.images.pullPolicy}} |
| image: {{ .Values.images.tags.kafka }} |
| ports: |
| - containerPort: {{ .Values.config.kafka.ports.outPort }} |
| readinessProbe: |
| periodSeconds: 20 |
| tcpSocket: |
| port: {{ .Values.config.kafka.ports.outPort }} |
| livenessProbe: |
| initialDelaySeconds: 25 |
| periodSeconds: 5 |
| tcpSocket: |
| port: {{ .Values.config.kafka.ports.outPort }} |
| env: |
| - name: KAFKA_ZOOKEEPER_CONNECT |
| value: "zookeeper:{{ .Values.config.zookeeper.port }}" |
| - name: KAFKA_LISTENERS |
| value: "INSIDE://:{{ .Values.config.kafka.ports.inPort }},OUTSIDE://:{{ .Values.config.kafka.ports.outPort }}" |
| - name: KAFKA_ADVERTISED_LISTENERS |
| value: "INSIDE://:{{ .Values.config.kafka.ports.inPort }},OUTSIDE://tb-kafka:{{ .Values.config.kafka.ports.outPort }}" |
| - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP |
| value: "INSIDE:PLAINTEXT,OUTSIDE:PLAINTEXT" |
| - name: KAFKA_INTER_BROKER_LISTENER_NAME |
| value: "INSIDE" |
| - name: KAFKA_CREATE_TOPICS |
| 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" |
| - name: KAFKA_AUTO_CREATE_TOPICS_ENABLE |
| value: "false" |
| - name: KAFKA_LOG_RETENTION_BYTES |
| value: "1073741824" |
| - name: KAFKA_LOG_SEGMENT_BYTES |
| value: "268435456" |
| - name: KAFKA_LOG_RETENTION_MS |
| value: "300000" |
| - name: KAFKA_LOG_CLEANUP_POLICY |
| value: "delete" |
| restartPolicy: Always |