From b81c0d869ca7cc4af88f03297f858f1fb1eb52d1 Mon Sep 17 00:00:00 2001
From: Brad Beam <brad.beam@b-rad.info>
Date: Tue, 3 Oct 2017 16:24:05 -0500
Subject: [PATCH] Adding calico/node env vars for prometheus configuration

---
 roles/network_plugin/calico/defaults/main.yml            | 6 ++++++
 roles/network_plugin/calico/templates/calico-node.yml.j2 | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/roles/network_plugin/calico/defaults/main.yml b/roles/network_plugin/calico/defaults/main.yml
index 148a28082..a44b3d315 100644
--- a/roles/network_plugin/calico/defaults/main.yml
+++ b/roles/network_plugin/calico/defaults/main.yml
@@ -31,6 +31,12 @@ calicoctl_cpu_limit: 100m
 calicoctl_memory_requests: 32M
 calicoctl_cpu_requests: 50m
 
+# Enable Prometheus Metrics endpoint for felix
+calico_felix_prometheusmetricsenabled: "false"
+calico_felix_prometheusmetricsport: 9091
+calico_felix_prometheusgometricsenabled: "true"
+calico_felix_prometheusprocessmetricsenabled: "true"
+
 # Should calico ignore kernel's RPF check setting,
 # see https://github.com/projectcalico/felix/blob/ab8799eaea66627e5db7717e62fca61fd9c08646/python/calico/felix/config.py#L198
 calico_node_ignorelooserpf: false
diff --git a/roles/network_plugin/calico/templates/calico-node.yml.j2 b/roles/network_plugin/calico/templates/calico-node.yml.j2
index 4c0538c8c..26c0ee960 100644
--- a/roles/network_plugin/calico/templates/calico-node.yml.j2
+++ b/roles/network_plugin/calico/templates/calico-node.yml.j2
@@ -82,6 +82,14 @@ spec:
             - name: FELIX_IPINIPMTU
               value: "{{ calico_mtu }}"
 {% endif %}
+            - name: FELIX_PROMETHEUSMETRICSENABLED
+              value: "{{ calico_felix_prometheusmetricsenabled }}"
+            - name: FELIX_PROMETHEUSMETRICSPORT
+              value: "{{ calico_felix_prometheusmetricsport }}"
+            - name: FELIX_PROMETHEUSGOMETRICSENABLED
+              value: "{{ calico_felix_prometheusgometricsenabled }}"
+            - name: FELIX_PROMETHEUSPROCESSMETRICSENABLED
+              value: "{{ calico_felix_prometheusprocessmetricsenabled }}"
             # Location of the CA certificate for etcd.
             - name: ETCD_CA_CERT_FILE
               valueFrom:
-- 
GitLab