apiVersion: v1 kind: ConfigMap metadata: name: buildah-entrypoint namespace: apps--droneio--prd data: entrypoint.sh: | #!/bin/bash # Signal-aware entrypoint for graceful shutdown echo "🚀 Starting Buildah container with graceful shutdown support" # Graceful shutdown handler shutdown_handler() { echo "📡 Received termination signal, shutting down gracefully..." # Kill any running buildah processes pkill -TERM buildah 2>/dev/null || true # Give processes time to cleanup sleep 2 echo "✅ Graceful shutdown complete" exit 0 } # Set up signal handlers trap shutdown_handler SIGTERM SIGINT # Keep container alive while handling signals echo "⏳ Container ready, waiting for build requests..." while true; do sleep 10 & wait $! # This wait will be interrupted by signals done