Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move "prometheus-federation" to use template configuration #101

Merged
merged 8 commits into from
Oct 17, 2017
34 changes: 23 additions & 11 deletions apply-global-prometheus.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ CLUSTER=${CLUSTER:?Please provide cluster name: $USAGE}
export GRAFANA_DOMAIN=status-${PROJECT}.measurementlab.net
export ALERTMANAGER_URL=http://status-${PROJECT}.measurementlab.net:9093

# Roles.
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/roles"

# Deployent dependencies.
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/persistentvolumes"

# Services.
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/services"

# Config maps and Secrets

## Blackbox exporter.
Expand Down Expand Up @@ -97,8 +88,29 @@ if [[ -n "${ALERTMANAGER_URL}" ]] ; then
--dry-run -o json | kubectl apply -f -
fi

# Deployments
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/deployments"

# Apply templates
if [[ -f "k8s/${CLUSTER}/${PROJECT}.yml" ]] ; then

CFG=/tmp/${CLUSTER}-${PROJECT}.yml
kexpand expand --ignore-missing-keys k8s/${CLUSTER}/*/*.yml \
-f k8s/${CLUSTER}/${PROJECT}.yml > ${CFG}
kubectl apply -f ${CFG}

else
# TODO: remove when all project files support the new templates.
# Roles.
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/roles"

# Deployent dependencies.
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/persistentvolumes"

# Services.
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/services"

# Deployments
kubectl apply -f "k8s/${PROJECT}/${CLUSTER}/deployments"
fi

# Reload configurations. If the deployment configuration has changed then this
# request may fail becuase the container has already shutdown.
Expand Down
161 changes: 0 additions & 161 deletions k8s/mlab-oti/prometheus-federation/deployments/prometheus.yml

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading