|
| 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 | + |
0 commit comments