From cea74c6280ebf2f3989bebb5aba26bae0cabac8c Mon Sep 17 00:00:00 2001 From: Julien Garcia Gonzalez Date: Wed, 26 Sep 2018 11:19:09 +0200 Subject: [PATCH] example k8s: add support for PodSecurityPolicy This add a psp file with needed right to work on kubernetes. Signed-off-by: Julien Garcia Gonzalez --- examples/k8s/cluster-role.yaml | 8 ++++++++ examples/k8s/psp.yaml | 21 +++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 examples/k8s/psp.yaml diff --git a/examples/k8s/cluster-role.yaml b/examples/k8s/cluster-role.yaml index f51d9a7bd..323d818b5 100644 --- a/examples/k8s/cluster-role.yaml +++ b/examples/k8s/cluster-role.yaml @@ -51,3 +51,11 @@ rules: verbs: - list - watch +- apigroups: + - extensions + resourcenames: + - weave-scope + resources: + - podsecuritypolicies + verbs: + - use diff --git a/examples/k8s/psp.yaml b/examples/k8s/psp.yaml new file mode 100644 index 000000000..555a7c027 --- /dev/null +++ b/examples/k8s/psp.yaml @@ -0,0 +1,21 @@ +apiVersion: extensions/v1beta1 +kind: PodSecurityPolicy +metadata: + name: weave-scope +spec: + privileged: true + hostPID: true + hostNetwork: true + allowedCapabilities: + - 'NET_ADMIN' + fsGroup: + rule: RunAsAny + runAsUser: + rule: RunAsAny + seLinux: + rule: RunAsAny + supplementalGroups: + rule: RunAsAny + volumes: + - secret + - hostPath \ No newline at end of file