Skip to content

Commit 93e521a

Browse files
committed
feat(auto_docs_examples): adjust and add more examples
1 parent e7abc6a commit 93e521a

27 files changed

+693
-696
lines changed

Documentation/resources.adoc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ Expose openshift-state-metrics `/metrics` endpoints within the cluster on the fo
103103

104104
Expose the Prometheus web server within the cluster on the following ports:
105105

106-
* Port 9091 provides access to all the Prometheus endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role.
106+
* Port 9091 provides access to all the Prometheus endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role or `cluster-monitoring-metrics-api` cluster role in the `openshift-monitoring` project.
107107
* Port 9092 provides access to the `/metrics` and `/federate` endpoints only. This port is for internal use, and no other usage is guaranteed.
108108

109109
=== openshift-user-workload-monitoring/prometheus-operator
@@ -131,7 +131,7 @@ Expose the `/metrics` endpoint on port 8443. This port is for internal use, and
131131

132132
Expose the Thanos Querier web server within the cluster on the following ports:
133133

134-
* Port 9091 provides access to all the Thanos Querier endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role.
134+
* Port 9091 provides access to all the Thanos Querier endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role or `cluster-monitoring-metrics-api` cluster role in the `openshift-monitoring` project.
135135
* Port 9092 provides access to the `/api/v1/query`, `/api/v1/query_range/`, `/api/v1/labels`, `/api/v1/label/*/values`, and `/api/v1/series` endpoints restricted to a given project. Granting access requires binding a user to the `view` cluster role in the project.
136136
* Port 9093 provides access to the `/api/v1/alerts`, and `/api/v1/rules` endpoints restricted to a given project. Granting access requires binding a user to the `monitoring-rules-edit` cluster role or `monitoring-edit` cluster role or `monitoring-rules-view` cluster role in the project.
137137
* Port 9094 provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.

Documentation/resources.md

Lines changed: 248 additions & 26 deletions
Large diffs are not rendered by default.

assets/alertmanager/service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ metadata:
77
* Port 9094 provides access to all the Alertmanager endpoints. Granting access requires binding a user to the `monitoring-alertmanager-view` role (for read-only operations) or `monitoring-alertmanager-edit` role in the `openshift-monitoring` project.
88
xx_omitted_before_deploy__test_file_name:openshift-monitoring_alertmanager-main_service_port_9094.yaml
99
* Port 9092 provides access to the Alertmanager endpoints restricted to a given project. Granting access requires binding a user to the `monitoring-rules-edit` cluster role or `monitoring-edit` cluster role in the project.
10+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_alertmanager-main_service_port_9092.yaml
1011
* Port 9097 provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
1112
service.beta.openshift.io/serving-cert-secret-name: alertmanager-main-tls
1213
labels:

assets/prometheus-k8s/service.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ metadata:
44
annotations:
55
openshift.io/description: |-
66
Expose the Prometheus web server within the cluster on the following ports:
7-
* Port 9091 provides access to all the Prometheus endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role.
7+
* Port 9091 provides access to all the Prometheus endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role or `cluster-monitoring-metrics-api` cluster role in the `openshift-monitoring` project.
8+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_prometheus-k8s_service_port_9091.yaml
89
* Port 9092 provides access to the `/metrics` and `/federate` endpoints only. This port is for internal use, and no other usage is guaranteed.
910
service.beta.openshift.io/serving-cert-secret-name: prometheus-k8s-tls
1011
labels:

assets/thanos-querier/service.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ metadata:
44
annotations:
55
openshift.io/description: |-
66
Expose the Thanos Querier web server within the cluster on the following ports:
7-
* Port 9091 provides access to all the Thanos Querier endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role.
7+
* Port 9091 provides access to all the Thanos Querier endpoints. Granting access requires binding a user to the `cluster-monitoring-view` cluster role or `cluster-monitoring-metrics-api` cluster role in the `openshift-monitoring` project.
8+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_thanos-querier_service_port_9091.yaml
89
* Port 9092 provides access to the `/api/v1/query`, `/api/v1/query_range/`, `/api/v1/labels`, `/api/v1/label/*/values`, and `/api/v1/series` endpoints restricted to a given project. Granting access requires binding a user to the `view` cluster role in the project.
10+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_thanos-querier_service_port_9092.yaml
911
* Port 9093 provides access to the `/api/v1/alerts`, and `/api/v1/rules` endpoints restricted to a given project. Granting access requires binding a user to the `monitoring-rules-edit` cluster role or `monitoring-edit` cluster role or `monitoring-rules-view` cluster role in the project.
12+
xx_omitted_before_deploy__test_file_name:openshift-monitoring_thanos-querier_service_port_9093.yaml
1013
* Port 9094 provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
1114
service.beta.openshift.io/serving-cert-secret-name: thanos-querier-tls
1215
labels:

go.mod

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ require (
1010
github.com/go-openapi/strfmt v0.23.0
1111
github.com/google/uuid v1.6.0
1212
github.com/imdario/mergo v0.3.16
13-
github.com/mattn/go-shellwords v1.0.12
1413
github.com/onsi/ginkgo/v2 v2.22.0
1514
github.com/onsi/gomega v1.36.1
1615
github.com/openshift-eng/openshift-tests-extension v0.0.0-20250702172817-97309544869d

go.sum

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,6 @@ github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxec
267267
github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
268268
github.com/mattn/go-isatty v0.0.20 h1:xfD0iDuEKnDkl03q4limB+vH+GxLEtL/jb4xVJSWWEY=
269269
github.com/mattn/go-isatty v0.0.20/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
270-
github.com/mattn/go-shellwords v1.0.12 h1:M2zGm7EW6UQJvDeQxo4T51eKPurbeFbe8WtebGE2xrk=
271-
github.com/mattn/go-shellwords v1.0.12/go.mod h1:EZzvwXDESEeg03EKmM+RmDnNOPKG4lLtQsUlTZDWQ8Y=
272270
github.com/miekg/dns v1.1.65 h1:0+tIPHzUW0GCge7IiK3guGP57VAw7hoPDfApjkMD1Fc=
273271
github.com/miekg/dns v1.1.65/go.mod h1:Dzw9769uoKVaLuODMDZz9M6ynFU6Em65csPuoi8G0ck=
274272
github.com/mistifyio/go-zfs v2.1.2-0.20190413222219-f784269be439+incompatible h1:aKW/4cBs+yK6gpqU3K/oIwk9Q/XICqd3zOX/UFuvqmk=

jsonnet/components/alertmanager.libsonnet

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,13 +71,15 @@ function(params)
7171
* Port %d provides access to all the Alertmanager endpoints. %s
7272
%s
7373
* Port %d provides access to the Alertmanager endpoints restricted to a given project. %s
74+
%s
7475
* Port %d provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
7576
||| % [
7677
$.service.spec.ports[0].port,
7778
requiredRoles([['monitoring-alertmanager-view', 'for read-only operations'], 'monitoring-alertmanager-edit'], 'openshift-monitoring'),
7879
testFilePlaceholder('openshift-monitoring', 'alertmanager-main', $.service.spec.ports[0].port),
7980
$.service.spec.ports[1].port,
8081
requiredClusterRoles(['monitoring-rules-edit', 'monitoring-edit'], false, ''),
82+
testFilePlaceholder('openshift-monitoring', 'alertmanager-main', $.service.spec.ports[1].port),
8183
$.service.spec.ports[2].port,
8284
],
8385
),

jsonnet/components/prometheus.libsonnet

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ local generateSecret = import '../utils/generate-secret.libsonnet';
55
local prometheus = import 'github.com/prometheus-operator/kube-prometheus/jsonnet/kube-prometheus/components/prometheus.libsonnet';
66
local withDescription = (import '../utils/add-annotations.libsonnet').withDescription;
77
local requiredClusterRoles = (import '../utils/add-annotations.libsonnet').requiredClusterRoles;
8+
local testFilePlaceholder = (import '../utils/add-annotations.libsonnet').testFilePlaceholder;
89

910
function(params)
1011
local cfg = params;
@@ -103,10 +104,12 @@ function(params)
103104
|||
104105
Expose the Prometheus web server within the cluster on the following ports:
105106
* Port %d provides access to all the Prometheus endpoints. %s
107+
%s
106108
* Port %d provides access to the `/metrics` and `/federate` endpoints only. This port is for internal use, and no other usage is guaranteed.
107109
||| % [
108110
$.service.spec.ports[0].port,
109-
requiredClusterRoles(['cluster-monitoring-view'], true),
111+
requiredClusterRoles(['cluster-monitoring-view', 'cluster-monitoring-metrics-api'], false, 'openshift-monitoring'),
112+
testFilePlaceholder('openshift-monitoring', 'prometheus-k8s', $.service.spec.ports[0].port),
110113
$.service.spec.ports[1].port,
111114
],
112115
),

jsonnet/components/thanos-querier.libsonnet

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
local generateSecret = import '../utils/generate-secret.libsonnet';
22
local querier = import 'github.com/thanos-io/kube-thanos/jsonnet/kube-thanos/kube-thanos-query.libsonnet';
33
local withDescription = (import '../utils/add-annotations.libsonnet').withDescription;
4+
local testFilePlaceholder = (import '../utils/add-annotations.libsonnet').testFilePlaceholder;
45
local requiredRoles = (import '../utils/add-annotations.libsonnet').requiredRoles;
56
local requiredClusterRoles = (import '../utils/add-annotations.libsonnet').requiredClusterRoles;
67

@@ -199,16 +200,22 @@ function(params)
199200
|||
200201
Expose the Thanos Querier web server within the cluster on the following ports:
201202
* Port %d provides access to all the Thanos Querier endpoints. %s
203+
%s
202204
* Port %d provides access to the `/api/v1/query`, `/api/v1/query_range/`, `/api/v1/labels`, `/api/v1/label/*/values`, and `/api/v1/series` endpoints restricted to a given project. %s
205+
%s
203206
* Port %d provides access to the `/api/v1/alerts`, and `/api/v1/rules` endpoints restricted to a given project. %s
207+
%s
204208
* Port %d provides access to the `/metrics` endpoint only. This port is for internal use, and no other usage is guaranteed.
205209
||| % [
206210
$.service.spec.ports[0].port,
207-
requiredClusterRoles(['cluster-monitoring-view'], true),
211+
requiredClusterRoles(['cluster-monitoring-view', 'cluster-monitoring-metrics-api'], false, 'openshift-monitoring'),
212+
testFilePlaceholder('openshift-monitoring', 'thanos-querier', $.service.spec.ports[0].port),
208213
$.service.spec.ports[1].port,
209214
requiredClusterRoles(['view'], false, ''),
215+
testFilePlaceholder('openshift-monitoring', 'thanos-querier', $.service.spec.ports[1].port),
210216
$.service.spec.ports[2].port,
211217
requiredClusterRoles(['monitoring-rules-edit', 'monitoring-edit', 'monitoring-rules-view'], false, ''),
218+
testFilePlaceholder('openshift-monitoring', 'thanos-querier', $.service.spec.ports[2].port),
212219
$.service.spec.ports[3].port,
213220
],
214221
),

0 commit comments

Comments
 (0)