Skip to content

Commit

Permalink
- add kafka topics
Browse files Browse the repository at this point in the history
  • Loading branch information
zakharenkodmytro committed Dec 10, 2024
1 parent 53c0152 commit db471d0
Show file tree
Hide file tree
Showing 5 changed files with 51 additions and 8 deletions.
2 changes: 1 addition & 1 deletion charts/dps/files/partial-cloudevents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ input:
addresses:
- ${KAFKA_BOOTSTRAP_SERVERS:localhost}:${KAFKA_BOOTSTRAP_PORT:9092}
topics:
- '${DEVICE_SIGNALS_TOPIC:topic.device.partialcloudevents}'
- '${DEVICE_PARTIAL_CE_TOPIC:topic.device.partialcloudevents}'
consumer_group: "zone.dimo.export.partialcloudevents"
client_id: ${CONTAINER_NAME:localhost}-dps-status
rack_id: ${NODE_NAME:localhost}
Expand Down
2 changes: 1 addition & 1 deletion charts/dps/files/valid-cloudevents.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ input:
addresses:
- ${KAFKA_BOOTSTRAP_SERVERS:localhost}:${KAFKA_BOOTSTRAP_PORT:9092}
topics:
- '${DEVICE_SIGNALS_TOPIC:topic.device.validcloudevents}'
- '${DEVICE_VALID_CE_TOPIC:topic.device.validcloudevents}'
consumer_group: "zone.dimo.export.validcloudevents"
client_id: ${CONTAINER_NAME:localhost}-dps-status
rack_id: ${NODE_NAME:localhost}
Expand Down
19 changes: 19 additions & 0 deletions charts/dps/templates/kafka-topic.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{{- if .Values.kafka.topics -}}
{{- range $item := .Values.kafka.topics }}
apiVersion: kafka.strimzi.io/v1beta2
kind: KafkaTopic
metadata:
name: {{ $item.name }}
namespace: {{ $.Release.Namespace }}
labels:
strimzi.io/cluster: {{$.Values.kafka.clusterName}}
{{- include "dps.labels" $ | nindent 4 }}
spec:
config:
{{- range $key, $val := $item.config }}
{{ $key }} : {{ $val }}
{{- end}}
topicName: {{ $item.name }}
---
{{- end}}
{{- end}}
3 changes: 1 addition & 2 deletions charts/dps/values-prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@ kafka:

env:
KAFKA_BOOTSTRAP_SERVERS: kafka-prod-dimo-kafka-kafka-bootstrap
DEVICE_STATUS_TOPIC: topic.device.status.enriched
ENVIRONMENT: prod
DEVICES_APIGRPC_ADDR: devices-api-prod:8086
LOG_LEVEL: INFO

ingress:
enabled: false
Expand Down
33 changes: 29 additions & 4 deletions charts/dps/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,14 @@ securityContext:

env:
KAFKA_BOOTSTRAP_SERVERS: kafka-dev-dimo-kafka-kafka-brokers
DEVICE_STATUS_TOPIC: topic.device.status.enriched
DEVICE_STATUS_V2_TOPIC: topic.device.status.v2
DEVICE_SIGNALS_TOPIC: topic.device.signals
DEVICE_VALID_CE_TOPIC: topic.device.validcloudevents
DEVICE_PARTIAL_CE_TOPIC: topic.device.partialcloudevents
ELASTIC_MULTIPLE_NODE: false
ENVIRONMENT: dev
CLICKHOUSE_PORT: 9440
CLICKHOUSE_DATABASE: dimo
DEVICES_APIGRPC_ADDR: devices-api-dev:8086
LOG_LEVEL: INFO
LOG_LEVEL: DEBUG

service:
type: ClusterIP
Expand Down Expand Up @@ -128,3 +128,28 @@ serviceMonitor:
path: "/metrics"
port: mon-http
interval: 30s

kafka:
clusterName: kafka-dev-dimo-kafka
topics:
- name: topic.device.signals
config:
segment.ms: '3600000'
compression.type: producer
cleanup.policy: compact,delete
min.compaction.lag.ms: '3600000'
retention.ms: '604800000'
- name: topic.device.validcloudevents
config:
segment.ms: '3600000'
compression.type: producer
cleanup.policy: compact,delete
min.compaction.lag.ms: '3600000'
retention.ms: '604800000'
- name: topic.device.partialcloudevents
config:
segment.ms: '3600000'
compression.type: producer
cleanup.policy: compact,delete
min.compaction.lag.ms: '3600000'
retention.ms: '604800000'

0 comments on commit db471d0

Please sign in to comment.