Download and install talosctl
binary
wget https://github.com/talos-systems/talos/releases/download/v0.8.1/talosctl-linux-amd64
Pods running in an OpenShift Kubernetes environment process complex events using Kafka Streams and KTables, with state stores backed by RocksDB. Over time, these state stores consume increasing memory until the container exceeds its memory limit, crashes, and causes data loss. To mitigate this, we need a mechanism to detect impending memory exhaustion, trigger a graceful shutdown, and allow the pod to restart without data loss.
#!/bin/bash | |
# ------------------- Logging Function ------------------- | |
log() { | |
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a logs/get-deployment-resources-$(date +"%Y%m%d%H%M%S").log | |
} | |
# Ensure required directories exist | |
mkdir -p logs data |