aboutsummaryrefslogtreecommitdiffstats
path: root/deployments/helm/servicemesh/istio-operator/templates/operator-psp-basic.yaml
blob: b6e5eac629ac652d3c9ca5a0bccf4ce727980e05 (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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
{{- if and .Values.rbac.enabled .Values.rbac.psp.enabled }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
  name: {{ include "istio-operator.fullname" . }}-basic
  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: operator
spec:
  fsGroup:
    rule: RunAsAny
  runAsUser:
    rule: RunAsAny
  seLinux:
    rule: RunAsAny
  supplementalGroups:
    rule: RunAsAny
  volumes:
  - secret
  - configMap
  - emptyDir
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: psp:{{ include "istio-operator.fullname" . }}-basic
  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: operator
rules:
- apiGroups:
  - policy
  resourceNames:
  - {{ include "istio-operator.fullname" . }}-basic
  resources:
  - podsecuritypolicies
  verbs:
  - use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
  name: psp:{{ include "istio-operator.fullname" . }}-basic
  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: operator
roleRef:
  apiGroup: rbac.authorization.k8s.io
  kind: Role
  name: psp:{{ include "istio-operator.fullname" . }}-basic
subjects:
  - kind: ServiceAccount
    name: istio-citadel-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-galley-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-egressgateway-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-ingressgateway-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-mixer-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-operator-authproxy
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-pilot-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-sidecar-injector-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istiocoredns-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-nodeagent-service-account
    namespace: {{ .Release.Namespace }}
  - kind: ServiceAccount
    name: istio-operator-operator
    namespace: {{ .Release.Namespace }}
{{- end }}