Add kube-router configuration to enable metrics exposure (#5416)
parent
8bb1af9926
commit
c0b262a22a
|
@ -47,3 +47,12 @@
|
||||||
|
|
||||||
# Array of common annotations for every node
|
# Array of common annotations for every node
|
||||||
# kube_router_annotations_all: []
|
# 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
|
# Array of common annotations for every node
|
||||||
kube_router_annotations_all: []
|
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:
|
labels:
|
||||||
k8s-app: kube-router
|
k8s-app: kube-router
|
||||||
tier: node
|
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:
|
spec:
|
||||||
priorityClassName: system-cluster-critical
|
priorityClassName: system-cluster-critical
|
||||||
serviceAccountName: kube-router
|
serviceAccountName: kube-router
|
||||||
|
@ -95,6 +101,10 @@ spec:
|
||||||
{% if kube_router_peer_router_ports %}
|
{% if kube_router_peer_router_ports %}
|
||||||
- --peer-router-ports={{ kube_router_peer_router_ports }}
|
- --peer-router-ports={{ kube_router_peer_router_ports }}
|
||||||
{% endif %}
|
{% 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 %}
|
{% for arg in kube_router_extra_args %}
|
||||||
- "{{ arg }}"
|
- "{{ arg }}"
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -129,6 +139,13 @@ spec:
|
||||||
- name: kubeconfig
|
- name: kubeconfig
|
||||||
mountPath: /var/lib/kube-router
|
mountPath: /var/lib/kube-router
|
||||||
readOnly: true
|
readOnly: true
|
||||||
|
{% if kube_router_enable_metrics %}
|
||||||
|
ports:
|
||||||
|
- containerPort: {{ kube_router_metrics_port }}
|
||||||
|
hostPort: {{ kube_router_metrics_port }}
|
||||||
|
name: metrics
|
||||||
|
protocol: TCP
|
||||||
|
{% endif %}
|
||||||
initContainers:
|
initContainers:
|
||||||
- name: install-cni
|
- name: install-cni
|
||||||
image: {{ busybox_image_repo }}:{{ busybox_image_tag }}
|
image: {{ busybox_image_repo }}:{{ busybox_image_tag }}
|
||||||
|
|
Loading…
Reference in New Issue