calico-clusterrole.yaml 3.2 KB

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