Skip to content

Commit c07f0db

Browse files
Add optional clusterRole and clusterRoleBinding (#71)
* add cluster role and cluster role binding for the new configreloader * add comments about clusterroles * helm-docs: automated action --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent f2e8f72 commit c07f0db

File tree

5 files changed

+52
-3
lines changed

5 files changed

+52
-3
lines changed

charts/appset-secret-plugin/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ description: A Helm chart for adding a K8s Secret Plugin Generator to Argo CD Ap
66
# to be deployed.
77
type: application
88

9-
version: 1.0.2
9+
version: 1.1.0
1010

1111
# renovate: image=jessebot/argocd-appset-secret-plugin
1212
appVersion: "v0.8.1"

charts/appset-secret-plugin/README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# appset-secret-plugin
22

3-
![Version: 1.0.2](https://img.shields.io/badge/Version-1.0.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.8.1](https://img.shields.io/badge/AppVersion-v0.8.1-informational?style=flat-square)
3+
![Version: 1.1.0](https://img.shields.io/badge/Version-1.1.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: v0.8.1](https://img.shields.io/badge/AppVersion-v0.8.1-informational?style=flat-square)
44

55
A Helm chart for adding a K8s Secret Plugin Generator to Argo CD ApplicationSets
66

@@ -21,7 +21,7 @@ A Helm chart for adding a K8s Secret Plugin Generator to Argo CD ApplicationSets
2121
| autoscaling.targetCPUUtilizationPercentage | int | `80` | |
2222
| configReloader.folder | string | `"/var/run/secret-plugin"` | full path on container to put secret file |
2323
| configReloader.image.pullPolicy | string | `"IfNotPresent"` | image pullPolicy for the main container |
24-
| configReloader.image.repository | string | `"quay.io/kiwigrid/k8s-sidecar"` | registry and repo for the configreloader image |
24+
| configReloader.image.repository | string | `"quay.io/kiwigrid/k8s-sidecar"` | registry and repo for the configreloader image defaults to https://github.com/kiwigrid/k8s-sidecar |
2525
| configReloader.image.tag | string | `"1.30.9"` | tag to point at for k8s-sidecar |
2626
| configReloader.interval | int | `10` | interval to wait before retrying a check for changes (in seconds) |
2727
| configReloader.label | string | `"argocd-appset-secret-plugin"` | the label to check for on the Secret (secretVars.existingSecret) |
@@ -36,6 +36,8 @@ A Helm chart for adding a K8s Secret Plugin Generator to Argo CD ApplicationSets
3636
| nodeSelector | object | `{}` | deploy chart to a specific k8s node |
3737
| podAnnotations | object | `{}` | any additional annotations you'd like the pod to have |
3838
| podSecurityContext | object | `{}` | securityContext for the pod: https://kubernetes.io/docs/tasks/configure-pod-container/security-context/ |
39+
| rbac.create | bool | `true` | create rbac clusterole and clusterolebinding |
40+
| rbac.useExistingClusterRole | string | `""` | use existing clusterole, but still create clusterrolebinding |
3941
| replicaCount | int | `1` | number of replica pods to create |
4042
| resources | object | `{}` | |
4143
| secretVars.existingSecret | string | `""` | name of an existing secret to use for the secret keys to provide to applicationSets via the plugin generator |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{{- if and .Values.rbac.create (not .Values.rbac.useExistingClusterRole) }}
2+
kind: ClusterRole
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
labels:
6+
{{- include "argocd-appset-secret-plugin.labels" . | nindent 4 }}
7+
{{- with .Values.annotations }}
8+
annotations:
9+
{{- toYaml . | nindent 4 }}
10+
{{- end }}
11+
name: {{ include "argocd-appset-secret-plugin.fullname" . }}-clusterrole
12+
rules:
13+
- apiGroups: [""] # "" indicates the core API group
14+
resources: ["secrets"]
15+
verbs: ["get", "watch", "list"]
16+
{{- end}}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
{{- if .Values.rbac.create }}
2+
kind: ClusterRoleBinding
3+
apiVersion: rbac.authorization.k8s.io/v1
4+
metadata:
5+
name: {{ include "argocd-appset-secret-plugin.fullname" . }}-clusterrolebinding
6+
labels:
7+
{{- include "argocd-appset-secret-plugin.labels" . | nindent 4 }}
8+
{{- with .Values.annotations }}
9+
annotations:
10+
{{- toYaml . | nindent 4 }}
11+
{{- end }}
12+
subjects:
13+
- kind: ServiceAccount
14+
name: {{ include "argocd-appset-secret-plugin.serviceAccountName" . }}
15+
namespace: {{ .Release.Namespace }}
16+
roleRef:
17+
kind: ClusterRole
18+
{{- if .Values.rbac.useExistingClusterRole }}
19+
name: {{ .Values.rbac.useExistingClusterRole }}
20+
{{- else }}
21+
name: {{ include "argocd-appset-secret-plugin.fullname" . }}-clusterrole
22+
{{- end }}
23+
apiGroup: rbac.authorization.k8s.io
24+
{{- end }}

charts/appset-secret-plugin/values.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,13 @@ autoscaling:
108108
targetCPUUtilizationPercentage: 80
109109
# targetMemoryUtilizationPercentage: 80
110110

111+
# rbac rules needed to run the above configReloader
112+
rbac:
113+
# -- create rbac clusterole and clusterolebinding
114+
create: true
115+
# -- use existing clusterole, but still create clusterrolebinding
116+
useExistingClusterRole: ""
117+
111118
# -- deploy chart to a specific k8s node
112119
nodeSelector: {}
113120

0 commit comments

Comments
 (0)