Skip to content

Commit

Permalink
Merge pull request #6241 from erikgb/rbac-cluster-reader
Browse files Browse the repository at this point in the history
Add view permission to all resources to cluster-reader aggregated cluster role
  • Loading branch information
jetstack-bot committed Aug 21, 2023
2 parents 94dbae5 + 68568a8 commit 013b65f
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions deploy/charts/cert-manager/templates/rbac.yaml
Expand Up @@ -398,6 +398,26 @@ subjects:
namespace: {{ include "cert-manager.namespace" . }}
kind: ServiceAccount

{{- if .Values.global.rbac.aggregateClusterRoles }}
---

apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ template "cert-manager.fullname" . }}-cluster-view
labels:
app: {{ include "cert-manager.name" . }}
app.kubernetes.io/name: {{ include "cert-manager.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
app.kubernetes.io/component: "controller"
{{- include "labels" . | nindent 4 }}
rbac.authorization.k8s.io/aggregate-to-cluster-reader: "true"
rules:
- apiGroups: ["cert-manager.io"]
resources: ["clusterissuers"]
verbs: ["get", "list", "watch"]

{{- end }}
---

apiVersion: rbac.authorization.k8s.io/v1
Expand All @@ -414,6 +434,7 @@ metadata:
rbac.authorization.k8s.io/aggregate-to-view: "true"
rbac.authorization.k8s.io/aggregate-to-edit: "true"
rbac.authorization.k8s.io/aggregate-to-admin: "true"
rbac.authorization.k8s.io/aggregate-to-cluster-reader: "true"
{{- end }}
rules:
- apiGroups: ["cert-manager.io"]
Expand Down

0 comments on commit 013b65f

Please sign in to comment.