Skip to content

Commit 2aae4d0

Browse files
authored
Merge pull request #37573 from rh-max/srvls-serving-metrics-mesh-mtls
SRVKS-789: Move steps for enabling Serving metrics despite Service Mesh & mTLS
2 parents cc1bbfc + 91fa326 commit 2aae4d0

File tree

5 files changed

+63
-55
lines changed

5 files changed

+63
-55
lines changed
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
[id="serverless-ossm-enabling-serving-metrics_{context}"]
2+
= Enabling Knative Serving metrics when using Service Mesh with mTLS
3+
4+
If Service Mesh is enabled with mTLS, metrics for Knative Serving are disabled by default, because Service Mesh prevents Prometheus from scraping metrics. This section shows how to enable Knative Serving metrics when using Service Mesh and mTLS.
5+
6+
.Prerequisites
7+
8+
* You have installed the {ServerlessOperatorName} on your {product-title} cluster.
9+
* You have installed {ProductName} with the mTLS functionality enabled.
10+
* You have installed Knative Serving.
11+
12+
.Procedure
13+
14+
. Specify `prometheus` as the `metrics.backend-destination` in the `observability` spec of the Knative Serving custom resource (CR):
15+
+
16+
[source,yaml]
17+
----
18+
apiVersion: operator.knative.dev/v1beta1
19+
kind: KnativeServing
20+
metadata:
21+
name: knative-serving
22+
spec:
23+
config:
24+
observability:
25+
metrics.backend-destination: "prometheus"
26+
----
27+
+
28+
This step prevents metrics from being disabled by default.
29+
30+
. Apply the following network policy to allow traffic from the Prometheus namespace:
31+
+
32+
[source,yaml]
33+
----
34+
apiVersion: networking.k8s.io/v1
35+
kind: NetworkPolicy
36+
metadata:
37+
name: allow-from-openshift-monitoring-ns
38+
namespace: knative-serving
39+
spec:
40+
ingress:
41+
- from:
42+
- namespaceSelector:
43+
matchLabels:
44+
name: "openshift-monitoring"
45+
podSelector: {}
46+
----
47+
48+
. Modify and reapply the default Service Mesh control plane in the `istio-system` namespace, so that it includes the following spec:
49+
+
50+
[source,yaml]
51+
----
52+
spec:
53+
proxy:
54+
networking:
55+
trafficControl:
56+
inbound:
57+
excludedPorts:
58+
- 8444
59+
----

modules/serverless-rn-1-16-0.adoc

Lines changed: 1 addition & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -26,59 +26,7 @@ WARNING: found multiple channel heads: [amqstreams.v1.7.2 amqstreams.v1.6.2], pl
2626
+
2727
You can fix this issue by uninstalling the AMQ Streams Operator before installing or upgrading the {ServerlessOperatorName}. You can then reinstall the AMQ Streams Operator.
2828

29-
// Added note about the following to admin and dev metrics assemblies - remove these if the issue gets resolved.
30-
* If Service Mesh is enabled with mTLS, metrics for Knative Serving are disabled by default because Service Mesh prevents Prometheus from scraping metrics.
31-
+
32-
If you want to enable Knative Serving metrics for use with Service Mesh and mTLS, you must complete the following steps:
33-
34-
.. Specify `prometheus` as the `metrics.backend-destination` in the `observability` spec of the Knative Serving custom resource (CR):
35-
+
36-
[source,yaml]
37-
----
38-
apiVersion: operator.knative.dev/v1alpha1
39-
kind: KnativeServing
40-
metadata:
41-
name: knative-serving
42-
spec:
43-
config:
44-
observability:
45-
metrics.backend-destination: "prometheus"
46-
----
47-
+
48-
This step prevents metrics from being disabled by default.
49-
50-
.. Apply the following network policy to allow traffic from the Prometheus namespace:
51-
+
52-
[source,yaml]
53-
----
54-
apiVersion: networking.k8s.io/v1
55-
kind: NetworkPolicy
56-
metadata:
57-
name: allow-from-openshift-monitoring-ns
58-
namespace: knative-serving
59-
spec:
60-
ingress:
61-
- from:
62-
- namespaceSelector:
63-
matchLabels:
64-
name: "openshift-monitoring"
65-
podSelector: {}
66-
policyTypes:
67-
- Ingress
68-
----
69-
70-
.. Modify and reapply the default Service Mesh control plane in the `istio-system` namespace, so that it includes the following spec:
71-
+
72-
[source,yaml]
73-
----
74-
spec:
75-
proxy:
76-
networking:
77-
trafficControl:
78-
inbound:
79-
excludedPorts:
80-
- 8444
81-
----
29+
* If Service Mesh is enabled with mTLS, metrics for Knative Serving are disabled by default because Service Mesh prevents Prometheus from scraping metrics. For instructions on enabling Knative Serving metrics for use with Service Mesh and mTLS, see the "Integrating Service Mesh with OpenShift Serverless" section of the Serverless documentation.
8230

8331
* If you deploy Service Mesh CRs with the Istio ingress enabled, you might see the following warning in the `istio-ingressgateway` pod:
8432
+

serverless/admin_guide/serverless-admin-metrics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Metrics enable cluster administrators to monitor how {ServerlessProductName} clu
1818
====
1919
If Service Mesh is enabled with mTLS, metrics for Knative Serving are disabled by default because Service Mesh prevents Prometheus from scraping metrics.
2020
21-
For information about resolving this issue, see the xref:../../serverless/serverless-release-notes.adoc#serverless-rn-1-16-0_serverless-release-notes[Serverless 1.16.0 release notes].
21+
For information about resolving this issue, see xref:../../serverless/admin_guide/serverless-ossm-setup.html#serverless-ossm-enabling-serving-metrics_serverless-ossm-setup[Integrating Service Mesh with OpenShift Serverless].
2222
====
2323

2424
// Common metrics

serverless/admin_guide/serverless-ossm-setup.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ If you want to use any domain name, including those which are not subdomains of
3232

3333
include::modules/serverlesss-ossm-external-certs.adoc[leveloffset=+2]
3434
include::modules/serverless-ossm-setup.adoc[leveloffset=+2]
35+
include::modules/serverless-ossm-enabling-serving-metrics.adoc[leveloffset=+2]
3536

3637
// With kourier
3738
include::modules/serverless-ossm-setup-with-kourier.adoc[leveloffset=+1]

serverless/knative_serving/serverless-serving-metrics.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Metrics enable developers to monitor how Knative services are performing.
1717
====
1818
If Service Mesh is enabled with mTLS, metrics for Knative Serving are disabled by default because Service Mesh prevents Prometheus from scraping metrics.
1919
20-
For information about resolving this issue, see the xref:../../serverless/serverless-release-notes.adoc#serverless-rn-1-16-0_serverless-release-notes[Serverless 1.16.0 release notes].
20+
For information about resolving this issue, see xref:../../serverless/admin_guide/serverless-ossm-setup.html#serverless-ossm-enabling-serving-metrics_serverless-ossm-setup[Integrating Service Mesh with OpenShift Serverless].
2121
====
2222

2323
include::modules/serverless-queue-proxy-metrics.adoc[leveloffset=+1]

0 commit comments

Comments
 (0)