Last active
May 15, 2025 19:58
-
-
Save mikejoh/e54b8f29d78ead9d1e9e35353e9050f0 to your computer and use it in GitHub Desktop.
Revisions
-
mikejoh revised this gist
Feb 25, 2021 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -49,7 +49,7 @@ spec: targetLabel: instance ``` _Note the relabeling above, this changes the `instance` label to something more descriptive when querying for Calico Felix metrics._ Install the official Grafana dashboard: https://grafana.com/grafana/dashboards/12175 -
mikejoh revised this gist
Feb 25, 2021 . 1 changed file with 11 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -13,15 +13,15 @@ Create a `Service` with `clusterIP` set to `None`, the service will be used to e apiVersion: v1 kind: Service metadata: name: calico-felix-metrics namespace: kube-system labels: monitoring: calico-felix spec: clusterIP: None ports: - port: 9091 protocol: TCP name: metrics selector: k8s-app: calico-node @@ -32,19 +32,25 @@ Create a `ServiceMonitor` to start scrape the `calico-node` `Pods`: apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: calico-felix-metrics namespace: monitoring spec: selector: matchLabels: monitoring: calico-felix namespaceSelector: matchNames: - kube-system endpoints: - port: metrics relabelings: - sourceLabels: - __meta_kubernetes_endpoint_node_name targetLabel: instance ``` _Note the relabeling added to have a more descritive `instance` label of the scraped Calico Felix metrics._ Install the official Grafana dashboard: https://grafana.com/grafana/dashboards/12175 ## Links -
mikejoh revised this gist
Feb 24, 2021 . 1 changed file with 6 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -45,4 +45,9 @@ spec: - port: metrics ``` Install the official Grafana dashboard: https://grafana.com/grafana/dashboards/12175 ## Links https://docs.projectcalico.org/reference/felix/prometheus https://docs.projectcalico.org/archive/v3.18/reference/felix/configuration -
mikejoh created this gist
Feb 24, 2021 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,48 @@ # Monitor Calico Felix using Prometheus Operator Make sure you have these settings enabled in `felix`, in this case using enviornment variables: ``` FELIX_PROMETHEUSMETRICSENABLED = True FELIX_PROMETHEUSMETRICSPORT = "9091" FELIX_PROMETHEUSGOMETRICSENABLED = True FELIX_PROMETHEUSPROCESSMETRICSENABLED = True ``` Create a `Service` with `clusterIP` set to `None`, the service will be used to enumerate endpoints to scrape: ``` apiVersion: v1 kind: Service metadata: name: felix-metrics namespace: kube-system labels: k8s-app: calico-node spec: clusterIP: None ports: - port: 9091 protocol: TCP name: metrics selector: k8s-app: calico-node ``` Create a `ServiceMonitor` to start scrape the `calico-node` `Pods`: ``` apiVersion: monitoring.coreos.com/v1 kind: ServiceMonitor metadata: name: felix-metrics namespace: monitoring spec: selector: matchLabels: k8s-app: calico-node namespaceSelector: matchNames: - kube-system endpoints: - port: metrics ``` Install the official Grafana dashboard: https://grafana.com/grafana/dashboards/12175