ceph: add psp.yaml example (#3317)

ceph: add psp.yaml example
This commit is contained in:
Alexander Trost authored and GitHub committed 2019-06-18 17:48:29 +02:00
commit aa92e9a653
2 files changed
+37 -30

No files matched your search

+1 -30
View File
@@ -10,36 +10,7 @@ See the [Rook overall PSP document](./psp.md) before continuing on here with Cep
##### PodSecurityPolicy
You need at least one `PodSecurityPolicy` that allows privileged `Pod` execution. Here is an example
that is reasonably pared down for Ceph, though more work to minimize permissions can be done:
```yaml
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: privileged
spec:
fsGroup:
rule: RunAsAny
privileged: true
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'hostPath'
- 'flexVolume'
hostPID: true
# hostNetwork is required for using host networking
hostNetwork: false
```
You need at least one `PodSecurityPolicy` that allows privileged `Pod` execution. Please look at [https://github.com/rook/rook/cluster/examples/kubernetes/ceph/psp.yaml](psp.yaml) for a reasonably pared down for Ceph.
**Hint**: Allowing `hostNetwork` usage is required when using `hostNetwork: true` in the Cluster
Resource Definition! You are then also required to allow the usage of `hostPorts` in the
+36
View File
@@ -0,0 +1,36 @@
apiVersion: extensions/v1beta1
kind: PodSecurityPolicy
metadata:
name: rook
spec:
fsGroup:
rule: RunAsAny
privileged: true
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- 'configMap'
- 'emptyDir'
- 'projected'
- 'secret'
- 'downwardAPI'
- 'hostPath'
- 'flexVolume'
hostPID: true
hostNetwork: true
hostIPC: true
# The following section is only needed when hostNetwork: true
hostPorts:
# Ceph msgr2 port
- min: 3300
max: 3300
# Ceph msgr1 ports
- min: 6789
max: 7300
# Ceph MGR Prometheus Metrics
- min: 9283
max: 9283