Files
kubeinvaders/scripts/metrics_loop/start.sh
2022-10-22 17:42:06 +00:00

12 lines
441 B
Bash
Executable File

#!/bin/sh
if [ ! -z "$K8S_TOKEN" ];then
echo 'Found K8S_TOKEN... using K8S_TOKEN instead of TOKEN=$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)'
export TOKEN=$K8S_TOKEN
else
# Source the service account token from the container directly.
export TOKEN="$(cat /var/run/secrets/kubernetes.io/serviceaccount/token)"
fi
python3 /opt/metrics_loop/start.py https://${KUBERNETES_SERVICE_HOST}:${KUBERNETES_SERVICE_PORT_HTTPS}