| 
 | 1 | +# Argo CD RBAC Operator  | 
 | 2 | + | 
 | 3 | +[](https://goreportcard.com/report/github.com/argoproj-labs/argocd-rbac-operator)  | 
 | 4 | +[](https://github.com/argoproj-labs/argocd-rbac-operator)  | 
 | 5 | +[](https://github.com/argoproj-labs/argocd-rbac-operator/releases/tag/v0.1.6)  | 
 | 6 | +[](https://artifacthub.io/packages/search?repo=argocd-rbac-operator)  | 
 | 7 | + | 
 | 8 | +Kubernetes Operator for Argo CD RBAC Management.  | 
 | 9 | + | 
 | 10 | +## Introduction  | 
 | 11 | + | 
 | 12 | +The Argo CD RBAC Operator provides a CRD based API for the RBAC management of Argo CD. It provides a structured and easy to use way to define RBAC policies. The Operator uses the CRs as a single source of truth for RBAC management and converts them into a policy string that is patched into the Argo CD RBAC ConfigMap.  | 
 | 13 | + | 
 | 14 | +## Installation  | 
 | 15 | + | 
 | 16 | +First you have to add the repo:  | 
 | 17 | + | 
 | 18 | +```bash  | 
 | 19 | +helm repo add argocd-rbac-operator https://argoproj-labs.github.io/argocd-rbac-operator/  | 
 | 20 | +```  | 
 | 21 | + | 
 | 22 | +After the repo has been added, you can install the Helm chart of the operator:  | 
 | 23 | + | 
 | 24 | +```bash  | 
 | 25 | +helm install argocd-rbac-operator argocd-rbac-operator/argocd-rbac-operator  | 
 | 26 | +```  | 
 | 27 | + | 
 | 28 | +If you want to change the namespace of the Argo CD instance, image version, or other values, you have to define a values.yaml file and run following command:  | 
 | 29 | + | 
 | 30 | +```bash  | 
 | 31 | +helm install argocd-rbac-operator argocd-rbac-operator/argocd-rbac-operator -f values.yaml  | 
 | 32 | +```  | 
 | 33 | + | 
 | 34 | +## Usage  | 
 | 35 | + | 
 | 36 | +The following example shows a manifest to create a new ArgoCDRole `test-role`:  | 
 | 37 | + | 
 | 38 | +```yaml  | 
 | 39 | +apiVersion: rbac-operator.argoproj-labs.io/v1alpha1  | 
 | 40 | +kind: ArgoCDRole  | 
 | 41 | +metadata:  | 
 | 42 | +  labels:  | 
 | 43 | +    app.kubernetes.io/name: argocd-rbac-operator  | 
 | 44 | +    app.kubernetes.io/managed-by: kustomize  | 
 | 45 | +  name: test-role  | 
 | 46 | +  namespace: test-ns  | 
 | 47 | +spec:  | 
 | 48 | +  rules:  | 
 | 49 | +  - resource: "applications"  | 
 | 50 | +    verbs: ["get", "create", "update", "delete"]  | 
 | 51 | +    objects: ["*/*"]  | 
 | 52 | +```  | 
 | 53 | +
  | 
 | 54 | +And a ArgoCDRoleBinding `test-role-binding` to bind the specified users and a role to the new ArgoCDRole:  | 
 | 55 | + | 
 | 56 | +```yaml  | 
 | 57 | +apiVersion: rbac-operator.argoproj-labs.io/v1alpha1  | 
 | 58 | +kind: ArgoCDRoleBinding  | 
 | 59 | +metadata:  | 
 | 60 | +  labels:  | 
 | 61 | +    app.kubernetes.io/name: argocd-rbac-operator  | 
 | 62 | +    app.kubernetes.io/managed-by: kustomize  | 
 | 63 | +  name: test-role-binding  | 
 | 64 | +  namespace: test-ns  | 
 | 65 | +spec:  | 
 | 66 | +  subjects:  | 
 | 67 | +  - kind: "sso"  | 
 | 68 | +    name: "gosha"  | 
 | 69 | +  - kind: "local"  | 
 | 70 | +    name: "localUser"  | 
 | 71 | +  - kind: "role"  | 
 | 72 | +    name: "orgadmin"  | 
 | 73 | +  argocdRoleRef:  | 
 | 74 | +    name: "test-role"  | 
 | 75 | +```  | 
 | 76 | + | 
 | 77 | +### Create  | 
 | 78 | + | 
 | 79 | +Make sure that the `argocd` Namespace exists, so that the ConfigMap can be created properly.  | 
 | 80 | + | 
 | 81 | +Create a new ArgoCDRole and ArgoCDRoleBinding using the provided example. (Make sure that both CRs are created in the same Namespace)  | 
 | 82 | + | 
 | 83 | +```bash  | 
 | 84 | +kubectl create -f test-role.yaml  | 
 | 85 | +kubectl create -f test-role-binding.yaml  | 
 | 86 | +```  | 
 | 87 | + | 
 | 88 | +The following ConfigMap will be created after the ArgoCDRole and ArgoCDRoleBinding has been reconciled.  | 
 | 89 | + | 
 | 90 | +```yaml  | 
 | 91 | +apiVersion: v1  | 
 | 92 | +data:  | 
 | 93 | +  policy.csv: ""  | 
 | 94 | +  policy.default: role:readonly  | 
 | 95 | +  policy.test-ns.test-role.csv: |  | 
 | 96 | +    p, role:test-role, applications, get, */*, allow  | 
 | 97 | +    p, role:test-role, applications, create, */*, allow  | 
 | 98 | +    p, role:test-role, applications, update, */*, allow  | 
 | 99 | +    p, role:test-role, applications, delete, */*, allow  | 
 | 100 | +    g, gosha, role:test-role  | 
 | 101 | +    p, localUser, applications, get, */*, allow  | 
 | 102 | +    p, localUser, applications, create, */*, allow  | 
 | 103 | +    p, localUser, applications, update, */*, allow  | 
 | 104 | +    p, localUser, applications, delete, */*, allow  | 
 | 105 | +    g, role:orgadmin, role:test-role  | 
 | 106 | +  scopes: '[groups]'  | 
 | 107 | +kind: ConfigMap  | 
 | 108 | +metadata:  | 
 | 109 | +  name: argocd-rbac-cm  | 
 | 110 | +  namespace: argocd  | 
 | 111 | +```  | 
 | 112 | + | 
 | 113 | +### Delete  | 
 | 114 | + | 
 | 115 | +To delete a Role you can use `kubectl`  | 
 | 116 | +```  | 
 | 117 | +kubectl delete argocdrole.rbac-operator.argoproj-labs.io/test-role  | 
 | 118 | +kubectl delete argocdrolebinding.rbac-operator.argoproj-labs.io/test-role-binding  | 
 | 119 | +```  | 
 | 120 | +After the Resource is deleted, the policy string will be also deleted from the RBAC-CM.  | 
 | 121 | +
  | 
 | 122 | +### Change the Policy.CSV  | 
 | 123 | +
  | 
 | 124 | +To change the policy.csv you have to make changes in the `internal/controller/common/defaults.go` file.  | 
 | 125 | +
  | 
 | 126 | +### Deployment types  | 
 | 127 | +
  | 
 | 128 | +As for now only single Argo CD deployment type is supported. The default Argo CD namespace is defined as `argocd`, to change that you have to make a change in `internal/controller/common/values.go`.  | 
 | 129 | +
  | 
 | 130 | +## General parameters  | 
 | 131 | +
  | 
 | 132 | +| Key | Type | Default | Description |  | 
 | 133 | +|-----|------|---------|-------------|  | 
 | 134 | +| additionalLabels | object | `{}` |  |  | 
 | 135 | +| argocd.cmName | string | `"argocd-rbac-cm"` |  |  | 
 | 136 | +| argocd.namespace | string | `"argocd"` |  |  | 
 | 137 | +| containerSecurityContext.allowPrivilegeEscalation | bool | `false` |  |  | 
 | 138 | +| containerSecurityContext.capabilities.drop[0] | string | `"ALL"` |  |  | 
 | 139 | +| containerSecurityContext.readOnlyRootFilesystem | bool | `true` |  |  | 
 | 140 | +| containerSecurityContext.runAsNonRoot | bool | `true` |  |  | 
 | 141 | +| containerSecurityContext.seccompProfile.type | string | `"RuntimeDefault"` |  |  | 
 | 142 | +| image.pullPolicy | string | `"IfNotPresent"` |  |  | 
 | 143 | +| image.repository | string | `"quay.io/argoprojlabs/argocd-rbac-operator"` |  |  | 
 | 144 | +| image.tag | string | `"v0.1.6"` |  |  | 
 | 145 | +| imagePullSecrets | list | `[]` |  |  | 
 | 146 | +| livenessProbe.httpGet.path | string | `"/healthz"` |  |  | 
 | 147 | +| livenessProbe.httpGet.port | int | `8081` |  |  | 
 | 148 | +| livenessProbe.initialDelaySeconds | int | `15` |  |  | 
 | 149 | +| livenessProbe.periodSeconds | int | `20` |  |  | 
 | 150 | +| nodeSelector | object | `{}` |  |  | 
 | 151 | +| readinessProbe.httpGet.path | string | `"/readyz"` |  |  | 
 | 152 | +| readinessProbe.httpGet.port | int | `8081` |  |  | 
 | 153 | +| readinessProbe.initialDelaySeconds | int | `5` |  |  | 
 | 154 | +| readinessProbe.periodSeconds | int | `10` |  |  | 
 | 155 | +| replicaCount | int | `1` |  |  | 
 | 156 | +| resources.limits.cpu | string | `"500m"` |  |  | 
 | 157 | +| resources.limits.memory | string | `"128Mi"` |  |  | 
 | 158 | +| resources.requests.cpu | string | `"10m"` |  |  | 
 | 159 | +| resources.requests.memory | string | `"64Mi"` |  |  | 
 | 160 | +| securityContext.runAsNonRoot | bool | `true` |  |  | 
 | 161 | +| securityContext.seccompProfile.type | string | `"RuntimeDefault"` |  |  | 
 | 162 | +| serviceAccountAnnotations | list | `[]` |  |  | 
 | 163 | +
  | 
 | 164 | +----------------------------------------------  | 
 | 165 | +Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)  | 
0 commit comments