From 4feff0e34afcf6ad5602eba352a63ec3abb62204 Mon Sep 17 00:00:00 2001 From: Steve Wilkerson Date: Wed, 10 Jul 2019 09:27:02 -0500 Subject: [PATCH] Enable calico prometheus metrics for minikube This updates the minikube deployment script to patch the calico-node daemonset to set the appropriate annotations and environment variables required for felix to expose prometheus metrics Change-Id: Ic5dc2ecb298add12cd3b150cc4d26e7639c43488 Signed-off-by: Steve Wilkerson --- tools/deployment/common/005-deploy-k8s.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/tools/deployment/common/005-deploy-k8s.sh b/tools/deployment/common/005-deploy-k8s.sh index 653b2b9dbe..682b57da61 100755 --- a/tools/deployment/common/005-deploy-k8s.sh +++ b/tools/deployment/common/005-deploy-k8s.sh @@ -125,6 +125,25 @@ kubectl apply -f \ kubectl apply -f \ https://docs.projectcalico.org/"${CALICO_VERSION}"/getting-started/kubernetes/installation/hosted/kubernetes-datastore/calico-networking/1.7/calico.yaml +# Note: Patch calico daemonset to enable Prometheus metrics and annotations +tee /tmp/calico-node.yaml << EOF +spec: + template: + metadata: + annotations: + prometheus.io/scrape: "true" + prometheus.io/port: "9091" + spec: + containers: + - name: calico-node + env: + - name: FELIX_PROMETHEUSMETRICSENABLED + value: "true" + - name: FELIX_PROMETHEUSMETRICSPORT + value: "9091" +EOF +kubectl patch daemonset calico-node -n kube-system --patch "$(cat /tmp/calico-node.yaml)" + # NOTE: Wait for node to be ready. kubectl wait --timeout=240s --for=condition=Ready nodes/minikube