Skip to content

Commit 9fbccef

Browse files
authored
[Backport] NETOBSERV-2107: fix service monitor quotes (#167)
* fix service monitor quotes * move service to service monitor file * add missing roles * fix relabel regexes * restore missing env var
1 parent 90d5e8f commit 9fbccef

File tree

4 files changed

+82
-26
lines changed

4 files changed

+82
-26
lines changed

res/metric-capture.yml

Lines changed: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,26 @@ spec:
3131
value: "false"
3232
- name: LOG_LEVEL
3333
value: info
34+
- name: INTERFACES
35+
value: ""
36+
- name: EXCLUDE_INTERFACES
37+
value: "lo"
38+
- name: SAMPLING
39+
value: "1"
40+
- name: ENABLE_RTT
41+
value: "false"
42+
- name: ENABLE_PKT_DROPS
43+
value: "false"
44+
- name: ENABLE_DNS_TRACKING
45+
value: "false"
46+
- name: ENABLE_NETWORK_EVENTS_MONITORING
47+
value: "false"
48+
- name: ENABLE_UDN_MAPPING
49+
value: "false"
50+
- name: ENABLE_PKT_TRANSLATION
51+
value: "false"
52+
- name: ENABLE_FLOW_FILTER
53+
value: "false"
3454
- name: FLOW_FILTER_RULES
3555
value: >-
3656
[]
@@ -65,21 +85,4 @@ spec:
6585
- name: var-run-ovs
6686
hostPath:
6787
path: /var/run/openvswitch
68-
type: DirectoryOrCreate
69-
---
70-
kind: Service
71-
apiVersion: v1
72-
metadata:
73-
name: netobserv-cli
74-
namespace: "{{NAMESPACE}}"
75-
labels:
76-
app: netobserv-cli
77-
spec:
78-
ports:
79-
- name: prometheus
80-
protocol: TCP
81-
port: 9401
82-
targetPort: 9401
83-
selector:
84-
app: netobserv-cli
85-
type: ClusterIP
88+
type: DirectoryOrCreate

res/service-account.yml

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,3 +62,39 @@ roleRef:
6262
apiGroup: rbac.authorization.k8s.io
6363
kind: ClusterRole
6464
name: netobserv-cli
65+
---
66+
kind: ClusterRole
67+
apiVersion: rbac.authorization.k8s.io/v1
68+
metadata:
69+
name: netobserv-cli-metrics
70+
namespace: "{{NAMESPACE}}"
71+
rules:
72+
# allow openshift-monitoring metrics reading
73+
- apiGroups:
74+
- ''
75+
resources:
76+
- pods
77+
- services
78+
- endpoints
79+
verbs:
80+
- list
81+
- get
82+
- watch
83+
- nonResourceURLs:
84+
- /metrics
85+
verbs:
86+
- get
87+
---
88+
apiVersion: rbac.authorization.k8s.io/v1
89+
kind: ClusterRoleBinding
90+
metadata:
91+
name: netobserv-cli-metrics
92+
namespace: "{{NAMESPACE}}"
93+
subjects:
94+
- kind: ServiceAccount
95+
name: prometheus-k8s
96+
namespace: openshift-monitoring
97+
roleRef:
98+
apiGroup: rbac.authorization.k8s.io
99+
kind: ClusterRole
100+
name: netobserv-cli-metrics

res/service-monitor.yml

Lines changed: 24 additions & 7 deletions
Large diffs are not rendered by default.

scripts/functions.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ function loadYAMLs() {
8989
if [ -f ./res/metric-capture.yml ]; then
9090
metricAgentYAML="$(cat ./res/metric-capture.yml)"
9191
fi
92-
metricAgentYAML="${metricAgentYAML//"{{NAMESPACE}}"/${namespace}}"
92+
metricAgentYAML="${metricAgentYAML/"{{NAMESPACE}}"/${namespace}}"
9393
metricAgentYAML="${metricAgentYAML/"{{AGENT_IMAGE_URL}}"/${agentImg}}"
9494

9595
collectorServiceYAML='

0 commit comments

Comments
 (0)