Skip to content

Commit

Permalink
Parametrize cluster role name (#1141)
Browse files Browse the repository at this point in the history
Signed-off-by: Alejandro Moreno <amorenoc@vmware.com>
  • Loading branch information
alemorcuq authored Mar 9, 2023
1 parent 11176c9 commit 1f3e402
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 13 deletions.
23 changes: 12 additions & 11 deletions helm/sealed-secrets/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,18 @@ The command removes all the Kubernetes components associated with the chart and

### Other Parameters

| Name | Description | Value |
| --------------------------------------------- | ------------------------------------------------------------- | ------- |
| `serviceAccount.annotations` | Annotations for Sealed Secret service account | `{}` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `serviceAccount.labels` | Extra labels to be added to the ServiceAccount | `{}` |
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
| `serviceAccount.automountServiceAccountToken` | Specifies, whether to mount the service account API-token | `true` |
| `rbac.create` | Specifies whether RBAC resources should be created | `true` |
| `rbac.clusterRole` | Specifies whether the Cluster Role resource should be created | `true` |
| `rbac.labels` | Extra labels to be added to RBAC resources | `{}` |
| `rbac.pspEnabled` | PodSecurityPolicy | `false` |
| Name | Description | Value |
| --------------------------------------------- | ------------------------------------------------------------- | ------------------ |
| `serviceAccount.annotations` | Annotations for Sealed Secret service account | `{}` |
| `serviceAccount.create` | Specifies whether a ServiceAccount should be created | `true` |
| `serviceAccount.labels` | Extra labels to be added to the ServiceAccount | `{}` |
| `serviceAccount.name` | The name of the ServiceAccount to use. | `""` |
| `serviceAccount.automountServiceAccountToken` | Specifies, whether to mount the service account API-token | `true` |
| `rbac.create` | Specifies whether RBAC resources should be created | `true` |
| `rbac.clusterRole` | Specifies whether the Cluster Role resource should be created | `true` |
| `rbac.clusterRoleName` | Specifies the name for the Cluster Role resource | `secrets-unsealer` |
| `rbac.labels` | Extra labels to be added to RBAC resources | `{}` |
| `rbac.pspEnabled` | PodSecurityPolicy | `false` |

### Metrics parameters

Expand Down
2 changes: 1 addition & 1 deletion helm/sealed-secrets/templates/cluster-role-binding.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ metadata:
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: secrets-unsealer
name: {{ .Values.rbac.clusterRoleName }}
subjects:
- apiGroup: ""
kind: ServiceAccount
Expand Down
2 changes: 1 addition & 1 deletion helm/sealed-secrets/templates/cluster-role.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: secrets-unsealer
name: {{ .Values.rbac.clusterRoleName }}
labels: {{- include "sealed-secrets.labels" . | nindent 4 }}
{{- if .Values.rbac.labels }}
{{- include "sealed-secrets.render" ( dict "value" .Values.rbac.labels "context" $) | nindent 4 }}
Expand Down
3 changes: 3 additions & 0 deletions helm/sealed-secrets/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,9 @@ rbac:
## @param rbac.clusterRole Specifies whether the Cluster Role resource should be created
##
clusterRole: true
## @param rbac.clusterRoleName Specifies the name for the Cluster Role resource
##
clusterRoleName: "secrets-unsealer"
## @param rbac.labels Extra labels to be added to RBAC resources
##
labels: {}
Expand Down

0 comments on commit 1f3e402

Please sign in to comment.