You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

143 lines
3.1 KiB

  1. ---
  2. kind: ClusterRole
  3. apiVersion: rbac.authorization.k8s.io/v1
  4. metadata:
  5. name: calico-node
  6. namespace: kube-system
  7. rules:
  8. - apiGroups: [""]
  9. resources:
  10. - pods
  11. - nodes
  12. - namespaces
  13. - configmaps
  14. verbs:
  15. - get
  16. - apiGroups: [""]
  17. resources:
  18. - endpoints
  19. - services
  20. verbs:
  21. - watch
  22. - list
  23. {% if calico_datastore == "kdd" %}
  24. # Used to discover Typhas.
  25. - get
  26. {% endif %}
  27. - apiGroups: [""]
  28. resources:
  29. - nodes/status
  30. verbs:
  31. - patch
  32. {% if calico_datastore == "etcd" %}
  33. - apiGroups:
  34. - policy
  35. resourceNames:
  36. - privileged
  37. resources:
  38. - podsecuritypolicies
  39. verbs:
  40. - use
  41. {% elif calico_datastore == "kdd" %}
  42. # Calico stores some configuration information in node annotations.
  43. - update
  44. # Watch for changes to Kubernetes NetworkPolicies.
  45. - apiGroups: ["networking.k8s.io"]
  46. resources:
  47. - networkpolicies
  48. verbs:
  49. - watch
  50. - list
  51. # Used by Calico for policy information.
  52. - apiGroups: [""]
  53. resources:
  54. - pods
  55. - namespaces
  56. - serviceaccounts
  57. verbs:
  58. - list
  59. - watch
  60. # The CNI plugin patches pods/status.
  61. - apiGroups: [""]
  62. resources:
  63. - pods/status
  64. verbs:
  65. - patch
  66. # Calico monitors various CRDs for config.
  67. - apiGroups: ["crd.projectcalico.org"]
  68. resources:
  69. - globalfelixconfigs
  70. - felixconfigurations
  71. - bgppeers
  72. - globalbgpconfigs
  73. - bgpconfigurations
  74. - ippools
  75. - ipamblocks
  76. - globalnetworkpolicies
  77. - globalnetworksets
  78. - networkpolicies
  79. - networksets
  80. - clusterinformations
  81. - hostendpoints
  82. - blockaffinities
  83. verbs:
  84. - get
  85. - list
  86. - watch
  87. # Calico must create and update some CRDs on startup.
  88. - apiGroups: ["crd.projectcalico.org"]
  89. resources:
  90. - ippools
  91. - felixconfigurations
  92. - clusterinformations
  93. verbs:
  94. - create
  95. - update
  96. # Calico stores some configuration information on the node.
  97. - apiGroups: [""]
  98. resources:
  99. - nodes
  100. verbs:
  101. - get
  102. - list
  103. - watch
  104. # These permissions are only required for upgrade from v2.6, and can
  105. # be removed after upgrade or on fresh installations.
  106. - apiGroups: ["crd.projectcalico.org"]
  107. resources:
  108. - bgpconfigurations
  109. - bgppeers
  110. verbs:
  111. - create
  112. - update
  113. # These permissions are required for Calico CNI to perform IPAM allocations.
  114. - apiGroups: ["crd.projectcalico.org"]
  115. resources:
  116. - blockaffinities
  117. - ipamblocks
  118. - ipamhandles
  119. verbs:
  120. - get
  121. - list
  122. - create
  123. - update
  124. - delete
  125. - apiGroups: ["crd.projectcalico.org"]
  126. resources:
  127. - ipamconfigs
  128. verbs:
  129. - get
  130. # Block affinities must also be watchable by confd for route aggregation.
  131. - apiGroups: ["crd.projectcalico.org"]
  132. resources:
  133. - blockaffinities
  134. verbs:
  135. - watch
  136. # The Calico IPAM migration needs to get daemonsets. These permissions can be
  137. # removed if not upgrading from an installation using host-local IPAM.
  138. - apiGroups: ["apps"]
  139. resources:
  140. - daemonsets
  141. verbs:
  142. - get
  143. {% endif %}