Skip to content

Instantly share code, notes, and snippets.

@pbrissaud
Last active January 28, 2022 13:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pbrissaud/628aadb09ea1571a07c51cc71de473b4 to your computer and use it in GitHub Desktop.
Save pbrissaud/628aadb09ea1571a07c51cc71de473b4 to your computer and use it in GitHub Desktop.
GKE Dataplane V2 Cilium Monitoring

Snippets to monitor Cilium's metrics on GKE Dataplane V2 with Prometheus + Grafana

Limitations

Please note that L7 Hubble metrics such as http and dns requires Cilium L7 Policy enabled, but GKE Dataplane V2 doesn't support it.

Prometheus Metrics

  1. Edit Configmap kubectl edit configmap -n kube-system cilium-config to add these lines :
hubble-metrics: "flow drop icmp port-distribution tcp"
hubble-metrics-server: ":9091"
  1. Edit Daemonset kubectl edit daemonset -n kube-system anetd to add the port:
...
ports:
- containerPort: 9091
  hostPort: 9091
  name: hubble-metrics
  protocol: TCP
  1. Deploy PodMonitors :
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: cilium
  namespace: kube-system
  labels:
    app: cilium
spec:
  selector:
    matchLabels:
      k8s-app: cilium
  podMetricsEndpoints:
    - port: advdpmetrics
    - port: hubble-metrics
---
apiVersion: monitoring.coreos.com/v1
kind: PodMonitor
metadata:
  name: cilium-operator
  namespace: kube-system
  labels:
    app: cilium-operator
spec:
  selector:
    matchLabels:
      io.cilium/app: operator
      name: cilium-operator
  podMetricsEndpoints:
    - port: advdpopmetrics

Grafana Dashboards

You can use the official Grafana dashboards availaible here : https://grafana.com/orgs/cilium/dashboards

Hubble UI

Check this repo : https://github.com/rueian/gke-hubble-export

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment