Linkerd and Pod Security Policies (PSP)

    To view the definition of the control plane’s Pod Security Policy, run:

    Adjust the value of the above label to match your control plane’s namespace.

    More information on the iptables rules used by the proxy-init init container can be found on the Architecture page.

    If your environment disallows the operation of containers with escalated Linux capabilities, Linkerd can be installed with its , which doesn’t require the NET_ADMIN and NET_RAW capabilities.

    For example, the following Pod Security Policy and RBAC will work with the injected emojivoto demo application:

    1. apiVersion: policy/v1beta1
    2. kind: PodSecurityPolicy
    3. metadata:
    4. name: linkerd-emojivoto-data-plane
    5. spec:
    6. allowPrivilegeEscalation: false
    7. fsGroup:
    8. ranges:
    9. - max: 65535
    10. min: 10001
    11. rule: MustRunAs
    12. readOnlyRootFilesystem: true
    13. allowedCapabilities:
    14. - NET_ADMIN
    15. - NET_RAW
    16. requiredDropCapabilities:
    17. - ALL
    18. runAsUser:
    19. rule: RunAsAny
    20. seLinux:
    21. rule: RunAsAny
    22. ranges:
    23. - max: 65535
    24. min: 10001
    25. rule: MustRunAs
    26. volumes:
    27. - configMap
    28. - emptyDir
    29. - projected
    30. - secret
    31. - downwardAPI
    32. - persistentVolumeClaim
    33. ---
    34. apiVersion: rbac.authorization.k8s.io/v1
    35. kind: Role
    36. metadata:
    37. name: emojivoto-psp
    38. namespace: emojivoto
    39. rules:
    40. - apiGroups: ['policy','extensions']
    41. resources: ['podsecuritypolicies']
    42. ---
    43. apiVersion: rbac.authorization.k8s.io/v1
    44. kind: RoleBinding
    45. metadata:
    46. name: emojivoto-psp
    47. namespace: emojivoto
    48. roleRef:
    49. apiGroup: rbac.authorization.k8s.io
    50. kind: Role
    51. name: emojivoto-psp
    52. subjects:
    53. - kind: ServiceAccount
    54. name: default
    55. namespace: emojivoto
    56. - kind: ServiceAccount
    57. name: emoji
    58. namespace: emojivoto
    59. - kind: ServiceAccount
    60. name: voting
    61. namespace: emojivoto
    62. - kind: ServiceAccount
    63. namespace: emojivoto

    Note that the Linkerd proxy only requires the NET_ADMIN and NET_RAW capabilities when running without Linkerd CNI, and it’s run with UID 2102.