bak-openebs-operator.yaml 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005
  1. # This manifest deploys the OpenEBS control plane components,
  2. # with associated CRs & RBAC rules
  3. # NOTE: On GKE, deploy the openebs-operator.yaml in admin context
  4. #
  5. # NOTE: The Jiva and cStor components previously included in the Operator File
  6. # are now removed and it is recommended for users to use cStor and Jiva CSI operators.
  7. # To upgrade your Jiva and cStor volumes to CSI, please checkout the documentation at:
  8. # https://github.com/openebs/upgrade
  9. #
  10. # To deploy the legacy Jiva and cStor:
  11. # kubectl apply -f https://openebs.github.io/charts/legacy-openebs-operator.yaml
  12. #
  13. # To deploy cStor CSI:
  14. # kubectl apply -f https://openebs.github.io/charts/cstor-operator.yaml
  15. #
  16. # To deploy Jiva CSI:
  17. # kubectl apply -f https://openebs.github.io/charts/jiva-operator.yaml
  18. #
  19. # Create the OpenEBS namespace
  20. apiVersion: v1
  21. kind: Namespace
  22. metadata:
  23. name: opebs
  24. ---
  25. # Create Maya Service Account
  26. apiVersion: v1
  27. kind: ServiceAccount
  28. metadata:
  29. name: openebs-maya-operator
  30. namespace: opebs
  31. ---
  32. # Define Role that allows operations on K8s pods/deployments
  33. kind: ClusterRole
  34. apiVersion: rbac.authorization.k8s.io/v1
  35. metadata:
  36. name: openebs-maya-operator
  37. rules:
  38. - apiGroups: ["*"]
  39. resources: ["nodes", "nodes/proxy"]
  40. verbs: ["*"]
  41. - apiGroups: ["*"]
  42. resources: ["namespaces", "services", "pods", "pods/exec", "deployments", "deployments/finalizers", "replicationcontrollers", "replicasets", "events", "endpoints", "configmaps", "secrets", "jobs", "cronjobs"]
  43. verbs: ["*"]
  44. - apiGroups: ["*"]
  45. resources: ["statefulsets", "daemonsets"]
  46. verbs: ["*"]
  47. - apiGroups: ["*"]
  48. resources: ["resourcequotas", "limitranges"]
  49. verbs: ["list", "watch"]
  50. - apiGroups: ["*"]
  51. resources: ["ingresses", "horizontalpodautoscalers", "verticalpodautoscalers", "certificatesigningrequests"]
  52. verbs: ["list", "watch"]
  53. - apiGroups: ["*"]
  54. resources: ["storageclasses", "persistentvolumeclaims", "persistentvolumes"]
  55. verbs: ["*"]
  56. - apiGroups: ["volumesnapshot.external-storage.k8s.io"]
  57. resources: ["volumesnapshots", "volumesnapshotdatas"]
  58. verbs: ["get", "list", "watch", "create", "update", "patch", "delete"]
  59. - apiGroups: ["apiextensions.k8s.io"]
  60. resources: ["customresourcedefinitions"]
  61. verbs: [ "get", "list", "create", "update", "delete", "patch"]
  62. - apiGroups: ["openebs.io"]
  63. resources: [ "*"]
  64. verbs: ["*" ]
  65. - apiGroups: ["cstor.openebs.io"]
  66. resources: [ "*"]
  67. verbs: ["*" ]
  68. - apiGroups: ["coordination.k8s.io"]
  69. resources: ["leases"]
  70. verbs: ["get", "watch", "list", "delete", "update", "create"]
  71. - apiGroups: ["admissionregistration.k8s.io"]
  72. resources: ["validatingwebhookconfigurations", "mutatingwebhookconfigurations"]
  73. verbs: ["get", "create", "list", "delete", "update", "patch"]
  74. - nonResourceURLs: ["/metrics"]
  75. verbs: ["get"]
  76. - apiGroups: ["*"]
  77. resources: ["poddisruptionbudgets"]
  78. verbs: ["get", "list", "create", "delete", "watch"]
  79. ---
  80. # Bind the Service Account with the Role Privileges.
  81. # TODO: Check if default account also needs to be there
  82. kind: ClusterRoleBinding
  83. apiVersion: rbac.authorization.k8s.io/v1
  84. metadata:
  85. name: openebs-maya-operator
  86. subjects:
  87. - kind: ServiceAccount
  88. name: openebs-maya-operator
  89. namespace: opebs
  90. roleRef:
  91. kind: ClusterRole
  92. name: openebs-maya-operator
  93. apiGroup: rbac.authorization.k8s.io
  94. ---
  95. apiVersion: apiextensions.k8s.io/v1
  96. kind: CustomResourceDefinition
  97. metadata:
  98. annotations:
  99. controller-gen.kubebuilder.io/version: v0.5.0
  100. creationTimestamp: null
  101. name: blockdevices.openebs.io
  102. spec:
  103. group: openebs.io
  104. names:
  105. kind: BlockDevice
  106. listKind: BlockDeviceList
  107. plural: blockdevices
  108. shortNames:
  109. - bd
  110. singular: blockdevice
  111. scope: Namespaced
  112. versions:
  113. - additionalPrinterColumns:
  114. - jsonPath: .spec.nodeAttributes.nodeName
  115. name: NodeName
  116. type: string
  117. - jsonPath: .spec.path
  118. name: Path
  119. priority: 1
  120. type: string
  121. - jsonPath: .spec.filesystem.fsType
  122. name: FSType
  123. priority: 1
  124. type: string
  125. - jsonPath: .spec.capacity.storage
  126. name: Size
  127. type: string
  128. - jsonPath: .status.claimState
  129. name: ClaimState
  130. type: string
  131. - jsonPath: .status.state
  132. name: Status
  133. type: string
  134. - jsonPath: .metadata.creationTimestamp
  135. name: Age
  136. type: date
  137. name: v1alpha1
  138. schema:
  139. openAPIV3Schema:
  140. description: BlockDevice is the Schema for the blockdevices API
  141. properties:
  142. apiVersion:
  143. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  144. type: string
  145. kind:
  146. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  147. type: string
  148. metadata:
  149. type: object
  150. spec:
  151. description: DeviceSpec defines the properties and runtime status of a BlockDevice
  152. properties:
  153. aggregateDevice:
  154. description: AggregateDevice was intended to store the hierarchical information in cases of LVM. However this is currently not implemented and may need to be re-looked into for better design. To be deprecated
  155. type: string
  156. capacity:
  157. description: Capacity
  158. properties:
  159. logicalSectorSize:
  160. description: LogicalSectorSize is blockdevice logical-sector size in bytes
  161. format: int32
  162. type: integer
  163. physicalSectorSize:
  164. description: PhysicalSectorSize is blockdevice physical-Sector size in bytes
  165. format: int32
  166. type: integer
  167. storage:
  168. description: Storage is the blockdevice capacity in bytes
  169. format: int64
  170. type: integer
  171. required:
  172. - storage
  173. type: object
  174. claimRef:
  175. description: ClaimRef is the reference to the BDC which has claimed this BD
  176. properties:
  177. apiVersion:
  178. description: API version of the referent.
  179. type: string
  180. fieldPath:
  181. description: 'If referring to a piece of an object instead of an entire object, this string should contain a valid JSON/Go field access statement, such as desiredState.manifest.containers[2]. For example, if the object reference is to a container within a pod, this would take on a value like: "spec.containers{name}" (where "name" refers to the name of the container that triggered the event) or if no container name is specified "spec.containers[2]" (container with index 2 in this pod). This syntax is chosen only to have some well-defined way of referencing a part of an object. TODO: this design is not final and this field is subject to change in the future.'
  182. type: string
  183. kind:
  184. description: 'Kind of the referent. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  185. type: string
  186. name:
  187. description: 'Name of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#names'
  188. type: string
  189. namespace:
  190. description: 'Namespace of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/namespaces/'
  191. type: string
  192. resourceVersion:
  193. description: 'Specific resourceVersion to which this reference is made, if any. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#concurrency-control-and-consistency'
  194. type: string
  195. uid:
  196. description: 'UID of the referent. More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#uids'
  197. type: string
  198. type: object
  199. details:
  200. description: Details contain static attributes of BD like model,serial, and so forth
  201. properties:
  202. compliance:
  203. description: Compliance is standards/specifications version implemented by device firmware such as SPC-1, SPC-2, etc
  204. type: string
  205. deviceType:
  206. description: DeviceType represents the type of device like sparse, disk, partition, lvm, crypt
  207. enum:
  208. - disk
  209. - partition
  210. - sparse
  211. - loop
  212. - lvm
  213. - crypt
  214. - dm
  215. - mpath
  216. type: string
  217. driveType:
  218. description: DriveType is the type of backing drive, HDD/SSD
  219. enum:
  220. - HDD
  221. - SSD
  222. - Unknown
  223. - ""
  224. type: string
  225. firmwareRevision:
  226. description: FirmwareRevision is the disk firmware revision
  227. type: string
  228. hardwareSectorSize:
  229. description: HardwareSectorSize is the hardware sector size in bytes
  230. format: int32
  231. type: integer
  232. logicalBlockSize:
  233. description: LogicalBlockSize is the logical block size in bytes reported by /sys/class/block/sda/queue/logical_block_size
  234. format: int32
  235. type: integer
  236. model:
  237. description: Model is model of disk
  238. type: string
  239. physicalBlockSize:
  240. description: PhysicalBlockSize is the physical block size in bytes reported by /sys/class/block/sda/queue/physical_block_size
  241. format: int32
  242. type: integer
  243. serial:
  244. description: Serial is serial number of disk
  245. type: string
  246. vendor:
  247. description: Vendor is vendor of disk
  248. type: string
  249. type: object
  250. devlinks:
  251. description: DevLinks contains soft links of a block device like /dev/by-id/... /dev/by-uuid/...
  252. items:
  253. description: DeviceDevLink holds the mapping between type and links like by-id type or by-path type link
  254. properties:
  255. kind:
  256. description: Kind is the type of link like by-id or by-path.
  257. enum:
  258. - by-id
  259. - by-path
  260. type: string
  261. links:
  262. description: Links are the soft links
  263. items:
  264. type: string
  265. type: array
  266. type: object
  267. type: array
  268. filesystem:
  269. description: FileSystem contains mountpoint and filesystem type
  270. properties:
  271. fsType:
  272. description: Type represents the FileSystem type of the block device
  273. type: string
  274. mountPoint:
  275. description: MountPoint represents the mountpoint of the block device.
  276. type: string
  277. type: object
  278. nodeAttributes:
  279. description: NodeAttributes has the details of the node on which BD is attached
  280. properties:
  281. nodeName:
  282. description: NodeName is the name of the Kubernetes node resource on which the device is attached
  283. type: string
  284. type: object
  285. parentDevice:
  286. description: "ParentDevice was intended to store the UUID of the parent Block Device as is the case for partitioned block devices. \n For example: /dev/sda is the parent for /dev/sda1 To be deprecated"
  287. type: string
  288. partitioned:
  289. description: Partitioned represents if BlockDevice has partitions or not (Yes/No) Currently always default to No. To be deprecated
  290. enum:
  291. - "Yes"
  292. - "No"
  293. type: string
  294. path:
  295. description: Path contain devpath (e.g. /dev/sdb)
  296. type: string
  297. required:
  298. - capacity
  299. - devlinks
  300. - nodeAttributes
  301. - path
  302. type: object
  303. status:
  304. description: DeviceStatus defines the observed state of BlockDevice
  305. properties:
  306. claimState:
  307. description: ClaimState represents the claim state of the block device
  308. enum:
  309. - Claimed
  310. - Unclaimed
  311. - Released
  312. type: string
  313. state:
  314. description: State is the current state of the blockdevice (Active/Inactive/Unknown)
  315. enum:
  316. - Active
  317. - Inactive
  318. - Unknown
  319. type: string
  320. required:
  321. - claimState
  322. - state
  323. type: object
  324. type: object
  325. served: true
  326. storage: true
  327. subresources: {}
  328. status:
  329. acceptedNames:
  330. kind: ""
  331. plural: ""
  332. conditions: []
  333. storedVersions: []
  334. ---
  335. apiVersion: apiextensions.k8s.io/v1
  336. kind: CustomResourceDefinition
  337. metadata:
  338. annotations:
  339. controller-gen.kubebuilder.io/version: v0.5.0
  340. creationTimestamp: null
  341. name: blockdeviceclaims.openebs.io
  342. spec:
  343. group: openebs.io
  344. names:
  345. kind: BlockDeviceClaim
  346. listKind: BlockDeviceClaimList
  347. plural: blockdeviceclaims
  348. shortNames:
  349. - bdc
  350. singular: blockdeviceclaim
  351. scope: Namespaced
  352. versions:
  353. - additionalPrinterColumns:
  354. - jsonPath: .spec.blockDeviceName
  355. name: BlockDeviceName
  356. type: string
  357. - jsonPath: .status.phase
  358. name: Phase
  359. type: string
  360. - jsonPath: .metadata.creationTimestamp
  361. name: Age
  362. type: date
  363. name: v1alpha1
  364. schema:
  365. openAPIV3Schema:
  366. description: BlockDeviceClaim is the Schema for the blockdeviceclaims API
  367. properties:
  368. apiVersion:
  369. description: 'APIVersion defines the versioned schema of this representation of an object. Servers should convert recognized schemas to the latest internal value, and may reject unrecognized values. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#resources'
  370. type: string
  371. kind:
  372. description: 'Kind is a string value representing the REST resource this object represents. Servers may infer this from the endpoint the client submits requests to. Cannot be updated. In CamelCase. More info: https://git.k8s.io/community/contributors/devel/sig-architecture/api-conventions.md#types-kinds'
  373. type: string
  374. metadata:
  375. type: object
  376. spec:
  377. description: DeviceClaimSpec defines the request details for a BlockDevice
  378. properties:
  379. blockDeviceName:
  380. description: BlockDeviceName is the reference to the block-device backing this claim
  381. type: string
  382. blockDeviceNodeAttributes:
  383. description: BlockDeviceNodeAttributes is the attributes on the node from which a BD should be selected for this claim. It can include nodename, failure domain etc.
  384. properties:
  385. hostName:
  386. description: HostName represents the hostname of the Kubernetes node resource where the BD should be present
  387. type: string
  388. nodeName:
  389. description: NodeName represents the name of the Kubernetes node resource where the BD should be present
  390. type: string
  391. type: object
  392. deviceClaimDetails:
  393. description: Details of the device to be claimed
  394. properties:
  395. allowPartition:
  396. description: AllowPartition represents whether to claim a full block device or a device that is a partition
  397. type: boolean
  398. blockVolumeMode:
  399. description: 'BlockVolumeMode represents whether to claim a device in Block mode or Filesystem mode. These are use cases of BlockVolumeMode: 1) Not specified: VolumeMode check will not be effective 2) VolumeModeBlock: BD should not have any filesystem or mountpoint 3) VolumeModeFileSystem: BD should have a filesystem and mountpoint. If DeviceFormat is specified then the format should match with the FSType in BD'
  400. type: string
  401. formatType:
  402. description: Format of the device required, eg:ext4, xfs
  403. type: string
  404. type: object
  405. deviceType:
  406. description: DeviceType represents the type of drive like SSD, HDD etc.,
  407. nullable: true
  408. type: string
  409. hostName:
  410. description: Node name from where blockdevice has to be claimed. To be deprecated. Use NodeAttributes.HostName instead
  411. type: string
  412. resources:
  413. description: Resources will help with placing claims on Capacity, IOPS
  414. properties:
  415. requests:
  416. additionalProperties:
  417. anyOf:
  418. - type: integer
  419. - type: string
  420. pattern: ^(\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))(([KMGTPE]i)|[numkMGTPE]|([eE](\+|-)?(([0-9]+(\.[0-9]*)?)|(\.[0-9]+))))?$
  421. x-kubernetes-int-or-string: true
  422. description: 'Requests describes the minimum resources required. eg: if storage resource of 10G is requested minimum capacity of 10G should be available TODO for validating'
  423. type: object
  424. required:
  425. - requests
  426. type: object
  427. selector:
  428. description: Selector is used to find block devices to be considered for claiming
  429. properties:
  430. matchExpressions:
  431. description: matchExpressions is a list of label selector requirements. The requirements are ANDed.
  432. items:
  433. description: A label selector requirement is a selector that contains values, a key, and an operator that relates the key and values.
  434. properties:
  435. key:
  436. description: key is the label key that the selector applies to.
  437. type: string
  438. operator:
  439. description: operator represents a key's relationship to a set of values. Valid operators are In, NotIn, Exists and DoesNotExist.
  440. type: string
  441. values:
  442. description: values is an array of string values. If the operator is In or NotIn, the values array must be non-empty. If the operator is Exists or DoesNotExist, the values array must be empty. This array is replaced during a strategic merge patch.
  443. items:
  444. type: string
  445. type: array
  446. required:
  447. - key
  448. - operator
  449. type: object
  450. type: array
  451. matchLabels:
  452. additionalProperties:
  453. type: string
  454. description: matchLabels is a map of {key,value} pairs. A single {key,value} in the matchLabels map is equivalent to an element of matchExpressions, whose key field is "key", the operator is "In", and the values array contains only "value". The requirements are ANDed.
  455. type: object
  456. type: object
  457. type: object
  458. status:
  459. description: DeviceClaimStatus defines the observed state of BlockDeviceClaim
  460. properties:
  461. phase:
  462. description: Phase represents the current phase of the claim
  463. type: string
  464. required:
  465. - phase
  466. type: object
  467. type: object
  468. served: true
  469. storage: true
  470. subresources: {}
  471. status:
  472. acceptedNames:
  473. kind: ""
  474. plural: ""
  475. conditions: []
  476. storedVersions: []
  477. ---
  478. # This is the node-disk-manager related config.
  479. # It can be used to customize the disks probes and filters
  480. apiVersion: v1
  481. kind: ConfigMap
  482. metadata:
  483. name: openebs-ndm-config
  484. namespace: opebs
  485. labels:
  486. openebs.io/component-name: ndm-config
  487. data:
  488. # udev-probe is default or primary probe it should be enabled to run ndm
  489. # filterconfigs contains configs of filters. To provide a group of include
  490. # and exclude values add it as , separated string
  491. node-disk-manager.config: |
  492. probeconfigs:
  493. - key: udev-probe
  494. name: udev probe
  495. state: true
  496. - key: seachest-probe
  497. name: seachest probe
  498. state: false
  499. - key: smart-probe
  500. name: smart probe
  501. state: true
  502. filterconfigs:
  503. - key: os-disk-exclude-filter
  504. name: os disk exclude filter
  505. state: true
  506. exclude: "/,/etc/hosts,/boot"
  507. - key: vendor-filter
  508. name: vendor filter
  509. state: true
  510. include: ""
  511. exclude: "CLOUDBYT,OpenEBS"
  512. - key: path-filter
  513. name: path filter
  514. state: true
  515. include: ""
  516. exclude: "/dev/loop,/dev/fd0,/dev/sr0,/dev/ram,/dev/md,/dev/dm-,/dev/rbd,/dev/zd"
  517. # metconfig can be used to decorate the block device with different types of labels
  518. # that are available on the node or come in a device properties.
  519. # node labels - the node where bd is discovered. A whitlisted label prefixes
  520. # attribute labels - a property of the BD can be added as a ndm label as ndm.io/<property>=<property-value>
  521. metaconfigs:
  522. - key: node-labels
  523. name: node labels
  524. pattern: ""
  525. - key: device-labels
  526. name: device labels
  527. type: ""
  528. ---
  529. apiVersion: apps/v1
  530. kind: DaemonSet
  531. metadata:
  532. name: openebs-ndm
  533. namespace: opebs
  534. labels:
  535. name: openebs-ndm
  536. openebs.io/component-name: ndm
  537. openebs.io/version: 3.3.0
  538. spec:
  539. selector:
  540. matchLabels:
  541. name: openebs-ndm
  542. openebs.io/component-name: ndm
  543. updateStrategy:
  544. type: RollingUpdate
  545. template:
  546. metadata:
  547. labels:
  548. name: openebs-ndm
  549. openebs.io/component-name: ndm
  550. openebs.io/version: 3.3.0
  551. spec:
  552. # By default the node-disk-manager will be run on all kubernetes nodes
  553. # If you would like to limit this to only some nodes, say the nodes
  554. # that have storage attached, you could label those node and use
  555. # nodeSelector.
  556. #
  557. # e.g. label the storage nodes with - "openebs.io/nodegroup"="storage-node"
  558. # kubectl label node <node-name> "openebs.io/nodegroup"="storage-node"
  559. #nodeSelector:
  560. # "openebs.io/nodegroup": "storage-node"
  561. serviceAccountName: openebs-maya-operator
  562. hostNetwork: true
  563. # host PID is used to check status of iSCSI Service when the NDM
  564. # API service is enabled
  565. #hostPID: true
  566. containers:
  567. - name: node-disk-manager
  568. image: openebs/node-disk-manager:2.0.0
  569. args:
  570. - -v=4
  571. # The feature-gate is used to enable the new UUID algorithm.
  572. - --feature-gates="GPTBasedUUID"
  573. # Use partition table UUID instead of create single partition to get
  574. # partition UUID. Require `GPTBasedUUID` to be enabled with.
  575. # - --feature-gates="PartitionTableUUID"
  576. # Detect changes to device size, filesystem and mount-points without restart.
  577. # - --feature-gates="ChangeDetection"
  578. # The feature gate is used to start the gRPC API service. The gRPC server
  579. # starts at 9115 port by default. This feature is currently in Alpha state
  580. # - --feature-gates="APIService"
  581. # The feature gate is used to enable NDM, to create blockdevice resources
  582. # for unused partitions on the OS disk
  583. # - --feature-gates="UseOSDisk"
  584. imagePullPolicy: IfNotPresent
  585. securityContext:
  586. privileged: true
  587. volumeMounts:
  588. - name: config
  589. mountPath: /host/node-disk-manager.config
  590. subPath: node-disk-manager.config
  591. readOnly: true
  592. # make udev database available inside container
  593. - name: udev
  594. mountPath: /run/udev
  595. - name: procmount
  596. mountPath: /host/proc
  597. readOnly: true
  598. - name: devmount
  599. mountPath: /dev
  600. - name: basepath
  601. mountPath: /var/openebs/ndm
  602. - name: sparsepath
  603. mountPath: /var/openebs/sparse
  604. env:
  605. # namespace in which NDM is installed will be passed to NDM Daemonset
  606. # as environment variable
  607. - name: NAMESPACE
  608. valueFrom:
  609. fieldRef:
  610. fieldPath: metadata.namespace
  611. # pass hostname as env variable using downward API to the NDM container
  612. - name: NODE_NAME
  613. valueFrom:
  614. fieldRef:
  615. fieldPath: spec.nodeName
  616. # specify the directory where the sparse files need to be created.
  617. # if not specified, then sparse files will not be created.
  618. - name: SPARSE_FILE_DIR
  619. value: "/var/openebs/sparse"
  620. # Size(bytes) of the sparse file to be created.
  621. - name: SPARSE_FILE_SIZE
  622. value: "10737418240"
  623. # Specify the number of sparse files to be created
  624. - name: SPARSE_FILE_COUNT
  625. value: "0"
  626. livenessProbe:
  627. exec:
  628. command:
  629. - pgrep
  630. - "ndm"
  631. initialDelaySeconds: 30
  632. periodSeconds: 60
  633. volumes:
  634. - name: config
  635. configMap:
  636. name: openebs-ndm-config
  637. - name: udev
  638. hostPath:
  639. path: /run/udev
  640. type: Directory
  641. # mount /proc (to access mount file of process 1 of host) inside container
  642. # to read mount-point of disks and partitions
  643. - name: procmount
  644. hostPath:
  645. path: /proc
  646. type: Directory
  647. - name: devmount
  648. # the /dev directory is mounted so that we have access to the devices that
  649. # are connected at runtime of the pod.
  650. hostPath:
  651. path: /dev
  652. type: Directory
  653. - name: basepath
  654. hostPath:
  655. path: /var/openebs/ndm
  656. type: DirectoryOrCreate
  657. - name: sparsepath
  658. hostPath:
  659. path: /var/openebs/sparse
  660. ---
  661. apiVersion: apps/v1
  662. kind: Deployment
  663. metadata:
  664. name: openebs-ndm-operator
  665. namespace: opebs
  666. labels:
  667. name: openebs-ndm-operator
  668. openebs.io/component-name: ndm-operator
  669. openebs.io/version: 3.3.0
  670. spec:
  671. selector:
  672. matchLabels:
  673. name: openebs-ndm-operator
  674. openebs.io/component-name: ndm-operator
  675. replicas: 1
  676. strategy:
  677. type: Recreate
  678. template:
  679. metadata:
  680. labels:
  681. name: openebs-ndm-operator
  682. openebs.io/component-name: ndm-operator
  683. openebs.io/version: 3.3.0
  684. spec:
  685. serviceAccountName: openebs-maya-operator
  686. containers:
  687. - name: node-disk-operator
  688. image: openebs/node-disk-operator:2.0.0
  689. imagePullPolicy: IfNotPresent
  690. env:
  691. - name: WATCH_NAMESPACE
  692. valueFrom:
  693. fieldRef:
  694. fieldPath: metadata.namespace
  695. - name: POD_NAME
  696. valueFrom:
  697. fieldRef:
  698. fieldPath: metadata.name
  699. # the service account of the ndm-operator pod
  700. - name: SERVICE_ACCOUNT
  701. valueFrom:
  702. fieldRef:
  703. fieldPath: spec.serviceAccountName
  704. - name: OPERATOR_NAME
  705. value: "node-disk-operator"
  706. - name: CLEANUP_JOB_IMAGE
  707. value: "openebs/linux-utils:3.3.0"
  708. # OPENEBS_IO_IMAGE_PULL_SECRETS environment variable is used to pass the image pull secrets
  709. # to the cleanup pod launched by NDM operator
  710. #- name: OPENEBS_IO_IMAGE_PULL_SECRETS
  711. # value: ""
  712. livenessProbe:
  713. httpGet:
  714. path: /healthz
  715. port: 8585
  716. initialDelaySeconds: 15
  717. periodSeconds: 20
  718. readinessProbe:
  719. httpGet:
  720. path: /readyz
  721. port: 8585
  722. initialDelaySeconds: 5
  723. periodSeconds: 10
  724. ---
  725. # Create NDM cluster exporter deployment.
  726. # This is an optional component and is not required for the basic
  727. # functioning of NDM
  728. apiVersion: apps/v1
  729. kind: Deployment
  730. metadata:
  731. name: openebs-ndm-cluster-exporter
  732. namespace: opebs
  733. labels:
  734. name: openebs-ndm-cluster-exporter
  735. openebs.io/component-name: ndm-cluster-exporter
  736. openebs.io/version: 3.3.0
  737. spec:
  738. replicas: 1
  739. strategy:
  740. type: Recreate
  741. selector:
  742. matchLabels:
  743. name: openebs-ndm-cluster-exporter
  744. openebs.io/component-name: ndm-cluster-exporter
  745. template:
  746. metadata:
  747. labels:
  748. name: openebs-ndm-cluster-exporter
  749. openebs.io/component-name: ndm-cluster-exporter
  750. openebs.io/version: 3.3.0
  751. spec:
  752. serviceAccountName: openebs-maya-operator
  753. containers:
  754. - name: ndm-cluster-exporter
  755. image: openebs/node-disk-exporter:2.0.0
  756. command:
  757. - /usr/local/bin/exporter
  758. args:
  759. - "start"
  760. - "--mode=cluster"
  761. - "--port=$(METRICS_LISTEN_PORT)"
  762. - "--metrics=/metrics"
  763. ports:
  764. - containerPort: 9100
  765. protocol: TCP
  766. name: metrics
  767. imagePullPolicy: IfNotPresent
  768. env:
  769. - name: NAMESPACE
  770. valueFrom:
  771. fieldRef:
  772. fieldPath: metadata.namespace
  773. - name: METRICS_LISTEN_PORT
  774. value: :9100
  775. ---
  776. # Create NDM cluster exporter service
  777. # This is optional and required only when
  778. # ndm-cluster-exporter deployment is used
  779. apiVersion: v1
  780. kind: Service
  781. metadata:
  782. name: openebs-ndm-cluster-exporter-service
  783. namespace: opebs
  784. labels:
  785. name: openebs-ndm-cluster-exporter-service
  786. openebs.io/component-name: ndm-cluster-exporter
  787. app: openebs-ndm-exporter
  788. spec:
  789. clusterIP: None
  790. ports:
  791. - name: metrics
  792. port: 9100
  793. targetPort: 9100
  794. selector:
  795. name: openebs-ndm-cluster-exporter
  796. ---
  797. # Create NDM node exporter daemonset.
  798. # This is an optional component used for getting disk level
  799. # metrics from each of the storage nodes
  800. apiVersion: apps/v1
  801. kind: DaemonSet
  802. metadata:
  803. name: openebs-ndm-node-exporter
  804. namespace: opebs
  805. labels:
  806. name: openebs-ndm-node-exporter
  807. openebs.io/component-name: ndm-node-exporter
  808. openebs.io/version: 3.3.0
  809. spec:
  810. updateStrategy:
  811. type: RollingUpdate
  812. selector:
  813. matchLabels:
  814. name: openebs-ndm-node-exporter
  815. openebs.io/component-name: ndm-node-exporter
  816. template:
  817. metadata:
  818. labels:
  819. name: openebs-ndm-node-exporter
  820. openebs.io/component-name: ndm-node-exporter
  821. openebs.io/version: 3.3.0
  822. spec:
  823. serviceAccountName: openebs-maya-operator
  824. containers:
  825. - name: node-disk-exporter
  826. image: openebs/node-disk-exporter:2.0.0
  827. command:
  828. - /usr/local/bin/exporter
  829. args:
  830. - "start"
  831. - "--mode=node"
  832. - "--port=$(METRICS_LISTEN_PORT)"
  833. - "--metrics=/metrics"
  834. ports:
  835. - containerPort: 9101
  836. protocol: TCP
  837. name: metrics
  838. imagePullPolicy: IfNotPresent
  839. securityContext:
  840. privileged: true
  841. env:
  842. - name: NAMESPACE
  843. valueFrom:
  844. fieldRef:
  845. fieldPath: metadata.namespace
  846. - name: METRICS_LISTEN_PORT
  847. value: :9101
  848. ---
  849. # Create NDM node exporter service
  850. # This is optional and required only when
  851. # ndm-node-exporter daemonset is used
  852. apiVersion: v1
  853. kind: Service
  854. metadata:
  855. name: openebs-ndm-node-exporter-service
  856. namespace: opebs
  857. labels:
  858. name: openebs-ndm-node-exporter
  859. openebs.io/component: openebs-ndm-node-exporter
  860. app: openebs-ndm-exporter
  861. spec:
  862. clusterIP: None
  863. ports:
  864. - name: metrics
  865. port: 9101
  866. targetPort: 9101
  867. selector:
  868. name: openebs-ndm-node-exporter
  869. ---
  870. apiVersion: apps/v1
  871. kind: Deployment
  872. metadata:
  873. name: openebs-localpv-provisioner
  874. namespace: opebs
  875. labels:
  876. name: openebs-localpv-provisioner
  877. openebs.io/component-name: openebs-localpv-provisioner
  878. openebs.io/version: 3.3.0
  879. spec:
  880. selector:
  881. matchLabels:
  882. name: openebs-localpv-provisioner
  883. openebs.io/component-name: openebs-localpv-provisioner
  884. replicas: 1
  885. strategy:
  886. type: Recreate
  887. template:
  888. metadata:
  889. labels:
  890. name: openebs-localpv-provisioner
  891. openebs.io/component-name: openebs-localpv-provisioner
  892. openebs.io/version: 3.3.0
  893. spec:
  894. serviceAccountName: openebs-maya-operator
  895. containers:
  896. - name: openebs-provisioner-hostpath
  897. imagePullPolicy: IfNotPresent
  898. image: openebs/provisioner-localpv:3.3.0
  899. args:
  900. - "--bd-time-out=$(BDC_BD_BIND_RETRIES)"
  901. env:
  902. # OPENEBS_IO_K8S_MASTER enables openebs provisioner to connect to K8s
  903. # based on this address. This is ignored if empty.
  904. # This is supported for openebs provisioner version 0.5.2 onwards
  905. #- name: OPENEBS_IO_K8S_MASTER
  906. # value: "http://10.128.0.12:8080"
  907. # OPENEBS_IO_KUBE_CONFIG enables openebs provisioner to connect to K8s
  908. # based on this config. This is ignored if empty.
  909. # This is supported for openebs provisioner version 0.5.2 onwards
  910. #- name: OPENEBS_IO_KUBE_CONFIG
  911. # value: "/home/ubuntu/.kube/config"
  912. # This sets the number of times the provisioner should try
  913. # with a polling interval of 5 seconds, to get the Blockdevice
  914. # Name from a BlockDeviceClaim, before the BlockDeviceClaim
  915. # is deleted. E.g. 12 * 5 seconds = 60 seconds timeout
  916. - name: BDC_BD_BIND_RETRIES
  917. value: "12"
  918. - name: NODE_NAME
  919. valueFrom:
  920. fieldRef:
  921. fieldPath: spec.nodeName
  922. - name: OPENEBS_NAMESPACE
  923. valueFrom:
  924. fieldRef:
  925. fieldPath: metadata.namespace
  926. # OPENEBS_SERVICE_ACCOUNT provides the service account of this pod as
  927. # environment variable
  928. - name: OPENEBS_SERVICE_ACCOUNT
  929. valueFrom:
  930. fieldRef:
  931. fieldPath: spec.serviceAccountName
  932. - name: OPENEBS_IO_ENABLE_ANALYTICS
  933. value: "true"
  934. - name: OPENEBS_IO_INSTALLER_TYPE
  935. value: "openebs-operator"
  936. - name: OPENEBS_IO_HELPER_IMAGE
  937. value: "openebs/linux-utils:3.3.0"
  938. - name: OPENEBS_IO_BASE_PATH
  939. value: "/home/openebs/local"
  940. # LEADER_ELECTION_ENABLED is used to enable/disable leader election. By default
  941. # leader election is enabled.
  942. #- name: LEADER_ELECTION_ENABLED
  943. # value: "true"
  944. # OPENEBS_IO_IMAGE_PULL_SECRETS environment variable is used to pass the image pull secrets
  945. # to the helper pod launched by local-pv hostpath provisioner
  946. #- name: OPENEBS_IO_IMAGE_PULL_SECRETS
  947. # value: ""
  948. # Process name used for matching is limited to the 15 characters
  949. # present in the pgrep output.
  950. # So fullname can't be used here with pgrep (>15 chars).A regular expression
  951. # that matches the entire command name has to specified.
  952. # Anchor `^` : matches any string that starts with `provisioner-loc`
  953. # `.*`: matches any string that has `provisioner-loc` followed by zero or more char
  954. livenessProbe:
  955. exec:
  956. command:
  957. - sh
  958. - -c
  959. - test `pgrep -c "^provisioner-loc.*"` = 1
  960. initialDelaySeconds: 30
  961. periodSeconds: 60
  962. ---
  963. apiVersion: storage.k8s.io/v1
  964. kind: StorageClass
  965. metadata:
  966. name: openebs-hostpath
  967. annotations:
  968. openebs.io/cas-type: local
  969. cas.openebs.io/config: |
  970. #hostpath type will create a PV by
  971. # creating a sub-directory under the
  972. # BASEPATH provided below.
  973. - name: StorageType
  974. value: "hostpath"
  975. #Specify the location (directory) where
  976. # where PV(volume) data will be saved.
  977. # A sub-directory with pv-name will be
  978. # created. When the volume is deleted,
  979. # the PV sub-directory will be deleted.
  980. #Default value is /var/openebs/local
  981. - name: BasePath
  982. value: "/home/openebs/local"
  983. provisioner: openebs.io/local
  984. volumeBindingMode: WaitForFirstConsumer
  985. reclaimPolicy: Retain
  986. allowVolumeExpansion: true
  987. ---
  988. apiVersion: storage.k8s.io/v1
  989. kind: StorageClass
  990. metadata:
  991. name: openebs-device
  992. annotations:
  993. openebs.io/cas-type: local
  994. cas.openebs.io/config: |
  995. #device type will create a PV by
  996. # issuing a BDC and will extract the path
  997. # values from the associated BD.
  998. - name: StorageType
  999. value: "device"
  1000. provisioner: openebs.io/local
  1001. volumeBindingMode: WaitForFirstConsumer
  1002. reclaimPolicy: Retain
  1003. ---