common.yaml 33 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252
  1. ####################################################################################################
  2. # Create the common resources that are necessary to start the operator and the ceph cluster.
  3. # These resources *must* be created before the operator.yaml and cluster.yaml or their variants.
  4. # The samples all assume that a single operator will manage a single cluster crd in the same
  5. # "rook-ceph" namespace.
  6. ####################################################################################################
  7. # Namespace where the operator and other rook resources are created
  8. apiVersion: v1
  9. kind: Namespace
  10. metadata:
  11. name: rook-ceph # namespace:cluster
  12. ---
  13. kind: ClusterRole
  14. apiVersion: rbac.authorization.k8s.io/v1
  15. metadata:
  16. name: cephfs-csi-nodeplugin
  17. rules:
  18. - apiGroups: [""]
  19. resources: ["nodes"]
  20. verbs: ["get"]
  21. ---
  22. kind: ClusterRole
  23. apiVersion: rbac.authorization.k8s.io/v1
  24. metadata:
  25. name: cephfs-external-provisioner-runner
  26. rules:
  27. - apiGroups: [""]
  28. resources: ["secrets"]
  29. verbs: ["get", "list"]
  30. - apiGroups: [""]
  31. resources: ["nodes"]
  32. verbs: ["get", "list", "watch"]
  33. - apiGroups: [""]
  34. resources: ["persistentvolumes"]
  35. verbs: ["get", "list", "watch", "create", "delete", "patch"]
  36. - apiGroups: [""]
  37. resources: ["persistentvolumeclaims"]
  38. verbs: ["get", "list", "watch", "patch", "update"]
  39. - apiGroups: ["storage.k8s.io"]
  40. resources: ["storageclasses"]
  41. verbs: ["get", "list", "watch"]
  42. - apiGroups: [""]
  43. resources: ["events"]
  44. verbs: ["list", "watch", "create", "update", "patch"]
  45. - apiGroups: ["storage.k8s.io"]
  46. resources: ["volumeattachments"]
  47. verbs: ["get", "list", "watch", "patch"]
  48. - apiGroups: ["storage.k8s.io"]
  49. resources: ["volumeattachments/status"]
  50. verbs: ["patch"]
  51. - apiGroups: [""]
  52. resources: ["persistentvolumeclaims/status"]
  53. verbs: ["patch"]
  54. - apiGroups: ["snapshot.storage.k8s.io"]
  55. resources: ["volumesnapshots"]
  56. verbs: ["get", "list"]
  57. - apiGroups: ["snapshot.storage.k8s.io"]
  58. resources: ["volumesnapshotclasses"]
  59. verbs: ["get", "list", "watch"]
  60. - apiGroups: ["snapshot.storage.k8s.io"]
  61. resources: ["volumesnapshotcontents"]
  62. verbs: ["get", "list", "watch", "patch", "update"]
  63. - apiGroups: ["snapshot.storage.k8s.io"]
  64. resources: ["volumesnapshotcontents/status"]
  65. verbs: ["update", "patch"]
  66. ---
  67. kind: ClusterRole
  68. apiVersion: rbac.authorization.k8s.io/v1
  69. metadata:
  70. name: objectstorage-provisioner-role
  71. labels:
  72. app.kubernetes.io/part-of: container-object-storage-interface
  73. app.kubernetes.io/component: driver-ceph
  74. app.kubernetes.io/name: cosi-driver-ceph
  75. rules:
  76. - apiGroups: ["objectstorage.k8s.io"]
  77. resources: ["buckets", "bucketaccesses", "bucketclaims", "bucketaccessclasses", "buckets/status", "bucketaccesses/status", "bucketclaims/status", "bucketaccessclasses/status"]
  78. verbs: ["get", "list", "watch", "update", "create", "delete"]
  79. - apiGroups: ["coordination.k8s.io"]
  80. resources: ["leases"]
  81. verbs: ["get", "watch", "list", "delete", "update", "create"]
  82. - apiGroups: [""]
  83. resources: ["secrets", "events"]
  84. verbs: ["get", "delete", "update", "create"]
  85. ---
  86. kind: ClusterRole
  87. apiVersion: rbac.authorization.k8s.io/v1
  88. metadata:
  89. name: rbd-csi-nodeplugin
  90. labels:
  91. operator: rook
  92. storage-backend: ceph
  93. app.kubernetes.io/part-of: rook-ceph-operator
  94. rules:
  95. - apiGroups: [""]
  96. resources: ["secrets"]
  97. verbs: ["get", "list"]
  98. - apiGroups: [""]
  99. resources: ["persistentvolumes"]
  100. verbs: ["get", "list"]
  101. - apiGroups: ["storage.k8s.io"]
  102. resources: ["volumeattachments"]
  103. verbs: ["get", "list"]
  104. - apiGroups: [""]
  105. resources: ["configmaps"]
  106. verbs: ["get"]
  107. - apiGroups: [""]
  108. resources: ["serviceaccounts"]
  109. verbs: ["get"]
  110. - apiGroups: [""]
  111. resources: ["serviceaccounts/token"]
  112. verbs: ["create"]
  113. - apiGroups: [""]
  114. resources: ["nodes"]
  115. verbs: ["get"]
  116. ---
  117. kind: ClusterRole
  118. apiVersion: rbac.authorization.k8s.io/v1
  119. metadata:
  120. name: rbd-external-provisioner-runner
  121. rules:
  122. - apiGroups: [""]
  123. resources: ["secrets"]
  124. verbs: ["get", "list", "watch"]
  125. - apiGroups: [""]
  126. resources: ["persistentvolumes"]
  127. verbs: ["get", "list", "watch", "create", "delete", "patch"]
  128. - apiGroups: [""]
  129. resources: ["persistentvolumeclaims"]
  130. verbs: ["get", "list", "watch", "update"]
  131. - apiGroups: ["storage.k8s.io"]
  132. resources: ["storageclasses"]
  133. verbs: ["get", "list", "watch"]
  134. - apiGroups: [""]
  135. resources: ["events"]
  136. verbs: ["list", "watch", "create", "update", "patch"]
  137. - apiGroups: ["storage.k8s.io"]
  138. resources: ["volumeattachments"]
  139. verbs: ["get", "list", "watch", "patch"]
  140. - apiGroups: ["storage.k8s.io"]
  141. resources: ["volumeattachments/status"]
  142. verbs: ["patch"]
  143. - apiGroups: [""]
  144. resources: ["nodes"]
  145. verbs: ["get", "list", "watch"]
  146. - apiGroups: ["storage.k8s.io"]
  147. resources: ["csinodes"]
  148. verbs: ["get", "list", "watch"]
  149. - apiGroups: [""]
  150. resources: ["persistentvolumeclaims/status"]
  151. verbs: ["patch"]
  152. - apiGroups: ["snapshot.storage.k8s.io"]
  153. resources: ["volumesnapshots"]
  154. verbs: ["get", "list", "watch"]
  155. - apiGroups: ["snapshot.storage.k8s.io"]
  156. resources: ["volumesnapshotclasses"]
  157. verbs: ["get", "list", "watch"]
  158. - apiGroups: ["snapshot.storage.k8s.io"]
  159. resources: ["volumesnapshotcontents"]
  160. verbs: ["get", "list", "watch", "patch", "update"]
  161. - apiGroups: ["snapshot.storage.k8s.io"]
  162. resources: ["volumesnapshotcontents/status"]
  163. verbs: ["update", "patch"]
  164. - apiGroups: [""]
  165. resources: ["configmaps"]
  166. verbs: ["get"]
  167. - apiGroups: [""]
  168. resources: ["serviceaccounts"]
  169. verbs: ["get"]
  170. - apiGroups: [""]
  171. resources: ["serviceaccounts/token"]
  172. verbs: ["create"]
  173. - apiGroups: [""]
  174. resources: ["nodes"]
  175. verbs: ["get", "list", "watch"]
  176. - apiGroups: ["storage.k8s.io"]
  177. resources: ["csinodes"]
  178. verbs: ["get", "list", "watch"]
  179. ---
  180. # The cluster role for managing all the cluster-specific resources in a namespace
  181. apiVersion: rbac.authorization.k8s.io/v1
  182. kind: ClusterRole
  183. metadata:
  184. name: rook-ceph-cluster-mgmt
  185. labels:
  186. operator: rook
  187. storage-backend: ceph
  188. app.kubernetes.io/part-of: rook-ceph-operator
  189. rules:
  190. - apiGroups:
  191. - ""
  192. - apps
  193. - extensions
  194. resources:
  195. - secrets
  196. - pods
  197. - pods/log
  198. - services
  199. - configmaps
  200. - deployments
  201. - daemonsets
  202. verbs:
  203. - get
  204. - list
  205. - watch
  206. - patch
  207. - create
  208. - update
  209. - delete
  210. ---
  211. # The cluster role for managing the Rook CRDs
  212. apiVersion: rbac.authorization.k8s.io/v1
  213. # Rook watches for its CRDs in all namespaces, so this should be a cluster-scoped role unless the
  214. # operator config `ROOK_CURRENT_NAMESPACE_ONLY=true`.
  215. kind: ClusterRole
  216. metadata:
  217. name: rook-ceph-global
  218. labels:
  219. operator: rook
  220. storage-backend: ceph
  221. app.kubernetes.io/part-of: rook-ceph-operator
  222. rules:
  223. - apiGroups:
  224. - ""
  225. resources:
  226. # Pod access is needed for fencing
  227. - pods
  228. # Node access is needed for determining nodes where mons should run
  229. - nodes
  230. - nodes/proxy
  231. # Rook watches secrets which it uses to configure access to external resources.
  232. # e.g., external Ceph cluster or object store
  233. - secrets
  234. # Rook watches for changes to the rook-operator-config configmap
  235. - configmaps
  236. verbs:
  237. - get
  238. - list
  239. - watch
  240. - apiGroups:
  241. - ""
  242. resources:
  243. # Rook creates events for its custom resources
  244. - events
  245. # Rook creates PVs and PVCs for OSDs managed by the Rook provisioner
  246. - persistentvolumes
  247. - persistentvolumeclaims
  248. # Rook creates endpoints for mgr and object store access
  249. - endpoints
  250. - services
  251. verbs:
  252. - get
  253. - list
  254. - watch
  255. - patch
  256. - create
  257. - update
  258. - delete
  259. - apiGroups:
  260. - storage.k8s.io
  261. resources:
  262. - storageclasses
  263. verbs:
  264. - get
  265. - list
  266. - watch
  267. - apiGroups:
  268. - batch
  269. resources:
  270. - jobs
  271. - cronjobs
  272. verbs:
  273. - get
  274. - list
  275. - watch
  276. - create
  277. - update
  278. - delete
  279. - deletecollection
  280. # The Rook operator must be able to watch all ceph.rook.io resources to reconcile them.
  281. - apiGroups: ["ceph.rook.io"]
  282. resources:
  283. - cephclients
  284. - cephclusters
  285. - cephblockpools
  286. - cephfilesystems
  287. - cephnfses
  288. - cephobjectstores
  289. - cephobjectstoreusers
  290. - cephobjectrealms
  291. - cephobjectzonegroups
  292. - cephobjectzones
  293. - cephbuckettopics
  294. - cephbucketnotifications
  295. - cephrbdmirrors
  296. - cephfilesystemmirrors
  297. - cephfilesystemsubvolumegroups
  298. - cephblockpoolradosnamespaces
  299. - cephcosidrivers
  300. verbs:
  301. - get
  302. - list
  303. - watch
  304. # Ideally the update permission is not required, but Rook needs it to add finalizers to resources.
  305. - update
  306. # Rook must have update access to status subresources for its custom resources.
  307. - apiGroups: ["ceph.rook.io"]
  308. resources:
  309. - cephclients/status
  310. - cephclusters/status
  311. - cephblockpools/status
  312. - cephfilesystems/status
  313. - cephnfses/status
  314. - cephobjectstores/status
  315. - cephobjectstoreusers/status
  316. - cephobjectrealms/status
  317. - cephobjectzonegroups/status
  318. - cephobjectzones/status
  319. - cephbuckettopics/status
  320. - cephbucketnotifications/status
  321. - cephrbdmirrors/status
  322. - cephfilesystemmirrors/status
  323. - cephfilesystemsubvolumegroups/status
  324. - cephblockpoolradosnamespaces/status
  325. verbs: ["update"]
  326. # The "*/finalizers" permission may need to be strictly given for K8s clusters where
  327. # OwnerReferencesPermissionEnforcement is enabled so that Rook can set blockOwnerDeletion on
  328. # resources owned by Rook CRs (e.g., a Secret owned by an OSD Deployment). See more:
  329. # https://kubernetes.io/docs/reference/access-authn-authz/_print/#ownerreferencespermissionenforcement
  330. - apiGroups: ["ceph.rook.io"]
  331. resources:
  332. - cephclients/finalizers
  333. - cephclusters/finalizers
  334. - cephblockpools/finalizers
  335. - cephfilesystems/finalizers
  336. - cephnfses/finalizers
  337. - cephobjectstores/finalizers
  338. - cephobjectstoreusers/finalizers
  339. - cephobjectrealms/finalizers
  340. - cephobjectzonegroups/finalizers
  341. - cephobjectzones/finalizers
  342. - cephbuckettopics/finalizers
  343. - cephbucketnotifications/finalizers
  344. - cephrbdmirrors/finalizers
  345. - cephfilesystemmirrors/finalizers
  346. - cephfilesystemsubvolumegroups/finalizers
  347. - cephblockpoolradosnamespaces/finalizers
  348. verbs: ["update"]
  349. - apiGroups:
  350. - policy
  351. - apps
  352. - extensions
  353. resources:
  354. # This is for the clusterdisruption controller
  355. - poddisruptionbudgets
  356. # This is for both clusterdisruption and nodedrain controllers
  357. - deployments
  358. - replicasets
  359. verbs:
  360. - get
  361. - list
  362. - watch
  363. - create
  364. - update
  365. - delete
  366. - deletecollection
  367. - apiGroups:
  368. - apps
  369. resources:
  370. # This is to add osd deployment owner ref on key rotation
  371. # cron jobs.
  372. - deployments/finalizers
  373. verbs:
  374. - update
  375. - apiGroups:
  376. - healthchecking.openshift.io
  377. resources:
  378. - machinedisruptionbudgets
  379. verbs:
  380. - get
  381. - list
  382. - watch
  383. - create
  384. - update
  385. - delete
  386. - apiGroups:
  387. - machine.openshift.io
  388. resources:
  389. - machines
  390. verbs:
  391. - get
  392. - list
  393. - watch
  394. - create
  395. - update
  396. - delete
  397. - apiGroups:
  398. - storage.k8s.io
  399. resources:
  400. - csidrivers
  401. verbs:
  402. - create
  403. - delete
  404. - get
  405. - update
  406. - apiGroups:
  407. - k8s.cni.cncf.io
  408. resources:
  409. - network-attachment-definitions
  410. verbs:
  411. - get
  412. ---
  413. # Aspects of ceph-mgr that require cluster-wide access
  414. kind: ClusterRole
  415. apiVersion: rbac.authorization.k8s.io/v1
  416. metadata:
  417. name: rook-ceph-mgr-cluster
  418. labels:
  419. operator: rook
  420. storage-backend: ceph
  421. app.kubernetes.io/part-of: rook-ceph-operator
  422. rules:
  423. - apiGroups:
  424. - ""
  425. resources:
  426. - configmaps
  427. - nodes
  428. - nodes/proxy
  429. - persistentvolumes
  430. verbs:
  431. - get
  432. - list
  433. - watch
  434. - apiGroups:
  435. - ""
  436. resources:
  437. - events
  438. verbs:
  439. - create
  440. - patch
  441. - list
  442. - get
  443. - watch
  444. - apiGroups:
  445. - storage.k8s.io
  446. resources:
  447. - storageclasses
  448. verbs:
  449. - get
  450. - list
  451. - watch
  452. ---
  453. # Aspects of ceph-mgr that require access to the system namespace
  454. kind: ClusterRole
  455. apiVersion: rbac.authorization.k8s.io/v1
  456. metadata:
  457. name: rook-ceph-mgr-system
  458. rules:
  459. - apiGroups:
  460. - ""
  461. resources:
  462. - configmaps
  463. verbs:
  464. - get
  465. - list
  466. - watch
  467. ---
  468. # Used for provisioning ObjectBuckets (OBs) in response to ObjectBucketClaims (OBCs).
  469. # Note: Rook runs a copy of the lib-bucket-provisioner's OBC controller.
  470. # OBCs can be created in any Kubernetes namespace, so this must be a cluster-scoped role.
  471. kind: ClusterRole
  472. apiVersion: rbac.authorization.k8s.io/v1
  473. metadata:
  474. name: rook-ceph-object-bucket
  475. labels:
  476. operator: rook
  477. storage-backend: ceph
  478. app.kubernetes.io/part-of: rook-ceph-operator
  479. rules:
  480. - apiGroups: [""]
  481. resources: ["secrets", "configmaps"]
  482. verbs:
  483. # OBC controller creates secrets and configmaps containing information for users about how to
  484. # connect to object buckets. It deletes them when an OBC is deleted.
  485. - get
  486. - create
  487. - update
  488. - delete
  489. - apiGroups: ["storage.k8s.io"]
  490. resources: ["storageclasses"]
  491. verbs:
  492. # OBC controller gets parameters from the OBC's storageclass
  493. # Rook gets additional parameters from the OBC's storageclass
  494. - get
  495. - apiGroups: ["objectbucket.io"]
  496. resources: ["objectbucketclaims"]
  497. verbs:
  498. # OBC controller needs to list/watch OBCs and get latest version of a reconciled OBC
  499. - list
  500. - watch
  501. - get
  502. # Ideally, update should not be needed, but the OBC controller updates the OBC with bucket
  503. # information outside of the status subresource
  504. - update
  505. # OBC controller does not delete OBCs; users do this
  506. - apiGroups: ["objectbucket.io"]
  507. resources: ["objectbuckets"]
  508. verbs:
  509. # OBC controller needs to list/watch OBs and get latest version of a reconciled OB
  510. - list
  511. - watch
  512. - get
  513. # OBC controller creates an OB when an OBC's bucket has been provisioned by Ceph, updates them
  514. # when an OBC is updated, and deletes them when the OBC is de-provisioned.
  515. - create
  516. - update
  517. - delete
  518. - apiGroups: ["objectbucket.io"]
  519. resources: ["objectbucketclaims/status", "objectbuckets/status"]
  520. verbs:
  521. # OBC controller updates OBC and OB statuses
  522. - update
  523. - apiGroups: ["objectbucket.io"]
  524. # This does not strictly allow the OBC/OB controllers to update finalizers. That is handled by
  525. # the direct "update" permissions above. Instead, this allows Rook's controller to create
  526. # resources which are owned by OBs/OBCs and where blockOwnerDeletion is set.
  527. resources: ["objectbucketclaims/finalizers", "objectbuckets/finalizers"]
  528. verbs:
  529. - update
  530. ---
  531. kind: ClusterRole
  532. apiVersion: rbac.authorization.k8s.io/v1
  533. metadata:
  534. name: rook-ceph-osd
  535. rules:
  536. - apiGroups:
  537. - ""
  538. resources:
  539. - nodes
  540. verbs:
  541. - get
  542. - list
  543. ---
  544. kind: ClusterRole
  545. apiVersion: rbac.authorization.k8s.io/v1
  546. metadata:
  547. name: rook-ceph-system
  548. labels:
  549. operator: rook
  550. storage-backend: ceph
  551. app.kubernetes.io/part-of: rook-ceph-operator
  552. rules:
  553. # Most resources are represented by a string representation of their name, such as "pods", just as it appears in the URL for the relevant API endpoint.
  554. # However, some Kubernetes APIs involve a "subresource", such as the logs for a pod. [...]
  555. # To represent this in an RBAC role, use a slash to delimit the resource and subresource.
  556. # https://kubernetes.io/docs/reference/access-authn-authz/rbac/#referring-to-resources
  557. - apiGroups: [""]
  558. resources: ["pods", "pods/log"]
  559. verbs: ["get", "list"]
  560. - apiGroups: [""]
  561. resources: ["pods/exec"]
  562. verbs: ["create"]
  563. - apiGroups: ["csiaddons.openshift.io"]
  564. resources: ["networkfences"]
  565. verbs: ["create", "get", "update", "delete", "watch", "list"]
  566. - apiGroups: ["apiextensions.k8s.io"]
  567. resources: ["customresourcedefinitions"]
  568. verbs: ["get"]
  569. ---
  570. # This is required by operator-sdk to map the cluster/clusterrolebindings with SA
  571. # otherwise operator-sdk will create a individual file for these.
  572. kind: ClusterRoleBinding
  573. apiVersion: rbac.authorization.k8s.io/v1
  574. metadata:
  575. name: cephfs-csi-nodeplugin-role
  576. subjects:
  577. - kind: ServiceAccount
  578. name: rook-csi-cephfs-plugin-sa
  579. namespace: rook-ceph # namespace:operator
  580. roleRef:
  581. kind: ClusterRole
  582. name: cephfs-csi-nodeplugin
  583. apiGroup: rbac.authorization.k8s.io
  584. ---
  585. kind: ClusterRoleBinding
  586. apiVersion: rbac.authorization.k8s.io/v1
  587. metadata:
  588. name: cephfs-csi-provisioner-role
  589. subjects:
  590. - kind: ServiceAccount
  591. name: rook-csi-cephfs-provisioner-sa
  592. namespace: rook-ceph # namespace:operator
  593. roleRef:
  594. kind: ClusterRole
  595. name: cephfs-external-provisioner-runner
  596. apiGroup: rbac.authorization.k8s.io
  597. ---
  598. # RBAC for ceph cosi driver service account
  599. kind: ClusterRoleBinding
  600. apiVersion: rbac.authorization.k8s.io/v1
  601. metadata:
  602. name: objectstorage-provisioner-role-binding
  603. labels:
  604. app.kubernetes.io/part-of: container-object-storage-interface
  605. app.kubernetes.io/component: driver-ceph
  606. app.kubernetes.io/name: cosi-driver-ceph
  607. subjects:
  608. - kind: ServiceAccount
  609. name: objectstorage-provisioner
  610. namespace: rook-ceph # namespace:operator
  611. roleRef:
  612. kind: ClusterRole
  613. name: objectstorage-provisioner-role
  614. apiGroup: rbac.authorization.k8s.io
  615. ---
  616. kind: ClusterRoleBinding
  617. apiVersion: rbac.authorization.k8s.io/v1
  618. metadata:
  619. name: rbd-csi-nodeplugin
  620. subjects:
  621. - kind: ServiceAccount
  622. name: rook-csi-rbd-plugin-sa
  623. namespace: rook-ceph # namespace:operator
  624. roleRef:
  625. kind: ClusterRole
  626. name: rbd-csi-nodeplugin
  627. apiGroup: rbac.authorization.k8s.io
  628. ---
  629. kind: ClusterRoleBinding
  630. apiVersion: rbac.authorization.k8s.io/v1
  631. metadata:
  632. name: rbd-csi-provisioner-role
  633. subjects:
  634. - kind: ServiceAccount
  635. name: rook-csi-rbd-provisioner-sa
  636. namespace: rook-ceph # namespace:operator
  637. roleRef:
  638. kind: ClusterRole
  639. name: rbd-external-provisioner-runner
  640. apiGroup: rbac.authorization.k8s.io
  641. ---
  642. # Grant the rook system daemons cluster-wide access to manage the Rook CRDs, PVCs, and storage classes
  643. kind: ClusterRoleBinding
  644. apiVersion: rbac.authorization.k8s.io/v1
  645. metadata:
  646. name: rook-ceph-global
  647. labels:
  648. operator: rook
  649. storage-backend: ceph
  650. app.kubernetes.io/part-of: rook-ceph-operator
  651. roleRef:
  652. apiGroup: rbac.authorization.k8s.io
  653. kind: ClusterRole
  654. name: rook-ceph-global
  655. subjects:
  656. - kind: ServiceAccount
  657. name: rook-ceph-system
  658. namespace: rook-ceph # namespace:operator
  659. ---
  660. # Allow the ceph mgr to access cluster-wide resources necessary for the mgr modules
  661. kind: ClusterRoleBinding
  662. apiVersion: rbac.authorization.k8s.io/v1
  663. metadata:
  664. name: rook-ceph-mgr-cluster
  665. roleRef:
  666. apiGroup: rbac.authorization.k8s.io
  667. kind: ClusterRole
  668. name: rook-ceph-mgr-cluster
  669. subjects:
  670. - kind: ServiceAccount
  671. name: rook-ceph-mgr
  672. namespace: rook-ceph # namespace:cluster
  673. ---
  674. kind: ClusterRoleBinding
  675. # Give Rook-Ceph Operator permissions to provision ObjectBuckets in response to ObjectBucketClaims.
  676. apiVersion: rbac.authorization.k8s.io/v1
  677. metadata:
  678. name: rook-ceph-object-bucket
  679. roleRef:
  680. apiGroup: rbac.authorization.k8s.io
  681. kind: ClusterRole
  682. name: rook-ceph-object-bucket
  683. subjects:
  684. - kind: ServiceAccount
  685. name: rook-ceph-system
  686. namespace: rook-ceph # namespace:operator
  687. ---
  688. # Allow the ceph osd to access cluster-wide resources necessary for determining their topology location
  689. kind: ClusterRoleBinding
  690. apiVersion: rbac.authorization.k8s.io/v1
  691. metadata:
  692. name: rook-ceph-osd
  693. roleRef:
  694. apiGroup: rbac.authorization.k8s.io
  695. kind: ClusterRole
  696. name: rook-ceph-osd
  697. subjects:
  698. - kind: ServiceAccount
  699. name: rook-ceph-osd
  700. namespace: rook-ceph # namespace:cluster
  701. ---
  702. kind: ClusterRoleBinding
  703. apiVersion: rbac.authorization.k8s.io/v1
  704. metadata:
  705. name: rook-ceph-system
  706. labels:
  707. operator: rook
  708. storage-backend: ceph
  709. app.kubernetes.io/part-of: rook-ceph-operator
  710. roleRef:
  711. apiGroup: rbac.authorization.k8s.io
  712. kind: ClusterRole
  713. name: rook-ceph-system
  714. subjects:
  715. - kind: ServiceAccount
  716. name: rook-ceph-system
  717. namespace: rook-ceph # namespace:operator
  718. ---
  719. kind: Role
  720. apiVersion: rbac.authorization.k8s.io/v1
  721. metadata:
  722. name: cephfs-external-provisioner-cfg
  723. namespace: rook-ceph # namespace:operator
  724. rules:
  725. - apiGroups: ["coordination.k8s.io"]
  726. resources: ["leases"]
  727. verbs: ["get", "watch", "list", "delete", "update", "create"]
  728. - apiGroups: ["csiaddons.openshift.io"]
  729. resources: ["csiaddonsnodes"]
  730. verbs: ["create"]
  731. ---
  732. kind: Role
  733. apiVersion: rbac.authorization.k8s.io/v1
  734. metadata:
  735. name: rbd-csi-nodeplugin
  736. namespace: rook-ceph # namespace:operator
  737. rules:
  738. - apiGroups: ["csiaddons.openshift.io"]
  739. resources: ["csiaddonsnodes"]
  740. verbs: ["create"]
  741. ---
  742. kind: Role
  743. apiVersion: rbac.authorization.k8s.io/v1
  744. metadata:
  745. name: rbd-external-provisioner-cfg
  746. namespace: rook-ceph # namespace:operator
  747. rules:
  748. - apiGroups: ["coordination.k8s.io"]
  749. resources: ["leases"]
  750. verbs: ["get", "watch", "list", "delete", "update", "create"]
  751. - apiGroups: ["csiaddons.openshift.io"]
  752. resources: ["csiaddonsnodes"]
  753. verbs: ["create"]
  754. ---
  755. kind: Role
  756. apiVersion: rbac.authorization.k8s.io/v1
  757. metadata:
  758. name: rook-ceph-cmd-reporter
  759. namespace: rook-ceph # namespace:cluster
  760. rules:
  761. - apiGroups:
  762. - ""
  763. resources:
  764. - pods
  765. - configmaps
  766. verbs:
  767. - get
  768. - list
  769. - watch
  770. - create
  771. - update
  772. - delete
  773. ---
  774. # Aspects of ceph-mgr that operate within the cluster's namespace
  775. kind: Role
  776. apiVersion: rbac.authorization.k8s.io/v1
  777. metadata:
  778. name: rook-ceph-mgr
  779. namespace: rook-ceph # namespace:cluster
  780. rules:
  781. - apiGroups:
  782. - ""
  783. resources:
  784. - pods
  785. - services
  786. - pods/log
  787. verbs:
  788. - get
  789. - list
  790. - watch
  791. - create
  792. - update
  793. - delete
  794. - apiGroups:
  795. - batch
  796. resources:
  797. - jobs
  798. verbs:
  799. - get
  800. - list
  801. - watch
  802. - create
  803. - update
  804. - delete
  805. - apiGroups:
  806. - ceph.rook.io
  807. resources:
  808. - cephclients
  809. - cephclusters
  810. - cephblockpools
  811. - cephfilesystems
  812. - cephnfses
  813. - cephobjectstores
  814. - cephobjectstoreusers
  815. - cephobjectrealms
  816. - cephobjectzonegroups
  817. - cephobjectzones
  818. - cephbuckettopics
  819. - cephbucketnotifications
  820. - cephrbdmirrors
  821. - cephfilesystemmirrors
  822. - cephfilesystemsubvolumegroups
  823. - cephblockpoolradosnamespaces
  824. - cephcosidrivers
  825. verbs:
  826. - get
  827. - list
  828. - watch
  829. - create
  830. - update
  831. - delete
  832. - patch
  833. - apiGroups:
  834. - apps
  835. resources:
  836. - deployments/scale
  837. - deployments
  838. verbs:
  839. - patch
  840. - delete
  841. - apiGroups:
  842. - ''
  843. resources:
  844. - persistentvolumeclaims
  845. verbs:
  846. - delete
  847. ---
  848. kind: Role
  849. apiVersion: rbac.authorization.k8s.io/v1
  850. metadata:
  851. name: rook-ceph-osd
  852. namespace: rook-ceph # namespace:cluster
  853. rules:
  854. # this is needed for rook's "key-management" CLI to fetch the vault token from the secret when
  855. # validating the connection details and for key rotation operations.
  856. - apiGroups: [""]
  857. resources: ["secrets"]
  858. verbs: ["get", "update"]
  859. - apiGroups: [""]
  860. resources: ["configmaps"]
  861. verbs: ["get", "list", "watch", "create", "update", "delete"]
  862. - apiGroups: ["ceph.rook.io"]
  863. resources: ["cephclusters", "cephclusters/finalizers"]
  864. verbs: ["get", "list", "create", "update", "delete"]
  865. ---
  866. # Aspects of ceph osd purge job that require access to the cluster namespace
  867. kind: Role
  868. apiVersion: rbac.authorization.k8s.io/v1
  869. metadata:
  870. name: rook-ceph-purge-osd
  871. namespace: rook-ceph # namespace:cluster
  872. rules:
  873. - apiGroups: [""]
  874. resources: ["configmaps"]
  875. verbs: ["get"]
  876. - apiGroups: ["apps"]
  877. resources: ["deployments"]
  878. verbs: ["get", "delete"]
  879. - apiGroups: ["batch"]
  880. resources: ["jobs"]
  881. verbs: ["get", "list", "delete"]
  882. - apiGroups: [""]
  883. resources: ["persistentvolumeclaims"]
  884. verbs: ["get", "update", "delete", "list"]
  885. ---
  886. kind: Role
  887. apiVersion: rbac.authorization.k8s.io/v1
  888. metadata:
  889. name: rook-ceph-rgw
  890. namespace: rook-ceph # namespace:cluster
  891. rules:
  892. # Placeholder role so the rgw service account will
  893. # be generated in the csv. Remove this role and role binding
  894. # when fixing https://github.com/rook/rook/issues/10141.
  895. - apiGroups:
  896. - ""
  897. resources:
  898. - configmaps
  899. verbs:
  900. - get
  901. ---
  902. # Allow the operator to manage resources in its own namespace
  903. apiVersion: rbac.authorization.k8s.io/v1
  904. kind: Role
  905. metadata:
  906. name: rook-ceph-system
  907. namespace: rook-ceph # namespace:operator
  908. labels:
  909. operator: rook
  910. storage-backend: ceph
  911. app.kubernetes.io/part-of: rook-ceph-operator
  912. rules:
  913. - apiGroups:
  914. - ""
  915. resources:
  916. - pods
  917. - configmaps
  918. - services
  919. verbs:
  920. - get
  921. - list
  922. - watch
  923. - patch
  924. - create
  925. - update
  926. - delete
  927. - apiGroups:
  928. - apps
  929. - extensions
  930. resources:
  931. - daemonsets
  932. - statefulsets
  933. - deployments
  934. verbs:
  935. - get
  936. - list
  937. - watch
  938. - create
  939. - update
  940. - delete
  941. - deletecollection
  942. - apiGroups:
  943. - batch
  944. resources:
  945. - cronjobs
  946. verbs:
  947. - delete
  948. - apiGroups:
  949. - cert-manager.io
  950. resources:
  951. - certificates
  952. - issuers
  953. verbs:
  954. - get
  955. - create
  956. - delete
  957. - apiGroups:
  958. - multicluster.x-k8s.io
  959. resources:
  960. - serviceexports
  961. verbs:
  962. - get
  963. - create
  964. ---
  965. kind: RoleBinding
  966. apiVersion: rbac.authorization.k8s.io/v1
  967. metadata:
  968. name: cephfs-csi-provisioner-role-cfg
  969. namespace: rook-ceph # namespace:operator
  970. subjects:
  971. - kind: ServiceAccount
  972. name: rook-csi-cephfs-provisioner-sa
  973. namespace: rook-ceph # namespace:operator
  974. roleRef:
  975. kind: Role
  976. name: cephfs-external-provisioner-cfg
  977. apiGroup: rbac.authorization.k8s.io
  978. ---
  979. kind: RoleBinding
  980. apiVersion: rbac.authorization.k8s.io/v1
  981. metadata:
  982. name: rbd-csi-nodeplugin-role-cfg
  983. namespace: rook-ceph # namespace:operator
  984. subjects:
  985. - kind: ServiceAccount
  986. name: rook-csi-rbd-plugin-sa
  987. namespace: rook-ceph # namespace:operator
  988. roleRef:
  989. kind: Role
  990. name: rbd-csi-nodeplugin
  991. apiGroup: rbac.authorization.k8s.io
  992. ---
  993. kind: RoleBinding
  994. apiVersion: rbac.authorization.k8s.io/v1
  995. metadata:
  996. name: rbd-csi-provisioner-role-cfg
  997. namespace: rook-ceph # namespace:operator
  998. subjects:
  999. - kind: ServiceAccount
  1000. name: rook-csi-rbd-provisioner-sa
  1001. namespace: rook-ceph # namespace:operator
  1002. roleRef:
  1003. kind: Role
  1004. name: rbd-external-provisioner-cfg
  1005. apiGroup: rbac.authorization.k8s.io
  1006. ---
  1007. # Allow the operator to create resources in this cluster's namespace
  1008. kind: RoleBinding
  1009. apiVersion: rbac.authorization.k8s.io/v1
  1010. metadata:
  1011. name: rook-ceph-cluster-mgmt
  1012. namespace: rook-ceph # namespace:cluster
  1013. roleRef:
  1014. apiGroup: rbac.authorization.k8s.io
  1015. kind: ClusterRole
  1016. name: rook-ceph-cluster-mgmt
  1017. subjects:
  1018. - kind: ServiceAccount
  1019. name: rook-ceph-system
  1020. namespace: rook-ceph # namespace:operator
  1021. ---
  1022. kind: RoleBinding
  1023. apiVersion: rbac.authorization.k8s.io/v1
  1024. metadata:
  1025. name: rook-ceph-cmd-reporter
  1026. namespace: rook-ceph # namespace:cluster
  1027. roleRef:
  1028. apiGroup: rbac.authorization.k8s.io
  1029. kind: Role
  1030. name: rook-ceph-cmd-reporter
  1031. subjects:
  1032. - kind: ServiceAccount
  1033. name: rook-ceph-cmd-reporter
  1034. namespace: rook-ceph # namespace:cluster
  1035. ---
  1036. # Allow the ceph mgr to access resources scoped to the CephCluster namespace necessary for mgr modules
  1037. kind: RoleBinding
  1038. apiVersion: rbac.authorization.k8s.io/v1
  1039. metadata:
  1040. name: rook-ceph-mgr
  1041. namespace: rook-ceph # namespace:cluster
  1042. roleRef:
  1043. apiGroup: rbac.authorization.k8s.io
  1044. kind: Role
  1045. name: rook-ceph-mgr
  1046. subjects:
  1047. - kind: ServiceAccount
  1048. name: rook-ceph-mgr
  1049. namespace: rook-ceph # namespace:cluster
  1050. ---
  1051. # Allow the ceph mgr to access resources in the Rook operator namespace necessary for mgr modules
  1052. kind: RoleBinding
  1053. apiVersion: rbac.authorization.k8s.io/v1
  1054. metadata:
  1055. name: rook-ceph-mgr-system
  1056. namespace: rook-ceph # namespace:operator
  1057. roleRef:
  1058. apiGroup: rbac.authorization.k8s.io
  1059. kind: ClusterRole
  1060. name: rook-ceph-mgr-system
  1061. subjects:
  1062. - kind: ServiceAccount
  1063. name: rook-ceph-mgr
  1064. namespace: rook-ceph # namespace:cluster
  1065. ---
  1066. # Allow the osd pods in this namespace to work with configmaps
  1067. kind: RoleBinding
  1068. apiVersion: rbac.authorization.k8s.io/v1
  1069. metadata:
  1070. name: rook-ceph-osd
  1071. namespace: rook-ceph # namespace:cluster
  1072. roleRef:
  1073. apiGroup: rbac.authorization.k8s.io
  1074. kind: Role
  1075. name: rook-ceph-osd
  1076. subjects:
  1077. - kind: ServiceAccount
  1078. name: rook-ceph-osd
  1079. namespace: rook-ceph # namespace:cluster
  1080. ---
  1081. # Allow the osd purge job to run in this namespace
  1082. kind: RoleBinding
  1083. apiVersion: rbac.authorization.k8s.io/v1
  1084. metadata:
  1085. name: rook-ceph-purge-osd
  1086. namespace: rook-ceph # namespace:cluster
  1087. roleRef:
  1088. apiGroup: rbac.authorization.k8s.io
  1089. kind: Role
  1090. name: rook-ceph-purge-osd
  1091. subjects:
  1092. - kind: ServiceAccount
  1093. name: rook-ceph-purge-osd
  1094. namespace: rook-ceph # namespace:cluster
  1095. ---
  1096. # Allow the rgw pods in this namespace to work with configmaps
  1097. kind: RoleBinding
  1098. apiVersion: rbac.authorization.k8s.io/v1
  1099. metadata:
  1100. name: rook-ceph-rgw
  1101. namespace: rook-ceph # namespace:cluster
  1102. roleRef:
  1103. apiGroup: rbac.authorization.k8s.io
  1104. kind: Role
  1105. name: rook-ceph-rgw
  1106. subjects:
  1107. - kind: ServiceAccount
  1108. name: rook-ceph-rgw
  1109. namespace: rook-ceph # namespace:cluster
  1110. ---
  1111. # Grant the operator, agent, and discovery agents access to resources in the rook-ceph-system namespace
  1112. kind: RoleBinding
  1113. apiVersion: rbac.authorization.k8s.io/v1
  1114. metadata:
  1115. name: rook-ceph-system
  1116. namespace: rook-ceph # namespace:operator
  1117. labels:
  1118. operator: rook
  1119. storage-backend: ceph
  1120. app.kubernetes.io/part-of: rook-ceph-operator
  1121. roleRef:
  1122. apiGroup: rbac.authorization.k8s.io
  1123. kind: Role
  1124. name: rook-ceph-system
  1125. subjects:
  1126. - kind: ServiceAccount
  1127. name: rook-ceph-system
  1128. namespace: rook-ceph # namespace:operator
  1129. ---
  1130. # Service account for Ceph COSI driver
  1131. apiVersion: v1
  1132. kind: ServiceAccount
  1133. metadata:
  1134. name: objectstorage-provisioner
  1135. namespace: rook-ceph # namespace:operator
  1136. labels:
  1137. app.kubernetes.io/part-of: container-object-storage-interface
  1138. app.kubernetes.io/component: driver-ceph
  1139. app.kubernetes.io/name: cosi-driver-ceph
  1140. # imagePullSecrets:
  1141. # - name: my-registry-secret
  1142. ---
  1143. # Service account for the job that reports the Ceph version in an image
  1144. apiVersion: v1
  1145. kind: ServiceAccount
  1146. metadata:
  1147. name: rook-ceph-cmd-reporter
  1148. namespace: rook-ceph # namespace:cluster
  1149. labels:
  1150. operator: rook
  1151. storage-backend: ceph
  1152. app.kubernetes.io/part-of: rook-ceph-operator
  1153. # imagePullSecrets:
  1154. # - name: my-registry-secret
  1155. ---
  1156. # Service account for Ceph mgrs
  1157. apiVersion: v1
  1158. kind: ServiceAccount
  1159. metadata:
  1160. name: rook-ceph-mgr
  1161. namespace: rook-ceph # namespace:cluster
  1162. labels:
  1163. operator: rook
  1164. storage-backend: ceph
  1165. app.kubernetes.io/part-of: rook-ceph-operator
  1166. # imagePullSecrets:
  1167. # - name: my-registry-secret
  1168. ---
  1169. # Service account for Ceph OSDs
  1170. apiVersion: v1
  1171. kind: ServiceAccount
  1172. metadata:
  1173. name: rook-ceph-osd
  1174. namespace: rook-ceph # namespace:cluster
  1175. labels:
  1176. operator: rook
  1177. storage-backend: ceph
  1178. app.kubernetes.io/part-of: rook-ceph-operator
  1179. # imagePullSecrets:
  1180. # - name: my-registry-secret
  1181. ---
  1182. # Service account for job that purges OSDs from a Rook-Ceph cluster
  1183. apiVersion: v1
  1184. kind: ServiceAccount
  1185. metadata:
  1186. name: rook-ceph-purge-osd
  1187. namespace: rook-ceph # namespace:cluster
  1188. # imagePullSecrets:
  1189. # - name: my-registry-secret
  1190. ---
  1191. # Service account for RGW server
  1192. apiVersion: v1
  1193. kind: ServiceAccount
  1194. metadata:
  1195. name: rook-ceph-rgw
  1196. namespace: rook-ceph # namespace:cluster
  1197. labels:
  1198. operator: rook
  1199. storage-backend: ceph
  1200. app.kubernetes.io/part-of: rook-ceph-operator
  1201. # imagePullSecrets:
  1202. # - name: my-registry-secret
  1203. ---
  1204. # Service account for the Rook-Ceph operator
  1205. apiVersion: v1
  1206. kind: ServiceAccount
  1207. metadata:
  1208. name: rook-ceph-system
  1209. namespace: rook-ceph # namespace:operator
  1210. labels:
  1211. operator: rook
  1212. storage-backend: ceph
  1213. app.kubernetes.io/part-of: rook-ceph-operator
  1214. # imagePullSecrets:
  1215. # - name: my-registry-secret
  1216. ---
  1217. # Service account for the CephFS CSI driver
  1218. apiVersion: v1
  1219. kind: ServiceAccount
  1220. metadata:
  1221. name: rook-csi-cephfs-plugin-sa
  1222. namespace: rook-ceph # namespace:operator
  1223. # imagePullSecrets:
  1224. # - name: my-registry-secret
  1225. ---
  1226. # Service account for the CephFS CSI provisioner
  1227. apiVersion: v1
  1228. kind: ServiceAccount
  1229. metadata:
  1230. name: rook-csi-cephfs-provisioner-sa
  1231. namespace: rook-ceph # namespace:operator
  1232. # imagePullSecrets:
  1233. # - name: my-registry-secret
  1234. ---
  1235. # Service account for the RBD CSI driver
  1236. apiVersion: v1
  1237. kind: ServiceAccount
  1238. metadata:
  1239. name: rook-csi-rbd-plugin-sa
  1240. namespace: rook-ceph # namespace:operator
  1241. # imagePullSecrets:
  1242. # - name: my-registry-secret
  1243. ---
  1244. # Service account for the RBD CSI provisioner
  1245. apiVersion: v1
  1246. kind: ServiceAccount
  1247. metadata:
  1248. name: rook-csi-rbd-provisioner-sa
  1249. namespace: rook-ceph # namespace:operator
  1250. # imagePullSecrets:
  1251. # - name: my-registry-secret