You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -21,15 +21,25 @@ Doing so has no impact on how or for how long Prometheus stores metrics.
21
21
* You have installed the OpenShift CLI (`oc`).
22
22
* You have set up a remote write compatible endpoint (such as Thanos) and know the endpoint URL.
23
23
See the link:https://prometheus.io/docs/operating/integrations/#remote-endpoints-and-storage[Prometheus remote endpoints and storage documentation] for information about endpoints that are compatible with the remote write feature.
24
-
* You have set up authentication credentials for the remote write endpoint.
24
+
* You have set up authentication credentials in a `Secret` object for the remote write endpoint.
25
+
You must create the secret in the same namespace as the Prometheus object for which you configure remote write: the `openshift-monitoring` namespace for default platform monitoring or the `openshift-user-workload-monitoring` namespace for user workload monitoring.
26
+
25
27
+
26
28
[CAUTION]
27
29
====
28
-
To reduce security risks, avoid sending metrics to an endpoint via unencrypted HTTP or without using authentication.
30
+
To reduce security risks, use HTTPS and authentication to send metrics to an endpoint.
29
31
====
30
32
31
33
.Procedure
32
34
35
+
Follow these steps to configure remote write for default platform monitoring in the `cluster-monitoring-config` config map in the `openshift-monitoring` namespace.
36
+
37
+
[NOTE]
38
+
====
39
+
If you configure remote write for the Prometheus instance that monitors user-defined projects, make similar edits to the `user-workload-monitoring-config` config map in the `openshift-user-workload-monitoring` namespace.
40
+
Note that the Prometheus config map component is called `prometheus` in the `user-workload-monitoring-config` `ConfigMap` object and not `prometheusK8s`, as it is in the `cluster-monitoring-config` `ConfigMap` object.
41
+
====
42
+
33
43
. Edit the `cluster-monitoring-config``ConfigMap` object in the `openshift-monitoring` project:
34
44
+
35
45
[source,terminal]
@@ -52,89 +62,14 @@ data:
52
62
config.yaml: |
53
63
prometheusK8s:
54
64
remoteWrite:
55
-
- url: "https://remote-write.endpoint"
56
-
<endpoint_authentication_credentials>
57
-
----
58
-
+
59
-
For `endpoint_authentication_credentials` substitute the credentials for the endpoint.
60
-
Currently supported authentication methods are basic authentication (`basicAuth`) and client TLS (`tlsConfig`) authentication.
61
-
+
62
-
* The following example configures basic authentication:
63
-
+
64
-
[source,yaml]
65
-
----
66
-
basicAuth:
67
-
username:
68
-
<usernameSecret>
69
-
password:
70
-
<passwordSecret>
71
-
----
72
-
Substitute `<usernameSecret>` and `<passwordSecret>` accordingly.
73
-
+
74
-
The following sample shows basic authentication configured with `remoteWriteAuth` for the `name` values and `user` and `password` for the `key` values. These values contain the endpoint authentication credentials:
75
-
+
76
-
[source,yaml]
77
-
----
78
-
apiVersion: v1
79
-
kind: ConfigMap
80
-
metadata:
81
-
name: cluster-monitoring-config
82
-
namespace: openshift-monitoring
83
-
data:
84
-
config.yaml: |
85
-
prometheusK8s:
86
-
remoteWrite:
87
-
- url: "https://remote-write.endpoint"
88
-
basicAuth:
89
-
username:
90
-
name: remoteWriteAuth
91
-
key: user
92
-
password:
93
-
name: remoteWriteAuth
94
-
key: password
95
-
----
96
-
+
97
-
* The following example configures client TLS authentication:
Substitute `<caSecret>`, `<certSecret>`, and `<keySecret>` accordingly.
110
68
+
111
-
The following sample shows a TLS authentication configuration using `selfsigned-mtls-bundle` for the `name` values and `ca.crt` for the `ca``key` value, `client.crt` for the `cert``key` value, and `client.key` for the `keySecret``key` value:
112
-
+
113
-
[source,yaml]
114
-
----
115
-
apiVersion: v1
116
-
kind: ConfigMap
117
-
metadata:
118
-
name: cluster-monitoring-config
119
-
namespace: openshift-monitoring
120
-
data:
121
-
config.yaml: |
122
-
prometheusK8s:
123
-
remoteWrite:
124
-
- url: "https://remote-write.endpoint"
125
-
tlsConfig:
126
-
ca:
127
-
secret:
128
-
name: selfsigned-mtls-bundle
129
-
key: ca.crt
130
-
cert:
131
-
secret:
132
-
name: selfsigned-mtls-bundle
133
-
key: client.crt
134
-
keySecret:
135
-
name: selfsigned-mtls-bundle
136
-
key: client.key
137
-
----
69
+
<1> The URL of the remote write endpoint.
70
+
<2> The authentication method and credentials for the endpoint.
71
+
Currently supported authentication methods are AWS Signature Version 4, authentication using HTTP an `Authorization` request header, basic authentication, OAuth 2.0, and TLS client.
72
+
See _Supported remote write authentication settings_ below for sample configurations of supported authentication methods.
138
73
139
74
. Add write relabel configuration values after the authentication credentials:
See the link:https://prometheus.io/docs/prometheus/latest/configuration/configuration/#relabel_config[Prometheus relabel_config documentation] for information about write relabel configuration options.
181
117
182
-
. If required, configure remote write for the Prometheus instance that monitors user-defined projects by changing the `name` and `namespace` `metadata` values as follows:
183
-
+
184
-
[source,yaml]
185
-
----
186
-
apiVersion: v1
187
-
kind: ConfigMap
188
-
metadata:
189
-
name: user-workload-monitoring-config
190
-
namespace: openshift-user-workload-monitoring
191
-
data:
192
-
config.yaml: |
193
-
prometheus:
194
-
remoteWrite:
195
-
- url: "https://remote-write.endpoint"
196
-
<endpoint_authentication_credentials>
197
-
<write_relabel_configs>
198
-
----
199
-
+
200
-
[NOTE]
201
-
====
202
-
The Prometheus config map component is called `prometheusK8s` in the `cluster-monitoring-config` `ConfigMap` object and `prometheus` in the `user-workload-monitoring-config` `ConfigMap` object.
203
-
====
204
-
205
118
. Save the file to apply the changes to the `ConfigMap` object.
206
119
The pods affected by the new configuration restart automatically.
207
120
+
@@ -214,4 +127,3 @@ Configurations applied to the `user-workload-monitoring-config` `ConfigMap` obje
214
127
====
215
128
Saving changes to a monitoring `ConfigMap` object might redeploy the pods and other resources in the related project. Saving changes might also restart the running monitoring processes in that project.
0 commit comments