Skip to content

Commit de348e3

Browse files
authored
Merge pull request #47457 from DebarghoGhosh/cluster-configuration-3817
RHDEVDOCS-3817 - Added cluster permission management
2 parents d89da45 + 2aa1fc1 commit de348e3

3 files changed

+83
-0
lines changed

cicd/gitops/configuring-an-openshift-cluster-by-deploying-an-application-with-cluster-configurations.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,7 @@ include::modules/gitops-creating-an-application-by-using-the-argo-cd-dashboard.a
2020
include::modules/gitops-creating-an-application-by-using-the-oc-tool.adoc[leveloffset=+1]
2121

2222
include::modules/gitops-synchronizing-your-application-application-with-your-git-repository.adoc[leveloffset=+1]
23+
24+
include::modules/gitops-inbuilt-permissions-for-cluster-config.adoc[leveloffset=+1]
25+
26+
include::modules/gitops-additional-permissions-for-cluster-config.adoc[leveloffset=+1]
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
// Module included in the following assembly:
2+
//
3+
// * configuring-an-openshift-cluster-by-deploying-an-application-with-cluster-configurations.adoc
4+
5+
:_content-type: PROCEDURE
6+
[id="gitops-additional-permissions-for-cluster-config_{context}"]
7+
= Adding permissions for cluster configuration
8+
9+
You can grant permissions for an Argo CD instance to manage cluster configuration. Create a cluster role with additional permissions and then create a new cluster role binding to associate the cluster role with a service account.
10+
11+
.Procedure
12+
13+
. Log in to the {product-title} web console as an admin.
14+
. In the wev console, select **User Management** -> **Roles** -> **Create Role**. Use the following `ClusterRole` YAML template to add rules to specify the additional permissions.
15+
+
16+
[source,yaml]
17+
----
18+
apiVersion: rbac.authorization.k8s.io/v1
19+
kind: ClusterRole
20+
metadata:
21+
name: secrets-cluster-role
22+
rules:
23+
- apiGroups: [""]
24+
resources: ["secrets"]
25+
verbs: ["*"]
26+
----
27+
. Click **Create** to add the cluster role.
28+
. Now create the cluster role binding. In the web console, select **User Management** -> **Role Bindings** -> **Create Binding**.
29+
. Select **All Projects** from the **Project** drop-down.
30+
. Click **Create binding**.
31+
. Select **Binding type** as **Cluster-wide role binding (ClusterRoleBinding)**.
32+
. Enter a unique value for the **RoleBinding name**.
33+
. Select the newly created cluster role or an existing cluster role from the drop down list.
34+
. Select the **Subject** as **ServiceAccount** and the provide the **Subject namespace** and **name**.
35+
.. **Subject namespace**: `openshift-gitops`
36+
.. **Subject name**: `openshift-gitops-argocd-application-controller`
37+
. Click **Create**. The YAML file for the `ClusterRoleBinding` object is as follows:
38+
+
39+
[source,yaml]
40+
----
41+
kind: ClusterRoleBinding
42+
apiVersion: rbac.authorization.k8s.io/v1
43+
metadata:
44+
name: cluster-role-binding
45+
subjects:
46+
- kind: ServiceAccount
47+
name: openshift-gitops-argocd-application-controller
48+
namespace: openshift-gitops
49+
roleRef:
50+
apiGroup: rbac.authorization.k8s.io
51+
kind: ClusterRole
52+
name: admin
53+
----
54+
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Module included in the following assembly:
2+
//
3+
// * configuring-an-openshift-cluster-by-deploying-an-application-with-cluster-configurations.adoc
4+
5+
:_content-type: REFERENCE
6+
[id="gitops-inbuilt-permissions-for-cluster-config_{context}"]
7+
= In-built permissions for cluster configuration
8+
9+
By default, the Argo CD instance has permissions to manage specific cluster-scoped resources such as platform Operators, optional OLM Operators and user management.
10+
11+
[NOTE]
12+
====
13+
Argo CD does not have cluster-admin permissions.
14+
====
15+
16+
Permissions for the Argo CD instance:
17+
|===
18+
|**Resources** |**Descriptions**
19+
|Resource Groups | Configure the user or administrator
20+
|`operators.coreos.com` | Optional Operators managed by OLM
21+
|`user.openshift.io` , `rbac.authorization.k8s.io` | Groups, Users and their permissions
22+
|`config.openshift.io` | Control plane Operators managed by CVO used to configure cluster-wide build configuration, registry configuration and scheduler policies
23+
|`storage.k8s.io` | Storage
24+
|`console.openshift.io` | Console customization
25+
|===

0 commit comments

Comments
 (0)