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 <sw5822@att.com>
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user