cluster-on-local-pvc.yaml 7.0 KB

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