longhorn/examples/rwx/01-security.yaml
Sheng Yang 08e1522f6e Sync with Longhorn manager
commit 53203078833122cf1544e4145bf12ecec4e7d097
Author: Sheng Yang <sheng.yang@rancher.com>
Date:   Sun Dec 6 10:25:22 2020 -0800

    deploy: add iscsi deploy helper

    Signed-off-by: Sheng Yang <sheng.yang@rancher.com>

Signed-off-by: Sheng Yang <sheng.yang@rancher.com>
2020-12-06 11:02:15 -08:00

86 lines
2.0 KiB
YAML

apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: longhorn-nfs-provisioner
spec:
fsGroup:
rule: RunAsAny
allowedCapabilities:
- DAC_READ_SEARCH
- SYS_RESOURCE
runAsUser:
rule: RunAsAny
seLinux:
rule: RunAsAny
supplementalGroups:
rule: RunAsAny
volumes:
- configMap
- downwardAPI
- emptyDir
- persistentVolumeClaim
- secret
- hostPath
---
kind: ClusterRole
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: longhorn-nfs-provisioner
rules:
- apiGroups: [""]
resources: ["persistentvolumes"]
verbs: ["get", "list", "watch", "create", "delete"]
- apiGroups: [""]
resources: ["persistentvolumeclaims"]
verbs: ["get", "list", "watch", "update"]
- apiGroups: ["storage.k8s.io"]
resources: ["storageclasses"]
verbs: ["get", "list", "watch"]
- apiGroups: [""]
resources: ["events"]
verbs: ["create", "update", "patch"]
- apiGroups: [""]
resources: ["services", "endpoints"]
verbs: ["get"]
- apiGroups: ["extensions"]
resources: ["podsecuritypolicies"]
resourceNames: ["longhorn-nfs-provisioner"]
verbs: ["use"]
---
kind: ClusterRoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: longhorn-nfs-provisioner
subjects:
- kind: ServiceAccount
name: longhorn-nfs-provisioner
namespace: longhorn-system
roleRef:
kind: ClusterRole
name: longhorn-nfs-provisioner
apiGroup: rbac.authorization.k8s.io
---
kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-longhorn-nfs-provisioner
namespace: longhorn-system
rules:
- apiGroups: [""]
resources: ["endpoints"]
verbs: ["get", "list", "watch", "create", "update", "patch"]
---
kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: leader-locking-longhorn-nfs-provisioner
namespace: longhorn-system
subjects:
- kind: ServiceAccount
name: longhorn-nfs-provisioner
namespace: longhorn-system
roleRef:
kind: Role
name: leader-locking-longhorn-nfs-provisioner
apiGroup: rbac.authorization.k8s.io