From 086ec0159777c28f3cc61825ae123dc72c0aba6d Mon Sep 17 00:00:00 2001 From: philipp Date: Mon, 30 Mar 2026 17:57:53 +0200 Subject: [PATCH] fix: bound deploy and topic storage growth --- .forgejo/workflows/deploy.yml | 3 ++- deploy/k8s/base/bootstrap-job.yaml | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/.forgejo/workflows/deploy.yml b/.forgejo/workflows/deploy.yml index 812dca7..392b8f3 100644 --- a/.forgejo/workflows/deploy.yml +++ b/.forgejo/workflows/deploy.yml @@ -54,6 +54,7 @@ jobs: env: REPO_TOKEN: ${{ github.token }} run: | + kubectl -n "$PROJECT_NAMESPACE" delete job "$BUILD_JOB" --ignore-not-found=true cat </dev/null 2>&1; do @@ -25,10 +27,16 @@ spec: for topic in $TOPICS; do if rpk topic describe "$topic" --brokers "$BROKERS" >/dev/null 2>&1; then - echo "topic already exists: $topic" + echo "ensuring retention config for existing topic: $topic" + rpk topic alter-config "$topic" --brokers "$BROKERS" \ + --set retention.ms="$RETENTION_MS" \ + --set retention.bytes="$RETENTION_BYTES" continue fi - echo "creating topic: $topic" - rpk topic create --brokers "$BROKERS" --partitions 1 --replicas 1 "$topic" + echo "creating topic with bounded retention: $topic" + rpk topic create --brokers "$BROKERS" --partitions 1 --replicas 1 \ + -c retention.ms="$RETENTION_MS" \ + -c retention.bytes="$RETENTION_BYTES" \ + "$topic" done