Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions kafka/redpanda.kafka.values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ config:
default_topic_partitions: 1
storage_min_free_bytes: 10485760
group_topic_partitions: 1
# like Kafka brokers set up by Yolean/kubernetes-kafka: a topic deletes by age only when it says so
log_retention_ms: -1
# log_retention_ms is not set here. Like Kafka brokers set up by Yolean/kubernetes-kafka, a topic
# deletes by age only when it says so, but redpanda v24.2 imports a negative log_retention_ms
# from bootstrap.yaml as 18446744073709551615, rejects that, and falls back to 7 days after the
# first restart. Instead the rendered postStart.sh (templates/secrets.yaml) sets -1 at each
# broker start, while the cluster has the 7 day default.
tuning:
tune_aio_events: false
tls:
Expand Down
1 change: 0 additions & 1 deletion kafka/redpanda/kafka/redpanda/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ data:
compacted_log_segment_size: 16777216
group_topic_partitions: 1
kafka_batch_max_bytes: 1048576
log_retention_ms: -1
kafka_connection_rate_limit: 1000
log_segment_size: 16777216
log_segment_size_max: 33554432
Expand Down
15 changes: 15 additions & 0 deletions kafka/redpanda/kafka/redpanda/templates/secrets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,21 @@ stringData:
touch /tmp/postStartHookFinished
}

# Added to the chart's script, and independent of common.sh, which /bin/sh (dash) does not
# source: topics without their own retention.ms keep their records. Redpanda's default
# log_retention_ms deletes by age after 7 days, and bootstrap.yaml can not carry -1 (see
# redpanda.kafka.values.yaml). Any value other than the 7 day default is left as it is.
retentionDefault () {
for _ in 1 2 3 4 5 6 7 8 9 10; do
if retention=$(rpk cluster config get log_retention_ms); then
[ "$retention" = "604800000" ] || return 0
rpk cluster config set log_retention_ms=-1 && return 0
fi
sleep 2
done
}

retentionDefault
postStartHook
true

Expand Down
Loading