From 84c6931c98b871836ec994ad143b10a91d9ffbf2 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Fri, 19 Apr 2019 08:53:24 -0500 Subject: [PATCH] Fix prometheus metrics gathering in postrun job This adds '|| true' to the curl command for gathering metrics from prometheus exporters in the postrun job. After the move to minikube for single node jobs, the headless services for the kubernetes components no longer work as intended. The addition of '|| true' allows the post run job to continue through the list of services tied to the prometheus exporters without the task failing outright Change-Id: I56f0f56b799c3df9b2bd66a2c2044d71473606e3 --- roles/gather-prom-metrics/tasks/main.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/roles/gather-prom-metrics/tasks/main.yaml b/roles/gather-prom-metrics/tasks/main.yaml index 6ba724d9a..e0036253f 100644 --- a/roles/gather-prom-metrics/tasks/main.yaml +++ b/roles/gather-prom-metrics/tasks/main.yaml @@ -23,7 +23,7 @@ SERVICES=$(kubectl get svc -l component=metrics -n $NS -o json | jq -r '.items[].metadata.name') for SVC in $SERVICES; do PORT=$(kubectl get svc $SVC -n $NS -o json | jq -r '.spec.ports[].port') - curl "$SVC.$NS:$PORT/metrics" >> "{{ logs_dir }}"/prometheus/$NS-$SVC.txt + curl "$SVC.$NS:$PORT/metrics" >> "{{ logs_dir }}"/prometheus/$NS-$SVC.txt || true done done args: