Skip to content

Commit ca10b2a

Browse files
authored
Merge pull request #63562 from skrthomas/OCPBUGS-17152
OCPBUGS#17152: Moving YAML to snippets
2 parents ad608b3 + ce53b44 commit ca10b2a

4 files changed

+86
-48
lines changed

modules/network-observability-auth-multi-tenancy.adoc

Lines changed: 3 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -12,51 +12,6 @@ Define `ClusterRole` and `ClusterRoleBinding`. The `netobserv-reader` `ClusterRo
1212
. Using the web console, click the Import icon, *+*.
1313
. Drop your YAML file into the editor and click *Create*:
1414
+
15-
[source, yaml]
16-
----
17-
apiVersion: rbac.authorization.k8s.io/v1
18-
kind: ClusterRole
19-
metadata:
20-
name: netobserv-reader <1>
21-
rules:
22-
- apiGroups:
23-
- 'loki.grafana.com'
24-
resources:
25-
- network
26-
resourceNames:
27-
- logs
28-
verbs:
29-
- 'get'
30-
...
31-
apiVersion: rbac.authorization.k8s.io/v1
32-
kind: ClusterRole
33-
metadata:
34-
name: netobserv-writer
35-
rules:
36-
- apiGroups:
37-
- 'loki.grafana.com'
38-
resources:
39-
- network
40-
resourceNames:
41-
- logs
42-
verbs:
43-
- 'create'
44-
...
45-
apiVersion: rbac.authorization.k8s.io/v1
46-
kind: ClusterRoleBinding
47-
metadata:
48-
name: netobserv-writer-flp
49-
roleRef:
50-
apiGroup: rbac.authorization.k8s.io
51-
kind: ClusterRole
52-
name: netobserv-writer
53-
subjects:
54-
- kind: ServiceAccount
55-
name: flowlogs-pipeline <2>
56-
namespace: netobserv
57-
- kind: ServiceAccount
58-
name: flowlogs-pipeline-transformer
59-
namespace: netobserv
60-
----
61-
<1> This role can be used for multi-tenancy.
62-
<2> The `flowlogs-pipeline` writes to Loki. If you are using Kafka, this value is `flowlogs-pipeline-transformer`.
15+
include::snippets/network-observability-clusterrole-reader.adoc[]
16+
include::snippets/network-observability-clusterrole-writer.adoc[]
17+
include::snippets/network-observability-clusterrolebinding.adoc[]
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Text snippet included in the following assemblies:
2+
//
3+
//
4+
//
5+
// Text snippet included in the following modules:
6+
//
7+
// * modules/network-observability-auth-multi-tenancy.adoc
8+
9+
:_content-type: SNIPPET
10+
.Example ClusterRole reader yaml
11+
[source, yaml]
12+
----
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: ClusterRole
15+
metadata:
16+
name: netobserv-reader <1>
17+
rules:
18+
- apiGroups:
19+
- 'loki.grafana.com'
20+
resources:
21+
- network
22+
resourceNames:
23+
- logs
24+
verbs:
25+
- 'get'
26+
----
27+
<1> This role can be used for multi-tenancy.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
// Text snippet included in the following assemblies:
2+
//
3+
//
4+
//
5+
// Text snippet included in the following modules:
6+
//
7+
// * modules/network-observability-auth-multi-tenancy.adoc
8+
9+
:_content-type: SNIPPET
10+
.Example ClusterRole writer yaml
11+
[source,yaml]
12+
----
13+
apiVersion: rbac.authorization.k8s.io/v1
14+
kind: ClusterRole
15+
metadata:
16+
name: netobserv-writer
17+
rules:
18+
- apiGroups:
19+
- 'loki.grafana.com'
20+
resources:
21+
- network
22+
resourceNames:
23+
- logs
24+
verbs:
25+
- 'create'
26+
----
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// Text snippet included in the following assemblies:
2+
//
3+
//
4+
//
5+
// Text snippet included in the following modules:
6+
//
7+
// * modules/network-observability-auth-multi-tenancy.adoc
8+
9+
:_content-type: SNIPPET
10+
11+
.Example ClusterRoleBinding yaml
12+
[source, yaml]
13+
----
14+
apiVersion: rbac.authorization.k8s.io/v1
15+
kind: ClusterRoleBinding
16+
metadata:
17+
name: netobserv-writer-flp
18+
roleRef:
19+
apiGroup: rbac.authorization.k8s.io
20+
kind: ClusterRole
21+
name: netobserv-writer
22+
subjects:
23+
- kind: ServiceAccount
24+
name: flowlogs-pipeline <1>
25+
namespace: netobserv
26+
- kind: ServiceAccount
27+
name: flowlogs-pipeline-transformer
28+
namespace: netobserv
29+
----
30+
<1> The `flowlogs-pipeline` writes to Loki. If you are using Kafka, this value is `flowlogs-pipeline-transformer`.

0 commit comments

Comments
 (0)