heketi-template.yml 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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}
  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. - name: HEKETI_IGNORE_STALE_OPERATIONS
  82. value: "true"
  83. ports:
  84. - containerPort: 8080
  85. volumeMounts:
  86. - name: db
  87. mountPath: /var/lib/heketi
  88. - name: config
  89. mountPath: /etc/heketi
  90. readinessProbe:
  91. timeoutSeconds: 3
  92. initialDelaySeconds: 3
  93. httpGet:
  94. path: /hello
  95. port: 8080
  96. livenessProbe:
  97. timeoutSeconds: 3
  98. initialDelaySeconds: 30
  99. httpGet:
  100. path: /hello
  101. port: 8080
  102. volumes:
  103. - name: db
  104. glusterfs:
  105. endpoints: heketi-db-${CLUSTER_NAME}-endpoints
  106. path: heketidbstorage
  107. - name: config
  108. secret:
  109. secretName: heketi-${CLUSTER_NAME}-config-secret
  110. parameters:
  111. - name: HEKETI_USER_KEY
  112. displayName: Heketi User Secret
  113. description: Set secret for those creating volumes as type _user_
  114. - name: HEKETI_ADMIN_KEY
  115. displayName: Heketi Administrator Secret
  116. description: Set secret for administration of the Heketi service as user _admin_
  117. - name: HEKETI_EXECUTOR
  118. displayName: heketi executor type
  119. description: Set the executor type, kubernetes or ssh
  120. value: kubernetes
  121. - name: HEKETI_FSTAB
  122. displayName: heketi fstab path
  123. description: Set the fstab path, file that is populated with bricks that heketi creates
  124. value: /var/lib/heketi/fstab
  125. - name: HEKETI_ROUTE
  126. displayName: heketi route name
  127. description: Set the hostname for the route URL
  128. value: "heketi-glusterfs"
  129. - name: IMAGE_NAME
  130. displayName: heketi container image name
  131. required: True
  132. - name: CLUSTER_NAME
  133. displayName: GlusterFS cluster name
  134. description: A unique name to identify this heketi service, useful for running multiple heketi instances
  135. value: glusterfs