-
Notifications
You must be signed in to change notification settings - Fork 47
Expand file tree
/
Copy pathpsp.yaml
More file actions
66 lines (66 loc) · 1.71 KB
/
psp.yaml
File metadata and controls
66 lines (66 loc) · 1.71 KB
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
{{- if and .Values.psp.create (.Capabilities.APIVersions.Has "policy/v1beta1/PodSecurityPolicy") }}
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
{{- with (merge .Values.customAnnotations .Values.psp.annotations) }}
annotations:
{{- toYaml . | nindent 4 }}
{{- end }}
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
spec:
{{- if .Values.hostNetwork.enabled }}
hostNetwork: true
hostPorts:
- min: {{ .Values.listenPort }}
max: {{ .Values.listenPort }}
{{- end }}
fsGroup:
rule: RunAsAny
runAsGroup:
rule: RunAsAny
runAsUser:
rule: MustRunAs
ranges:
- min: 1024
max: 65535
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- secret
- emptyDir
- configMap
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
name: {{ template "k8s-prometheus-adapter.name" . }}-psp
rules:
- apiGroups:
- 'policy'
resources: ['podsecuritypolicies']
verbs: ['use']
resourceNames:
- {{ template "k8s-prometheus-adapter.fullname" . }}
---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRoleBinding
metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
name: {{ template "k8s-prometheus-adapter.name" . }}-psp
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
name: {{ template "k8s-prometheus-adapter.name" . }}-psp
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}