2017-08-25 07:07:50 +00:00
|
|
|
---
|
|
|
|
apiVersion: v1
|
|
|
|
kind: ServiceAccount
|
|
|
|
metadata:
|
|
|
|
name: flannel
|
2020-04-15 06:48:02 +00:00
|
|
|
namespace: kube-system
|
|
|
|
---
|
|
|
|
apiVersion: policy/v1beta1
|
|
|
|
kind: PodSecurityPolicy
|
|
|
|
metadata:
|
|
|
|
name: psp.flannel.unprivileged
|
|
|
|
annotations:
|
2020-05-27 21:02:02 +00:00
|
|
|
seccomp.security.alpha.kubernetes.io/allowedProfileNames: runtime/default
|
|
|
|
seccomp.security.alpha.kubernetes.io/defaultProfileName: runtime/default
|
2020-04-15 06:48:02 +00:00
|
|
|
{% if podsecuritypolicy_enabled and apparmor_enabled %}
|
|
|
|
apparmor.security.beta.kubernetes.io/allowedProfileNames: runtime/default
|
|
|
|
apparmor.security.beta.kubernetes.io/defaultProfileName: runtime/default
|
|
|
|
{% endif %}
|
|
|
|
spec:
|
|
|
|
privileged: false
|
|
|
|
volumes:
|
|
|
|
- configMap
|
|
|
|
- secret
|
|
|
|
- emptyDir
|
|
|
|
- hostPath
|
|
|
|
allowedHostPaths:
|
|
|
|
- pathPrefix: "/etc/cni/net.d"
|
|
|
|
- pathPrefix: "/etc/kube-flannel"
|
|
|
|
- pathPrefix: "/run/flannel"
|
|
|
|
readOnlyRootFilesystem: false
|
|
|
|
# Users and groups
|
|
|
|
runAsUser:
|
|
|
|
rule: RunAsAny
|
|
|
|
supplementalGroups:
|
|
|
|
rule: RunAsAny
|
|
|
|
fsGroup:
|
|
|
|
rule: RunAsAny
|
|
|
|
# Privilege Escalation
|
|
|
|
allowPrivilegeEscalation: false
|
|
|
|
defaultAllowPrivilegeEscalation: false
|
|
|
|
# Capabilities
|
|
|
|
allowedCapabilities: ['NET_ADMIN']
|
|
|
|
defaultAddCapabilities: []
|
|
|
|
requiredDropCapabilities: []
|
|
|
|
# Host namespaces
|
|
|
|
hostPID: false
|
|
|
|
hostIPC: false
|
|
|
|
hostNetwork: true
|
|
|
|
hostPorts:
|
|
|
|
- min: 0
|
|
|
|
max: 65535
|
|
|
|
# SELinux
|
|
|
|
seLinux:
|
|
|
|
# SELinux is unused in CaaSP
|
|
|
|
rule: 'RunAsAny'
|
2017-08-25 07:07:50 +00:00
|
|
|
---
|
|
|
|
kind: ClusterRole
|
2020-04-14 20:14:04 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2017-08-25 07:07:50 +00:00
|
|
|
metadata:
|
|
|
|
name: flannel
|
|
|
|
rules:
|
2020-04-15 06:48:02 +00:00
|
|
|
- apiGroups: ['extensions']
|
|
|
|
resources: ['podsecuritypolicies']
|
|
|
|
verbs: ['use']
|
|
|
|
resourceNames: ['psp.flannel.unprivileged']
|
2017-08-25 07:07:50 +00:00
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- pods
|
|
|
|
verbs:
|
|
|
|
- get
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- nodes
|
|
|
|
verbs:
|
|
|
|
- list
|
|
|
|
- watch
|
|
|
|
- apiGroups:
|
|
|
|
- ""
|
|
|
|
resources:
|
|
|
|
- nodes/status
|
|
|
|
verbs:
|
|
|
|
- patch
|
|
|
|
---
|
|
|
|
kind: ClusterRoleBinding
|
2020-04-14 20:14:04 +00:00
|
|
|
apiVersion: rbac.authorization.k8s.io/v1
|
2017-08-25 07:07:50 +00:00
|
|
|
metadata:
|
|
|
|
name: flannel
|
|
|
|
roleRef:
|
|
|
|
apiGroup: rbac.authorization.k8s.io
|
|
|
|
kind: ClusterRole
|
|
|
|
name: flannel
|
|
|
|
subjects:
|
|
|
|
- kind: ServiceAccount
|
|
|
|
name: flannel
|
2020-04-15 06:48:02 +00:00
|
|
|
namespace: kube-system
|