Add kube-router configuration to enable metrics exposure (#5416)
parent
8bb1af9926
commit
c0b262a22a
|
@ -47,3 +47,12 @@
|
|||
|
||||
# Array of common annotations for every node
|
||||
# kube_router_annotations_all: []
|
||||
|
||||
# Enables scraping kube-router metrics with Prometheus
|
||||
# kube_router_enable_metrics: false
|
||||
|
||||
# Path to serve Prometheus metrics on
|
||||
# kube_router_metrics_path: /metrics
|
||||
|
||||
# Prometheus metrics port to use
|
||||
# kube_router_metrics_port: 9255
|
||||
|
|
|
@ -49,3 +49,12 @@ kube_router_annotations_node: []
|
|||
|
||||
# Array of common annotations for every node
|
||||
kube_router_annotations_all: []
|
||||
|
||||
# Enables scraping kube-router metrics with Prometheus
|
||||
kube_router_enable_metrics: false
|
||||
|
||||
# Path to serve Prometheus metrics on
|
||||
kube_router_metrics_path: /metrics
|
||||
|
||||
# Prometheus metrics port to use
|
||||
kube_router_metrics_port: 9255
|
|
@ -65,6 +65,12 @@ spec:
|
|||
labels:
|
||||
k8s-app: kube-router
|
||||
tier: node
|
||||
annotations:
|
||||
{% if kube_router_enable_metrics %}
|
||||
prometheus.io/path: {{ kube_router_metrics_path }}
|
||||
prometheus.io/port: "{{ kube_router_metrics_port }}"
|
||||
prometheus.io/scrape: "true"
|
||||
{% endif %}
|
||||
spec:
|
||||
priorityClassName: system-cluster-critical
|
||||
serviceAccountName: kube-router
|
||||
|
@ -95,6 +101,10 @@ spec:
|
|||
{% if kube_router_peer_router_ports %}
|
||||
- --peer-router-ports={{ kube_router_peer_router_ports }}
|
||||
{% endif %}
|
||||
{% if kube_router_enable_metrics %}
|
||||
- --metrics-path={{ kube_router_metrics_path }}
|
||||
- --metrics-port={{ kube_router_metrics_port }}
|
||||
{% endif %}
|
||||
{% for arg in kube_router_extra_args %}
|
||||
- "{{ arg }}"
|
||||
{% endfor %}
|
||||
|
@ -129,6 +139,13 @@ spec:
|
|||
- name: kubeconfig
|
||||
mountPath: /var/lib/kube-router
|
||||
readOnly: true
|
||||
{% if kube_router_enable_metrics %}
|
||||
ports:
|
||||
- containerPort: {{ kube_router_metrics_port }}
|
||||
hostPort: {{ kube_router_metrics_port }}
|
||||
name: metrics
|
||||
protocol: TCP
|
||||
{% endif %}
|
||||
initContainers:
|
||||
- name: install-cni
|
||||
image: {{ busybox_image_repo }}:{{ busybox_image_tag }}
|
||||
|
|
Loading…
Reference in New Issue