summaryrefslogtreecommitdiffstats
path: root/deployments/helm/servicemesh/istio-operator/templates/authproxy-rbac.yaml
blob: aee3aeef72427dde4654232d83cce6801214fb6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
{{- if and .Values.rbac.enabled .Values.prometheusMetrics.enabled .Values.prometheusMetrics.authProxy.enabled }}
apiVersion: v1
kind: ServiceAccount
metadata:
  name: {{ include "istio-operator.fullname" . }}-authproxy
  namespace: {{ .Release.Namespace }}
  labels:
    app.kubernetes.io/name: {{ include "istio-operator.name" . }}
    helm.sh/chart: {{ include "istio-operator.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/version: {{ .Chart.AppVersion }}
    app.kubernetes.io/component: authproxy
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
  name: "{{ include "istio-operator.fullname" . }}-authproxy"
  labels:
    app.kubernetes.io/name: {{ include "istio-operator.name" . }}
    helm.sh/chart: {{ include "istio-operator.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/version: {{ .Chart.AppVersion }}
    app.kubernetes.io/component: authproxy
rules:
- apiGroups: ["authentication.k8s.io"]
  resources:
  - tokenreviews
  verbs: ["create"]
- apiGroups: ["authorization.k8s.io"]
  resources:
  - subjectaccessreviews
  verbs: ["create"]
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
  name: "{{ include "istio-operator.fullname" . }}-authproxy"
  labels:
    app.kubernetes.io/name: {{ include "istio-operator.name" . }}
    helm.sh/chart: {{ include "istio-operator.chart" . }}
    app.kubernetes.io/instance: {{ .Release.Name }}
    app.kubernetes.io/managed-by: {{ .Release.Service }}
    app.kubernetes.io/version: {{ .Chart.AppVersion }}
    app.kubernetes.io/component: authproxy
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: ClusterRole
  name: "{{ include "istio-operator.fullname" . }}-authproxy"
subjects:
- kind: ServiceAccount
  name: {{ include "istio-operator.fullname" . }}-authproxy
  namespace: {{ .Release.Namespace }}
{{- end }}