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.

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