heketi-template.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. ---
  2. kind: Template
  3. apiVersion: v1
  4. metadata:
  5. name: heketi
  6. labels:
  7. glusterfs: heketi-template
  8. annotations:
  9. description: Heketi service deployment template
  10. tags: glusterfs,heketi
  11. objects:
  12. - kind: Service
  13. apiVersion: v1
  14. metadata:
  15. name: heketi-${CLUSTER_NAME}
  16. labels:
  17. glusterfs: heketi-${CLUSTER_NAME}-service
  18. heketi: ${CLUSTER_NAME}-service
  19. annotations:
  20. description: Exposes Heketi service
  21. spec:
  22. ports:
  23. - name: heketi
  24. port: 8080
  25. targetPort: 8080
  26. selector:
  27. glusterfs: heketi-${CLUSTER_NAME}-pod
  28. - kind: Route
  29. apiVersion: v1
  30. metadata:
  31. name: ${HEKETI_ROUTE}
  32. labels:
  33. glusterfs: heketi-${CLUSTER_NAME}-route
  34. heketi: ${CLUSTER_NAME}-route
  35. spec:
  36. to:
  37. kind: Service
  38. name: heketi-${CLUSTER_NAME}
  39. - kind: DeploymentConfig
  40. apiVersion: v1
  41. metadata:
  42. name: heketi-${CLUSTER_NAME}
  43. labels:
  44. glusterfs: heketi-${CLUSTER_NAME}-dc
  45. heketi: ${CLUSTER_NAME}-dc
  46. annotations:
  47. description: Defines how to deploy Heketi
  48. spec:
  49. replicas: 1
  50. selector:
  51. glusterfs: heketi-${CLUSTER_NAME}-pod
  52. triggers:
  53. - type: ConfigChange
  54. strategy:
  55. type: Recreate
  56. template:
  57. metadata:
  58. name: heketi-${CLUSTER_NAME}
  59. labels:
  60. glusterfs: heketi-${CLUSTER_NAME}-pod
  61. heketi: ${CLUSTER_NAME}-pod
  62. spec:
  63. serviceAccountName: heketi-${CLUSTER_NAME}-service-account
  64. containers:
  65. - name: heketi
  66. image: ${IMAGE_NAME}:${IMAGE_VERSION}
  67. imagePullPolicy: IfNotPresent
  68. env:
  69. - name: HEKETI_USER_KEY
  70. value: ${HEKETI_USER_KEY}
  71. - name: HEKETI_ADMIN_KEY
  72. value: ${HEKETI_ADMIN_KEY}
  73. - name: HEKETI_EXECUTOR
  74. value: ${HEKETI_EXECUTOR}
  75. - name: HEKETI_FSTAB
  76. value: ${HEKETI_FSTAB}
  77. - name: HEKETI_SNAPSHOT_LIMIT
  78. value: '14'
  79. - name: HEKETI_KUBE_GLUSTER_DAEMONSET
  80. value: '1'
  81. ports:
  82. - containerPort: 8080
  83. volumeMounts:
  84. - name: db
  85. mountPath: /var/lib/heketi
  86. - name: config
  87. mountPath: /etc/heketi
  88. readinessProbe:
  89. timeoutSeconds: 3
  90. initialDelaySeconds: 3
  91. httpGet:
  92. path: /hello
  93. port: 8080
  94. livenessProbe:
  95. timeoutSeconds: 3
  96. initialDelaySeconds: 30
  97. httpGet:
  98. path: /hello
  99. port: 8080
  100. volumes:
  101. - name: db
  102. glusterfs:
  103. endpoints: heketi-db-${CLUSTER_NAME}-endpoints
  104. path: heketidbstorage
  105. - name: config
  106. secret:
  107. secretName: heketi-${CLUSTER_NAME}-config-secret
  108. parameters:
  109. - name: HEKETI_USER_KEY
  110. displayName: Heketi User Secret
  111. description: Set secret for those creating volumes as type _user_
  112. - name: HEKETI_ADMIN_KEY
  113. displayName: Heketi Administrator Secret
  114. description: Set secret for administration of the Heketi service as user _admin_
  115. - name: HEKETI_EXECUTOR
  116. displayName: heketi executor type
  117. description: Set the executor type, kubernetes or ssh
  118. value: kubernetes
  119. - name: HEKETI_FSTAB
  120. displayName: heketi fstab path
  121. description: Set the fstab path, file that is populated with bricks that heketi creates
  122. value: /var/lib/heketi/fstab
  123. - name: HEKETI_ROUTE
  124. displayName: heketi route name
  125. description: Set the hostname for the route URL
  126. value: "heketi-glusterfs"
  127. - name: IMAGE_NAME
  128. displayName: heketi container image name
  129. required: True
  130. - name: IMAGE_VERSION
  131. displayName: heketi container image version
  132. required: True
  133. - name: CLUSTER_NAME
  134. displayName: GlusterFS cluster name
  135. description: A unique name to identify this heketi service, useful for running multiple heketi instances
  136. value: glusterfs