openebs-operator.yaml 37 KB

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