glusterblock-provisioner.yml 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. ---
  2. kind: Template
  3. apiVersion: v1
  4. metadata:
  5. name: glusterblock-provisioner
  6. labels:
  7. glusterfs: block-template
  8. glusterblock: template
  9. annotations:
  10. description: glusterblock provisioner template
  11. tags: glusterfs
  12. objects:
  13. - kind: ClusterRole
  14. apiVersion: v1
  15. metadata:
  16. name: glusterblock-provisioner-runner
  17. labels:
  18. glusterfs: block-provisioner-runner-clusterrole
  19. glusterblock: provisioner-runner-clusterrole
  20. rules:
  21. - apiGroups: [""]
  22. resources: ["persistentvolumes"]
  23. verbs: ["get", "list", "watch", "create", "delete"]
  24. - apiGroups: [""]
  25. resources: ["persistentvolumeclaims"]
  26. verbs: ["get", "list", "watch", "update"]
  27. - apiGroups: ["storage.k8s.io"]
  28. resources: ["storageclasses"]
  29. verbs: ["get", "list", "watch"]
  30. - apiGroups: [""]
  31. resources: ["events"]
  32. verbs: ["list", "watch", "create", "update", "patch"]
  33. - apiGroups: [""]
  34. resources: ["services"]
  35. verbs: ["get"]
  36. - apiGroups: [""]
  37. resources: ["secrets"]
  38. verbs: ["get", "create", "delete"]
  39. - apiGroups: [""]
  40. resources: ["routes"]
  41. verbs: ["get", "list"]
  42. - apiVersion: v1
  43. kind: ServiceAccount
  44. metadata:
  45. name: glusterblock-${CLUSTER_NAME}-provisioner
  46. labels:
  47. glusterfs: block-${CLUSTER_NAME}-provisioner-sa
  48. glusterblock: ${CLUSTER_NAME}-provisioner-sa
  49. - apiVersion: v1
  50. kind: ClusterRoleBinding
  51. metadata:
  52. name: glusterblock-${CLUSTER_NAME}-provisioner
  53. roleRef:
  54. name: glusterblock-provisioner-runner
  55. subjects:
  56. - kind: ServiceAccount
  57. name: glusterblock-${CLUSTER_NAME}-provisioner
  58. namespace: ${NAMESPACE}
  59. - kind: DeploymentConfig
  60. apiVersion: v1
  61. metadata:
  62. name: glusterblock-${CLUSTER_NAME}-provisioner-dc
  63. labels:
  64. glusterfs: block-${CLUSTER_NAME}-provisioner-dc
  65. glusterblock: ${CLUSTER_NAME}-provisioner-dc
  66. annotations:
  67. description: Defines how to deploy the glusterblock provisioner pod.
  68. spec:
  69. replicas: 1
  70. selector:
  71. glusterfs: block-${CLUSTER_NAME}-provisioner-pod
  72. triggers:
  73. - type: ConfigChange
  74. strategy:
  75. type: Recreate
  76. template:
  77. metadata:
  78. name: glusterblock-provisioner
  79. labels:
  80. glusterfs: block-${CLUSTER_NAME}-provisioner-pod
  81. spec:
  82. serviceAccountName: glusterblock-${CLUSTER_NAME}-provisioner
  83. containers:
  84. - name: glusterblock-provisioner
  85. image: ${IMAGE_NAME}:${IMAGE_VERSION}
  86. imagePullPolicy: IfNotPresent
  87. env:
  88. - name: PROVISIONER_NAME
  89. value: gluster.org/glusterblock
  90. parameters:
  91. - name: IMAGE_NAME
  92. displayName: glusterblock provisioner container image name
  93. required: True
  94. - name: IMAGE_VERSION
  95. displayName: glusterblock provisioner container image version
  96. required: True
  97. - name: NAMESPACE
  98. displayName: glusterblock provisioner namespace
  99. description: The namespace in which these resources are being created
  100. required: True
  101. - name: CLUSTER_NAME
  102. displayName: GlusterFS cluster name
  103. description: A unique name to identify which heketi service manages this cluster, useful for running multiple heketi instances
  104. value: storage