blob: c5c357a4710498a9c2dcb730f7f4b64e8b6beba6 [file] [log] [blame]
.PHONY: validate push_config
validate: ./tmp/promtool absent
promk-absent --input=prometheus/alerts_alert_to_pubsub.yml --output=prometheus/absent_alerts_to_pubsub.yml
promk-absent --input=prometheus/alerts_corp.yml --output=prometheus/absent_alerts_corp.yml
promk-absent --input=prometheus/alerts_general.yml --output=prometheus/absent_alerts_general.yml
promk-absent --input=prometheus/alerts_public.yml --output=prometheus/absent_alerts_public.yml
# If the only error is "FAILED: error checking bearer token file..." then you should be good.
-./tmp/promtool check config ./prometheus/prometheus-public.yml
-./tmp/promtool check config ./prometheus/prometheus-corp.yml
./tmp/promtool check rules ./prometheus/alerts_*.yml
./tmp/promtool check rules ./prometheus/absent_*.yml
.PHONY: absent
absent:
go install ./go/promk-absent
testgo:
go test ./go/...
./tmp/promtool:
-mkdir -p tmp
curl -L https://github.com/prometheus/prometheus/releases/download/v2.2.1/prometheus-2.2.1.linux-amd64.tar.gz | tar zxC ./tmp --overwrite -f -
cp ./tmp/prometheus-2.2.1.linux-amd64/promtool ./tmp/promtool
push_config: validate skia-public
-rm -rf ./tmpconf
mkdir ./tmpconf
cp prometheus/prometheus-public.yml ./tmpconf/prometheus.yml
cp prometheus/alerts_*.yml ./tmpconf
cp prometheus/absent_alerts_*.yml ./tmpconf
# Need to use replace so that the configmap gets updated. Change "replace"
# to "create" if this is the first time the configmap has been uploaded.
kubectl create configmap prometheus-server-conf --from-file=./tmpconf -o yaml --dry-run | kubectl replace -f -
push_config_corp: validate skia-corp
# Need to use replace so that the configmap gets updated. Change "replace"
# to "create" if this is the first time the configmap has been uploaded.
-rm -rf ./tmpconf
mkdir ./tmpconf
cp prometheus/prometheus-corp.yml ./tmpconf/prometheus.yml
cp prometheus/alerts_*.yml ./tmpconf
cp prometheus/absent_alerts_*.yml ./tmpconf
kubectl create configmap prometheus-server-conf --from-file=./tmpconf -o yaml --dry-run | kubectl replace -f -
include ../make/clusters.mk