Skip to content

Commit 1c2ec98

Browse files
committed
bump chart version and add README
Signed-off-by: Georgy Khromov <[email protected]>
1 parent 0ee5afc commit 1c2ec98

File tree

5 files changed

+322
-1
lines changed

5 files changed

+322
-1
lines changed

helm/argocd-rbac-operator/.helmignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,7 @@
2121
.idea/
2222
*.tmproj
2323
.vscode/
24+
25+
/*.tgz
26+
output
27+
*.gotmpl

helm/argocd-rbac-operator/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ appVersion: v0.1.6
33
name: argocd-rbac-operator
44
description: A Helm chart for Argo CD RBAC Operator, a Kubernetes Operator for Argo CD RBAC Management.
55
type: application
6-
version: 0.1.0
6+
version: 0.2.0
77
keywords:
88
- argocd
99
- operator
Lines changed: 165 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,165 @@
1+
# Argo CD RBAC Operator
2+
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/argoproj-labs/argocd-rbac-operator)](https://goreportcard.com/report/github.com/argoproj-labs/argocd-rbac-operator)
4+
[![go.mod Go version](https://img.shields.io/github/go-mod/go-version/argoproj-labs/argocd-rbac-operator)](https://github.com/argoproj-labs/argocd-rbac-operator)
5+
[![GitHub Release](https://img.shields.io/github/v/release/argoproj-labs/argocd-rbac-operator)](https://github.com/argoproj-labs/argocd-rbac-operator/releases/tag/v0.1.6)
6+
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/argocd-rbac-operator)](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)
Lines changed: 141 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,141 @@
1+
# Argo CD RBAC Operator
2+
3+
[![Go Report Card](https://goreportcard.com/badge/github.com/argoproj-labs/argocd-rbac-operator)](https://goreportcard.com/report/github.com/argoproj-labs/argocd-rbac-operator)
4+
[![go.mod Go version](https://img.shields.io/github/go-mod/go-version/argoproj-labs/argocd-rbac-operator)](https://github.com/argoproj-labs/argocd-rbac-operator)
5+
[![GitHub Release](https://img.shields.io/github/v/release/argoproj-labs/argocd-rbac-operator)](https://github.com/argoproj-labs/argocd-rbac-operator/releases/tag/v0.1.6)
6+
[![Artifact Hub](https://img.shields.io/endpoint?url=https://artifacthub.io/badge/repository/argocd-rbac-operator)](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+
{{- range .Values }}
135+
{{- if not (or (hasPrefix "global" .Key) (hasPrefix "configs" .Key) (hasPrefix "controller" .Key) (hasPrefix "repoServer" .Key) (hasPrefix "server" .Key) (hasPrefix "applicationSet" .Key) (hasPrefix "notifications" .Key) (hasPrefix "dex" .Key) (hasPrefix "redis" .Key) (hasPrefix "externalRedis" .Key) ) }}
136+
| {{ .Key }} | {{ .Type }} | {{ if .Default }}{{ .Default }}{{ else }}{{ .AutoDefault }}{{ end }} | {{ if .Description }}{{ .Description }}{{ else }}{{ .AutoDescription }}{{ end }} |
137+
{{- end }}
138+
{{- end }}
139+
140+
----------------------------------------------
141+
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)

helm/scripts/helm-docs.sh

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
#!/bin/bash
2+
## Reference: https://github.com/norwoodj/helm-docs
3+
set -eux
4+
REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)"
5+
echo "$REPO_ROOT"
6+
7+
echo "Running Helm-Docs"
8+
docker run \
9+
-v "$REPO_ROOT:/helm-docs" \
10+
-u $(id -u) \
11+
jnorwood/helm-docs:v1.9.1

0 commit comments

Comments
 (0)