-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add how-to page for Kafka topic's tiered storage
Co-Authored-By: @mortenlj <[email protected]> Co-Authored-By: @Kyrremann <[email protected]>
- Loading branch information
1 parent
9bcbc7e
commit fd81804
Showing
4 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,15 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Export all: | ||
# - (should be) .gitignored | ||
# - (potentially) secret environment variables | ||
# - from dotenv-formatted files w/names starting w/`.env` | ||
DOTENV_FILES="$(find . -maxdepth 1 -type f -name '.env*' -and -not -name '.envrc')" | ||
for file in ${DOTENV_FILES}; do | ||
dotenv "${file}" | ||
done | ||
export DOTENV_FILES | ||
|
||
if command -v nix-shell &>/dev/null; then | ||
use flake | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
--- | ||
tags: [how-to, kafka, tiered-storage] | ||
--- | ||
|
||
# How to turn on Tiered Storage for your Kafka topic | ||
|
||
This guide shows you how to enable tiered storage for your Kafka topic. | ||
|
||
## Prerequisites | ||
|
||
You need to own an existing topic in nais. | ||
Check [Create a Kafka topic](create.md) for how to create a topic. | ||
|
||
## Enable tiered storage by specifying local retention on a topic | ||
|
||
???+ note "Git diff showing how to enable tiered storage in a 'nai example_topic.yaml' file" | ||
|
||
```diff | ||
diff --git a/example_topic.yaml b/example_topic.yaml | ||
index 230ec001..cbc01774 100644 | ||
--- a/example_topic.yaml | ||
+++ b/example_topic.yaml | ||
@@ -8,3 +8,8 @@ labels: | ||
spec: | ||
kafka: | ||
# ... other configuration ... | ||
+ config: | ||
+ # Must be a value smaller than `retentionHours` | ||
+ localRetentionHours: X | ||
+ # Must be a value smaller than `retentionBytes` | ||
+ localRetentionBytes: Y | ||
``` | ||
|
||
## Apply the new configuration | ||
=== "Automatically" | ||
Add the file to your application repository and deploy with [NAIS github action](../../../build/how-to/build-and-deploy.md). | ||
=== "Manually" | ||
```bash | ||
kubectl apply -f ./example_topic.yaml --namespace=<MY-TEAM> --context=<MY-CLUSTER> | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters