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.

147 lines
3.3 KiB

  1. ---
  2. kind: ClusterRole
  3. apiVersion: rbac.authorization.k8s.io/v1beta1
  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. verbs:
  86. - get
  87. - list
  88. - watch
  89. # Calico must create and update some CRDs on startup.
  90. - apiGroups: ["crd.projectcalico.org"]
  91. resources:
  92. - ippools
  93. - felixconfigurations
  94. - clusterinformations
  95. verbs:
  96. - create
  97. - update
  98. # Calico stores some configuration information on the node.
  99. - apiGroups: [""]
  100. resources:
  101. - nodes
  102. verbs:
  103. - get
  104. - list
  105. - watch
  106. # These permissions are only requried for upgrade from v2.6, and can
  107. # be removed after upgrade or on fresh installations.
  108. - apiGroups: ["crd.projectcalico.org"]
  109. resources:
  110. - bgpconfigurations
  111. - bgppeers
  112. verbs:
  113. - create
  114. - update
  115. {% if calico_version is version('v3.6.0', '>=') %}
  116. # These permissions are required for Calico CNI to perform IPAM allocations.
  117. - apiGroups: ["crd.projectcalico.org"]
  118. resources:
  119. - blockaffinities
  120. - ipamblocks
  121. - ipamhandles
  122. verbs:
  123. - get
  124. - list
  125. - create
  126. - update
  127. - delete
  128. - apiGroups: ["crd.projectcalico.org"]
  129. resources:
  130. - ipamconfigs
  131. verbs:
  132. - get
  133. # Block affinities must also be watchable by confd for route aggregation.
  134. - apiGroups: ["crd.projectcalico.org"]
  135. resources:
  136. - blockaffinities
  137. verbs:
  138. - watch
  139. # The Calico IPAM migration needs to get daemonsets. These permissions can be
  140. # removed if not upgrading from an installation using host-local IPAM.
  141. - apiGroups: ["apps"]
  142. resources:
  143. - daemonsets
  144. verbs:
  145. - get
  146. {% endif %}
  147. {% endif %}