Skip to content

Commit

Permalink
fix: When set to controller only, port 9092 is not listened on
Browse files Browse the repository at this point in the history
  • Loading branch information
pyama committed Apr 14, 2024
1 parent e0a2e81 commit ce8778f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
11 changes: 11 additions & 0 deletions sentry/templates/_helper.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,17 @@ Set Kafka Confluent port
{{- end -}}
{{- end -}}

{{/*
Set Kafka Confluent Controller port
*/}}
{{- define "sentry.kafka.controller_port" -}}
{{- if and (.Values.kafka.enabled) (.Values.kafka.service.ports.controller ) -}}
{{- .Values.kafka.service.ports.controller }}
{{- else if and (.Values.externalKafka) (not (kindIs "slice" .Values.externalKafka)) -}}
{{ required "A valid .Values.externalKafka.port is required" .Values.externalKafka.port }}
{{- end -}}
{{- end -}}

{{/*
Set Kafka bootstrap servers string
*/}}
Expand Down
3 changes: 2 additions & 1 deletion sentry/templates/hooks/sentry-db-check.job.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
{{- $clickhousePort := include "sentry.clickhouse.port" . -}}
{{- $kafkaHost := include "sentry.kafka.host" . -}}
{{- $kafkaPort := include "sentry.kafka.port" . -}}
{{- $kafkaControllerPort := include "sentry.kafka.controller_port" . -}}
apiVersion: batch/v1
kind: Job
metadata:
Expand Down Expand Up @@ -140,7 +141,7 @@ spec:
KRAFT_STATUS=1
i=0; while [ $i -lt $KAFKA_REPLICAS ]; do
KRAFT_HOST={{ $kafkaHost }}-controller-$i.{{ $kafkaHost }}-controller-headless
if ! nc -z "$KRAFT_HOST" {{ $kafkaPort }}; then
if ! nc -z "$KRAFT_HOST" {{ $kafkaControllerPort }}; then
KRAFT_STATUS=0
echo "$KRAFT_HOST is not available yet"
fi
Expand Down

0 comments on commit ce8778f

Please sign in to comment.