Skip to content

Commit a32a211

Browse files
OSDOCS#12884[4.18][OLMv1]Create RBAC to manage and install ce
1 parent 9a9f005 commit a32a211

12 files changed

+1231
-185
lines changed

extensions/ce/managing-ce.adoc

+9-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ toc::[]
88

99
After a catalog has been added to your cluster, you have access to the versions, patches, and over-the-air updates of the extensions and Operators that are published to the catalog.
1010

11-
You can manage extensions declaratively from the CLI using custom resources (CRs).
11+
You can use custom resources (CRs) to manage extensions declaratively from the CLI.
1212

1313
include::modules/olmv1-supported-extensions.adoc[leveloffset=+1]
1414

@@ -18,7 +18,14 @@ include::modules/olmv1-supported-extensions.adoc[leveloffset=+1]
1818
1919
include::modules/olmv1-finding-operators-to-install.adoc[leveloffset=+1]
2020
include::modules/olmv1-catalog-queries.adoc[leveloffset=+2]
21-
include::modules/olmv1-creating-a-service-account.adoc[leveloffset=+1]
21+
include::modules/olmv1-cluster-extension-permissions.adoc[leveloffset=+1]
22+
include::modules/olmv1-creating-a-namespace.adoc[leveloffset=+2]
23+
include::modules/olmv1-creating-a-service-account.adoc[leveloffset=+2]
24+
include::modules/olmv1-downloading-bundle-manifests.adoc[leveloffset=+2]
25+
include::modules/olmv1-required-rbac-to-install-and-manage-extension-resources.adoc[leveloffset=+2]
26+
include::modules/olmv1-creating-a-cluster-role.adoc[leveloffset=+2]
27+
include::modules/olmv1-example-pipelines-operator-cluster-role.adoc[leveloffset=+2]
28+
include::modules/olmv1-creating-a-cluster-role-binding.adoc[leveloffset=+2]
2229
include::modules/olmv1-installing-an-operator.adoc[leveloffset=+1]
2330

2431
[role="_additional-resources"]
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * extensions/ce/managing-ce.adoc
4+
5+
:_mod-docs-content-type: CONCEPT
6+
7+
[id="olmv1-cluster-extension-permissions_{context}"]
8+
= Cluster extension permissions
9+
10+
In {olmv0-first}, a single service account with cluster administrator privileges manages all cluster extensions.
11+
12+
{olmv1} is designed to be more secure than {olmv0} by default. {olmv1} manages a cluster extension by using the service account specified in an extension's custom resource (CR). Cluster administrators can create a service account for each cluster extension. As a result, administrators can follow the principle of least privilege and assign only the role-based access controls (RBAC) to install and manage that extension.
13+
14+
You must add each permission to either a cluster role or role. Then you must bind the cluster role or role to the service account with a cluster role binding or role binding.
15+
16+
You can scope the RBAC to either the cluster or to a namespace. Use cluster roles and cluster role bindings to scope permissions to the cluster. Use roles and role bindings to scope permissions to a namespace. Whether you scope the permissions to the cluster or to a namespace depends on the design of the extension you want to install and manage.
17+
18+
include::snippets/olmv1-manual-rbac-scoping-admonition.adoc[]
19+
20+
If a new version of an installed extension requires additional permissions, {olmv1} halts the update process until a cluster administrator grants those permissions.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
// Module included in the following assemblies:
2+
//
3+
// * extensions/ce/managing-ce.adoc
4+
5+
:_mod-docs-content-type: PROCEDURE
6+
7+
[id="olmv1-creating-a-cluster-rol-binding_{context}"]
8+
= Creating a cluster role binding for an extension
9+
10+
After you have created a service account and cluster role, you must bind the cluster role to the service account with a cluster role binding manifest.
11+
12+
.Prerequisites
13+
14+
* Access to an {product-title} cluster using an account with `cluster-admin` permissions.
15+
* You have created and applied the following resources for the extension you want to install:
16+
** Namespace
17+
** Service account
18+
** Cluster role
19+
20+
.Procedure
21+
22+
. Create a cluster role binding to bind the cluster role to the service account, similar to the following example:
23+
+
24+
[source,yaml]
25+
----
26+
apiVersion: rbac.authorization.k8s.io/v1
27+
kind: ClusterRoleBinding
28+
metadata:
29+
name: <extension>-installer-binding
30+
roleRef:
31+
apiGroup: rbac.authorization.k8s.io
32+
kind: ClusterRole
33+
name: <extension>-installer-clusterrole
34+
subjects:
35+
- kind: ServiceAccount
36+
name: <extension>-installer
37+
namespace: <namespace>
38+
----
39+
+
40+
.Example `pipelines-cluster-role-binding.yaml` file
41+
[%collapsible]
42+
====
43+
[source,yaml]
44+
----
45+
apiVersion: rbac.authorization.k8s.io/v1
46+
kind: ClusterRoleBinding
47+
metadata:
48+
name: pipelines-installer-binding
49+
roleRef:
50+
apiGroup: rbac.authorization.k8s.io
51+
kind: ClusterRole
52+
name: pipelines-installer-clusterrole
53+
subjects:
54+
- kind: ServiceAccount
55+
name: pipelines-installer
56+
namespace: pipelines
57+
----
58+
====
59+
60+
. Apply the cluster role binding by running the following command:
61+
+
62+
[source,terminal]
63+
----
64+
$ oc apply -f pipelines-cluster-role-binding.yaml
65+
----

0 commit comments

Comments
 (0)