diff --git a/roles/network_plugin/cilium/defaults/main.yml b/roles/network_plugin/cilium/defaults/main.yml index 8b18a15b1b30f4bdf9f17386aaf6818dd99d5c2a..270fffee0441075fb2690d42c38c1a48aa6b4d27 100755 --- a/roles/network_plugin/cilium/defaults/main.yml +++ b/roles/network_plugin/cilium/defaults/main.yml @@ -22,6 +22,7 @@ cilium_cpu_requests: 100m cilium_tunnel_mode: vxlan # Optional features cilium_enable_prometheus: false +cilium_enable_hubble_metrics: false # Enable if you want to make use of hostPort mappings cilium_enable_portmap: false # Monitor aggregation level (none/low/medium/maximum) diff --git a/roles/network_plugin/cilium/templates/cilium-deploy.yml.j2 b/roles/network_plugin/cilium/templates/cilium-deploy.yml.j2 index bf89286e2c2bb15402a5cc65c7167fa27dec191b..a747f43e648e9baf1ae9ab44db3c1a9351c3631a 100644 --- a/roles/network_plugin/cilium/templates/cilium-deploy.yml.j2 +++ b/roles/network_plugin/cilium/templates/cilium-deploy.yml.j2 @@ -20,6 +20,11 @@ spec: type: RollingUpdate template: metadata: +{% if cilium_enable_prometheus %} + annotations: + prometheus.io/port: "6942" + prometheus.io/scrape: "true" +{% endif %} labels: io.cilium/app: operator name: cilium-operator @@ -93,6 +98,13 @@ spec: image: "{{ cilium_operator_image_repo }}:{{ cilium_operator_image_tag }}" imagePullPolicy: {{ k8s_image_pull_policy }} name: cilium-operator +{% if cilium_enable_prometheus %} + ports: + - containerPort: 6942 + hostPort: 6942 + name: prometheus + protocol: TCP +{% endif %} livenessProbe: httpGet: {% if cilium_enable_ipv4 %} diff --git a/roles/network_plugin/cilium/templates/cilium-ds.yml.j2 b/roles/network_plugin/cilium/templates/cilium-ds.yml.j2 index dbf26ab0f1d7a35daff1497704ba3bed1dfb764d..bede48dce5fb70010b03965dbbe9e5f1bf020d88 100755 --- a/roles/network_plugin/cilium/templates/cilium-ds.yml.j2 +++ b/roles/network_plugin/cilium/templates/cilium-ds.yml.j2 @@ -85,12 +85,20 @@ spec: successThreshold: 1 timeoutSeconds: 5 name: cilium-agent -{% if cilium_enable_prometheus %} +{% if cilium_enable_prometheus or cilium_enable_hubble_metrics %} ports: +{% endif %} +{% if cilium_enable_prometheus %} - containerPort: 9090 hostPort: 9090 name: prometheus protocol: TCP +{% endif %} +{% if cilium_enable_hubble_metrics %} + - containerPort: 9091 + hostPort: 9091 + name: hubble-metrics + protocol: TCP {% endif %} readinessProbe: httpGet: