linkerd2/charts/linkerd2/templates/identity-rbac.yaml

52 lines
1.2 KiB
YAML

{{with .Values -}}
{{if .Identity -}}
---
###
### Identity Controller Service RBAC
###
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: linkerd-{{.Namespace}}-identity
labels:
{{.ControllerComponentLabel}}: identity
{{.ControllerNamespaceLabel}}: {{.Namespace}}
rules:
- apiGroups: ["authentication.k8s.io"]
resources: ["tokenreviews"]
verbs: ["create"]
- apiGroups: ["apps"]
resources: ["deployments"]
verbs: ["get"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "patch"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: linkerd-{{.Namespace}}-identity
labels:
{{.ControllerComponentLabel}}: identity
{{.ControllerNamespaceLabel}}: {{.Namespace}}
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: linkerd-{{.Namespace}}-identity
subjects:
- kind: ServiceAccount
name: linkerd-identity
namespace: {{.Namespace}}
---
kind: ServiceAccount
apiVersion: v1
metadata:
name: linkerd-identity
namespace: {{.Namespace}}
labels:
{{.ControllerComponentLabel}}: identity
{{.ControllerNamespaceLabel}}: {{.Namespace}}
{{ end -}}
{{ end -}}