bak_cluster.yaml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259
  1. #################################################################################################################
  2. # Define the settings for the rook-ceph cluster with common settings for a production cluster on top of bare metal.
  3. # This example expects three nodes, each with two available disks. Please modify it according to your environment.
  4. # See the documentation for more details on storage settings available.
  5. # For example, to create the cluster:
  6. # kubectl create -f crds.yaml -f common.yaml -f operator.yaml
  7. # kubectl create -f cluster-on-local-pvc.yaml
  8. #################################################################################################################
  9. kind: PersistentVolume
  10. apiVersion: v1
  11. metadata:
  12. name: ceph-local0-0
  13. spec:
  14. storageClassName: local
  15. capacity:
  16. storage: 10Gi
  17. accessModes:
  18. - ReadWriteOnce
  19. persistentVolumeReclaimPolicy: Retain
  20. # PV for mon must be a filesystem volume.
  21. volumeMode: Filesystem
  22. local:
  23. # If you want to use dm devices like logical volume, please replace `/dev/sdb` with their device names like `/dev/vg-name/lv-name`.
  24. path: /data/ceph/ceph-0
  25. nodeAffinity:
  26. required:
  27. nodeSelectorTerms:
  28. - matchExpressions:
  29. - key: kubernetes.io/hostname
  30. operator: In
  31. values:
  32. - k8smaster
  33. ---
  34. kind: PersistentVolume
  35. apiVersion: v1
  36. metadata:
  37. name: ceph-local0-1
  38. spec:
  39. storageClassName: local
  40. capacity:
  41. storage: 10Gi
  42. accessModes:
  43. - ReadWriteOnce
  44. persistentVolumeReclaimPolicy: Retain
  45. # PV for OSD must be a block volume.
  46. volumeMode: Block
  47. local:
  48. path: /data/ceph/ceph-1
  49. nodeAffinity:
  50. required:
  51. nodeSelectorTerms:
  52. - matchExpressions:
  53. - key: kubernetes.io/hostname
  54. operator: In
  55. values:
  56. - k8smaster
  57. ---
  58. kind: PersistentVolume
  59. apiVersion: v1
  60. metadata:
  61. name: ceph-local1-0
  62. spec:
  63. storageClassName: local
  64. capacity:
  65. storage: 10Gi
  66. accessModes:
  67. - ReadWriteOnce
  68. persistentVolumeReclaimPolicy: Retain
  69. volumeMode: Filesystem
  70. local:
  71. path: /data/ceph/ceph-0
  72. nodeAffinity:
  73. required:
  74. nodeSelectorTerms:
  75. - matchExpressions:
  76. - key: kubernetes.io/hostname
  77. operator: In
  78. values:
  79. - node01
  80. ---
  81. kind: PersistentVolume
  82. apiVersion: v1
  83. metadata:
  84. name: ceph-local1-1
  85. spec:
  86. storageClassName: local
  87. capacity:
  88. storage: 10Gi
  89. accessModes:
  90. - ReadWriteOnce
  91. persistentVolumeReclaimPolicy: Retain
  92. volumeMode: Block
  93. local:
  94. path: /data/ceph/ceph-1
  95. nodeAffinity:
  96. required:
  97. nodeSelectorTerms:
  98. - matchExpressions:
  99. - key: kubernetes.io/hostname
  100. operator: In
  101. values:
  102. - node01
  103. ---
  104. kind: PersistentVolume
  105. apiVersion: v1
  106. metadata:
  107. name: ceph-local2-0
  108. spec:
  109. storageClassName: local
  110. capacity:
  111. storage: 10Gi
  112. accessModes:
  113. - ReadWriteOnce
  114. persistentVolumeReclaimPolicy: Retain
  115. volumeMode: Filesystem
  116. local:
  117. path: /data/ceph/ceph-0
  118. nodeAffinity:
  119. required:
  120. nodeSelectorTerms:
  121. - matchExpressions:
  122. - key: kubernetes.io/hostname
  123. operator: In
  124. values:
  125. - node02
  126. ---
  127. kind: PersistentVolume
  128. apiVersion: v1
  129. metadata:
  130. name: ceph-local2-1
  131. spec:
  132. storageClassName: local
  133. capacity:
  134. storage: 10Gi
  135. accessModes:
  136. - ReadWriteOnce
  137. persistentVolumeReclaimPolicy: Retain
  138. volumeMode: Block
  139. local:
  140. path: /data/ceph/ceph-1
  141. nodeAffinity:
  142. required:
  143. nodeSelectorTerms:
  144. - matchExpressions:
  145. - key: kubernetes.io/hostname
  146. operator: In
  147. values:
  148. - node02
  149. ---
  150. apiVersion: ceph.rook.io/v1
  151. kind: CephCluster
  152. metadata:
  153. name: rook-ceph
  154. namespace: rook-ceph # namespace:cluster
  155. spec:
  156. dataDirHostPath: /var/lib/rook
  157. mon:
  158. count: 3
  159. allowMultiplePerNode: false
  160. volumeClaimTemplate:
  161. spec:
  162. storageClassName: local
  163. resources:
  164. requests:
  165. storage: 10Gi
  166. cephVersion:
  167. image: quay.io/ceph/ceph:v18.2.1
  168. allowUnsupported: false
  169. skipUpgradeChecks: false
  170. continueUpgradeAfterChecksEvenIfNotHealthy: false
  171. mgr:
  172. count: 1
  173. modules:
  174. - name: pg_autoscaler
  175. enabled: true
  176. dashboard:
  177. enabled: true
  178. ssl: true
  179. crashCollector:
  180. disable: false
  181. storage:
  182. storageClassDeviceSets:
  183. - name: ceph-storage
  184. count: 3
  185. portable: false
  186. tuneDeviceClass: true
  187. tuneFastDeviceClass: false
  188. encrypted: false
  189. placement:
  190. topologySpreadConstraints:
  191. - maxSkew: 1
  192. topologyKey: kubernetes.io/hostname
  193. whenUnsatisfiable: ScheduleAnyway
  194. labelSelector:
  195. matchExpressions:
  196. - key: app
  197. operator: In
  198. values:
  199. - rook-ceph-osd
  200. - rook-ceph-osd-prepare
  201. preparePlacement:
  202. podAntiAffinity:
  203. preferredDuringSchedulingIgnoredDuringExecution:
  204. - weight: 100
  205. podAffinityTerm:
  206. labelSelector:
  207. matchExpressions:
  208. - key: app
  209. operator: In
  210. values:
  211. - rook-ceph-osd
  212. - key: app
  213. operator: In
  214. values:
  215. - rook-ceph-osd-prepare
  216. topologyKey: kubernetes.io/hostname
  217. resources:
  218. # These are the OSD daemon limits. For OSD prepare limits, see the separate section below for "prepareosd" resources
  219. # limits:
  220. # cpu: "500m"
  221. # memory: "4Gi"
  222. # requests:
  223. # cpu: "500m"
  224. # memory: "4Gi"
  225. volumeClaimTemplates:
  226. - metadata:
  227. name: ceph-sys
  228. # if you are looking at giving your OSD a different CRUSH device class than the one detected by Ceph
  229. # annotations:
  230. # crushDeviceClass: hybrid
  231. spec:
  232. resources:
  233. requests:
  234. storage: 10Gi
  235. # IMPORTANT: Change the storage class depending on your environment
  236. storageClassName: local
  237. volumeMode: Block
  238. accessModes:
  239. - ReadWriteOnce
  240. # when onlyApplyOSDPlacement is false, will merge both placement.All() and storageClassDeviceSets.Placement
  241. onlyApplyOSDPlacement: false
  242. resources:
  243. # prepareosd:
  244. # limits:
  245. # cpu: "200m"
  246. # memory: "200Mi"
  247. # requests:
  248. # cpu: "200m"
  249. # memory: "200Mi"
  250. priorityClassNames:
  251. mon: system-node-critical
  252. osd: system-node-critical
  253. mgr: system-cluster-critical
  254. disruptionManagement:
  255. managePodBudgets: true
  256. osdMaintenanceTimeout: 30
  257. pgHealthCheckTimeout: 0