Skip to content

Commit 2372b2e

Browse files
johananlsmiklosovic
authored andcommitted
Add PSP for operator
On some clusters some default PSP may prevent the operator from running. Shipping a PSP with the operator makes it easier for the cluster admin to figure out exactly what permissions are required by the operator, and provides a base for customizations.
1 parent 6e04fab commit 2372b2e

File tree

2 files changed

+48
-0
lines changed

2 files changed

+48
-0
lines changed

deploy/psp.yaml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
apiVersion: policy/v1beta1
2+
kind: PodSecurityPolicy
3+
metadata:
4+
name: cassandra-operator
5+
annotations:
6+
seccomp.security.alpha.kubernetes.io/allowedProfileNames: 'docker/default'
7+
seccomp.security.alpha.kubernetes.io/defaultProfileName: 'docker/default'
8+
spec:
9+
privileged: false
10+
allowPrivilegeEscalation: false
11+
requiredDropCapabilities:
12+
- KILL
13+
- MKNOD
14+
- SETUID
15+
- SETGID
16+
volumes:
17+
- 'configMap'
18+
- 'emptyDir'
19+
- 'projected'
20+
- 'secret'
21+
- 'downwardAPI'
22+
- 'persistentVolumeClaim'
23+
hostNetwork: false
24+
hostIPC: false
25+
hostPID: false
26+
runAsUser:
27+
rule: 'MustRunAsNonRoot'
28+
seLinux:
29+
rule: 'RunAsAny'
30+
supplementalGroups:
31+
rule: 'MustRunAs'
32+
ranges:
33+
- min: 1
34+
max: 65535
35+
fsGroup:
36+
rule: 'MustRunAs'
37+
ranges:
38+
- min: 1
39+
max: 65535
40+
readOnlyRootFilesystem: true

deploy/role.yaml

+8
Original file line numberDiff line numberDiff line change
@@ -61,3 +61,11 @@ rules:
6161
- cassandrabackups
6262
verbs:
6363
- '*'
64+
- apiGroups:
65+
- policy
66+
resources:
67+
- podsecuritypolicies
68+
verbs:
69+
- use
70+
resourceNames:
71+
- cassandra-operator

0 commit comments

Comments
 (0)