-
Notifications
You must be signed in to change notification settings - Fork 12
/
podsecuritypolicy.yaml
38 lines (38 loc) · 1.12 KB
/
podsecuritypolicy.yaml
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
{{- if .Values.podSecurityPolicy.enabled }}
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ include "node-exporter-textfiles.fullname" . }}
labels:
{{- include "node-exporter-textfiles.labels" . | nindent 4 }}
annotations:
{{- if .Values.podSecurityPolicy.annotations }}
{{ toYaml .Values.podSecurityPolicy.annotations | indent 4 }}
{{- end }}
spec:
{{- toYaml .Values.podSecurityPolicy.spec | nindent 2 }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: {{ include "node-exporter-textfiles.fullname" . }}
rules:
- apiGroups: ['policy']
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ include "node-exporter-textfiles.fullname" . }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
name: {{ include "node-exporter-textfiles.fullname" . }}
roleRef:
kind: ClusterRole
name: {{ include "node-exporter-textfiles.fullname" . }}
apiGroup: rbac.authorization.k8s.io
subjects:
- kind: ServiceAccount
name: {{ include "node-exporter-textfiles.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
{{- end }}