#!/bin/sh
exec 2>&1
<%= render("mount_point_check.erb") %>
umask 077
exec chpst -P -U <%= node['gitlab']['prometheus']['username'] %> -u <%= node['gitlab']['prometheus']['username'] %> /opt/gitlab/embedded/bin/prometheus <%= @options[:flags] %>

#!/bin/sh
exec 2>&1
<%= render("mount_point_check.erb") %>
umask 077
exec chpst -P -U <%= node['gitlab']['prometheus']['username'] %> -u <%= node['gitlab']['prometheus']['username'] %> \
  KUBERNETES_SERVICE_HOST="${KUBERNETES_SERVICE_HOST}" \
  KUBERNETES_SERVICE_PORT="${KUBERNETES_SERVICE_PORT}" \
  /opt/gitlab/embedded/bin/prometheus <%= @options[:flags] %>

Add Kubernetes env vars to prometheus startup
Add Kubernetes env vars to prometheus startup

Prometheus requires two ENV vars from Kubernetes for service discovery.
* `KUBERNETES_SERVICE_HOST`
* `KUBERNETES_SERVICE_PORT`

It is harmless if these vars are missing when running outside of Kubernetes.
