Skip to content

Instantly share code, notes, and snippets.

@genadipost
Last active Oct 14, 2021
Embed
What would you like to do?
aws_psp
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: ebs-csi-controller
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
volumes:
- '*'
hostNetwork: true
hostPorts:
- min: 0
max: 65535
hostIPC: true
hostPID: true
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: false
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ebs-csi-controller-psp
namespace: kube-system
rules:
- apiGroups:
- policy
resourceNames:
- ebs-csi-controller
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ebs-csi-controller-psp
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ebs-csi-controller-psp
subjects:
- kind: ServiceAccount
name: ebs-csi-controller-sa
namespace: kube-system
---
apiVersion: policy/v1beta1
kind: PodSecurityPolicy
metadata:
name: ebs-csi-node
spec:
privileged: true
allowPrivilegeEscalation: true
allowedCapabilities:
- '*'
volumes:
- '*'
hostNetwork: true
hostPorts:
- min: 0
max: 65535
hostIPC: true
hostPID: true
runAsUser:
rule: 'RunAsAny'
seLinux:
rule: 'RunAsAny'
supplementalGroups:
rule: 'RunAsAny'
fsGroup:
rule: 'RunAsAny'
readOnlyRootFilesystem: false
---
apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
name: ebs-csi-node-psp
namespace: kube-system
rules:
- apiGroups:
- policy
resourceNames:
- ebs-csi-node
resources:
- podsecuritypolicies
verbs:
- use
---
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
name: ebs-csi-node-psp
namespace: kube-system
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: ebs-csi-node-psp
subjects:
- kind: ServiceAccount
name: ebs-csi-node-sa
namespace: kube-system
---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment