summaryrefslogtreecommitdiff
path: root/run.sh
diff options
context:
space:
mode:
Diffstat (limited to 'run.sh')
-rwxr-xr-xrun.sh31
1 files changed, 31 insertions, 0 deletions
diff --git a/run.sh b/run.sh
new file mode 100755
index 0000000..38637cf
--- /dev/null
+++ b/run.sh
@@ -0,0 +1,31 @@
+#!/bin/bash
+
+# Simple script to run Epimetheus
+# Automatically sets up port-forwarding and runs the binary
+
+set -e
+
+echo "Starting Epimetheus..."
+echo ""
+echo "Step 1: Setting up port-forward to Pushgateway..."
+kubectl port-forward -n monitoring svc/pushgateway 9091:9091 > /tmp/pushgateway-port-forward.log 2>&1 &
+PF_PID=$!
+
+# Wait for port-forward to be ready
+sleep 2
+
+echo "Step 2: Running epimetheus binary (realtime mode)..."
+echo "Press Ctrl+C to stop"
+echo ""
+
+# Run the binary in realtime mode and capture its exit status
+./epimetheus -mode=realtime -continuous
+EXIT_CODE=$?
+
+# Clean up port-forward
+echo ""
+echo "Cleaning up port-forward..."
+kill $PF_PID 2>/dev/null || true
+
+echo "Done!"
+exit $EXIT_CODE