glusterfs-template.yml 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. ---
  2. kind: Template
  3. apiVersion: v1
  4. metadata:
  5. name: glusterfs
  6. labels:
  7. glusterfs: template
  8. annotations:
  9. description: GlusterFS DaemonSet template
  10. tags: glusterfs
  11. objects:
  12. - kind: DaemonSet
  13. apiVersion: extensions/v1beta1
  14. metadata:
  15. name: glusterfs-${CLUSTER_NAME}
  16. labels:
  17. glusterfs: ${CLUSTER_NAME}-daemonset
  18. annotations:
  19. description: GlusterFS DaemonSet
  20. tags: glusterfs
  21. spec:
  22. selector:
  23. matchLabels:
  24. glusterfs: ${CLUSTER_NAME}-pod
  25. updateStrategy:
  26. type: OnDelete
  27. template:
  28. metadata:
  29. name: glusterfs-${CLUSTER_NAME}
  30. labels:
  31. glusterfs: ${CLUSTER_NAME}-pod
  32. glusterfs-node: pod
  33. spec:
  34. nodeSelector: "${{NODE_LABELS}}"
  35. hostNetwork: true
  36. containers:
  37. - name: glusterfs
  38. image: ${IMAGE_NAME}
  39. imagePullPolicy: IfNotPresent
  40. env:
  41. - name: GLUSTER_BLOCKD_STATUS_PROBE_ENABLE
  42. value: "${GLUSTER_BLOCKD_STATUS_PROBE_ENABLE}"
  43. - name: GB_GLFS_LRU_COUNT
  44. value: "${GB_GLFS_LRU_COUNT}"
  45. - name: TCMU_LOGDIR
  46. value: "${TCMU_LOGDIR}"
  47. - name: GB_LOGDIR
  48. value: "/var/log/glusterfs/gluster-block"
  49. resources:
  50. requests:
  51. memory: 100Mi
  52. cpu: 100m
  53. volumeMounts:
  54. - name: glusterfs-heketi
  55. mountPath: "/var/lib/heketi"
  56. - name: glusterfs-run
  57. mountPath: "/run"
  58. - name: glusterfs-lvm
  59. mountPath: "/run/lvm"
  60. - name: glusterfs-etc
  61. mountPath: "/etc/glusterfs"
  62. - name: glusterfs-logs
  63. mountPath: "/var/log/glusterfs"
  64. - name: glusterfs-config
  65. mountPath: "/var/lib/glusterd"
  66. - name: glusterfs-dev
  67. mountPath: "/dev"
  68. - name: glusterfs-misc
  69. mountPath: "/var/lib/misc/glusterfsd"
  70. - name: glusterfs-cgroup
  71. mountPath: "/sys/fs/cgroup"
  72. readOnly: true
  73. - name: glusterfs-ssl
  74. mountPath: "/etc/ssl"
  75. readOnly: true
  76. - name: kernel-modules
  77. mountPath: "/usr/lib/modules"
  78. readOnly: true
  79. - name: glusterfs-target
  80. mountPath: "/etc/target"
  81. securityContext:
  82. capabilities: {}
  83. privileged: true
  84. readinessProbe:
  85. timeoutSeconds: 3
  86. initialDelaySeconds: 40
  87. exec:
  88. command:
  89. - "/bin/bash"
  90. - "-c"
  91. - "if command -v /usr/local/bin/status-probe.sh; then /usr/local/bin/status-probe.sh readiness; else systemctl status glusterd.service; fi"
  92. periodSeconds: 25
  93. successThreshold: 1
  94. failureThreshold: 50
  95. livenessProbe:
  96. timeoutSeconds: 3
  97. initialDelaySeconds: 40
  98. exec:
  99. command:
  100. - "/bin/bash"
  101. - "-c"
  102. - "if command -v /usr/local/bin/status-probe.sh; then /usr/local/bin/status-probe.sh liveness; else systemctl status glusterd.service; fi"
  103. periodSeconds: 25
  104. successThreshold: 1
  105. failureThreshold: 50
  106. terminationMessagePath: "/dev/termination-log"
  107. volumes:
  108. - name: glusterfs-heketi
  109. hostPath:
  110. path: "/var/lib/heketi"
  111. - name: glusterfs-run
  112. emptyDir: {}
  113. - name: glusterfs-lvm
  114. hostPath:
  115. path: "/run/lvm"
  116. - name: glusterfs-etc
  117. hostPath:
  118. path: "/etc/glusterfs"
  119. - name: glusterfs-logs
  120. hostPath:
  121. path: "/var/log/glusterfs"
  122. - name: glusterfs-config
  123. hostPath:
  124. path: "/var/lib/glusterd"
  125. - name: glusterfs-dev
  126. hostPath:
  127. path: "/dev"
  128. - name: glusterfs-misc
  129. hostPath:
  130. path: "/var/lib/misc/glusterfsd"
  131. - name: glusterfs-cgroup
  132. hostPath:
  133. path: "/sys/fs/cgroup"
  134. - name: glusterfs-ssl
  135. hostPath:
  136. path: "/etc/ssl"
  137. - name: kernel-modules
  138. hostPath:
  139. path: "/usr/lib/modules"
  140. - name: glusterfs-target
  141. hostPath:
  142. path: "/etc/target"
  143. restartPolicy: Always
  144. terminationGracePeriodSeconds: 30
  145. dnsPolicy: ClusterFirst
  146. securityContext: {}
  147. parameters:
  148. - name: NODE_LABELS
  149. displayName: Daemonset Node Labels
  150. description: Labels which define the daemonset node selector. Must contain at least one label of the format \'glusterfs=<CLUSTER_NAME>-host\'
  151. value: '{ "glusterfs": "storage-host" }'
  152. - name: GLUSTER_BLOCKD_STATUS_PROBE_ENABLE
  153. displayName: Enable readiness/liveness probe for gluster-blockd
  154. description: Setting the value to "1" enables the readiness/liveness probe for gluster-blockd.
  155. value: "1"
  156. required: false
  157. - name: IMAGE_NAME
  158. displayName: GlusterFS container image name
  159. required: True
  160. - name: CLUSTER_NAME
  161. displayName: GlusterFS cluster name
  162. description: A unique name to identify which heketi service manages this cluster, useful for running multiple heketi instances
  163. value: storage
  164. - name: GB_GLFS_LRU_COUNT
  165. displayName: Maximum number of block hosting volumes
  166. description: This value is to set maximum number of block hosting volumes.
  167. value: "15"
  168. required: true
  169. - name: TCMU_LOGDIR
  170. displayName: Tcmu runner log directory
  171. description: This value is to set tcmu runner log directory
  172. value: "/var/log/glusterfs/gluster-block"
  173. required: true