From a74f8061533eaaeec1cd9d579304453d2707f07e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 18 Jun 2019 10:36:20 +0200 Subject: [PATCH] ceph: add psp.yaml example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The current doc was outdated and hardcoded, so removing the example from the doc and add a proper psp.yaml file that people can use and contribute too. Closes: https://github.com/rook/rook/issues/3309 Signed-off-by: Sébastien Han --- Documentation/ceph-psp.md | 31 +------------------ cluster/examples/kubernetes/ceph/psp.yaml | 36 +++++++++++++++++++++++ 2 files changed, 37 insertions(+), 30 deletions(-) create mode 100644 cluster/examples/kubernetes/ceph/psp.yaml diff --git a/Documentation/ceph-psp.md b/Documentation/ceph-psp.md index e42e1de74..949412e0f 100644 --- a/Documentation/ceph-psp.md +++ b/Documentation/ceph-psp.md @@ -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 diff --git a/cluster/examples/kubernetes/ceph/psp.yaml b/cluster/examples/kubernetes/ceph/psp.yaml new file mode 100644 index 000000000..2626f2069 --- /dev/null +++ b/cluster/examples/kubernetes/ceph/psp.yaml @@ -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