osd-purge-example.yaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. apiVersion: batch/v1
  2. kind: Job
  3. metadata:
  4. name: rook-ceph-purge-osd
  5. namespace: rook-ceph # namespace:cluster
  6. labels:
  7. app: rook-ceph-purge-osd
  8. spec:
  9. template:
  10. metadata:
  11. labels:
  12. app: rook-ceph-purge-osd
  13. spec:
  14. serviceAccountName: rook-ceph-purge-osd
  15. containers:
  16. - name: osd-removal
  17. image: rook/ceph:v1.13.10
  18. # TODO: Insert the OSD ID in the last parameter that is to be removed
  19. # The OSD IDs are a comma-separated list. For example: "0" or "0,2".
  20. # If you want to preserve the OSD PVCs, set `--preserve-pvc true`.
  21. #
  22. # A --force-osd-removal option is available if the OSD should be destroyed even though the
  23. # removal could lead to data loss.
  24. args:
  25. - "ceph"
  26. - "osd"
  27. - "remove"
  28. - "--preserve-pvc"
  29. - "false"
  30. - "--force-osd-removal"
  31. - "true"
  32. - "--osd-ids"
  33. - "<IDS HERE>"
  34. env:
  35. - name: POD_NAMESPACE
  36. valueFrom:
  37. fieldRef:
  38. fieldPath: metadata.namespace
  39. - name: ROOK_MON_ENDPOINTS
  40. valueFrom:
  41. configMapKeyRef:
  42. key: data
  43. name: rook-ceph-mon-endpoints
  44. - name: ROOK_CEPH_USERNAME
  45. valueFrom:
  46. secretKeyRef:
  47. key: ceph-username
  48. name: rook-ceph-mon
  49. - name: ROOK_CEPH_SECRET
  50. valueFrom:
  51. secretKeyRef:
  52. key: ceph-secret
  53. name: rook-ceph-mon
  54. - name: ROOK_CONFIG_DIR
  55. value: /var/lib/rook
  56. - name: ROOK_CEPH_CONFIG_OVERRIDE
  57. value: /etc/rook/config/override.conf
  58. - name: ROOK_FSID
  59. valueFrom:
  60. secretKeyRef:
  61. key: fsid
  62. name: rook-ceph-mon
  63. - name: ROOK_LOG_LEVEL
  64. value: DEBUG
  65. volumeMounts:
  66. - mountPath: /etc/ceph
  67. name: ceph-conf-emptydir
  68. - mountPath: /var/lib/rook
  69. name: rook-config
  70. volumes:
  71. - emptyDir: {}
  72. name: ceph-conf-emptydir
  73. - emptyDir: {}
  74. name: rook-config
  75. restartPolicy: Never