metrics-deployer.yaml 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. #!/bin/bash
  2. #
  3. # Copyright 2014-2015 Red Hat, Inc. and/or its affiliates
  4. # and other contributors as indicated by the @author tags.
  5. #
  6. # Licensed under the Apache License, Version 2.0 (the "License");
  7. # you may not use this file except in compliance with the License.
  8. # You may obtain a copy of the License at
  9. #
  10. # http://www.apache.org/licenses/LICENSE-2.0
  11. #
  12. # Unless required by applicable law or agreed to in writing, software
  13. # distributed under the License is distributed on an "AS IS" BASIS,
  14. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  15. # See the License for the specific language governing permissions and
  16. # limitations under the License.
  17. #
  18. apiVersion: "v1"
  19. kind: "Template"
  20. metadata:
  21. name: metrics-deployer-template
  22. annotations:
  23. description: "Template for deploying the required Metrics integration. Requires cluster-admin 'metrics-deployer' service account and 'metrics-deployer' secret."
  24. tags: "infrastructure"
  25. labels:
  26. metrics-infra: deployer
  27. provider: openshift
  28. component: deployer
  29. objects:
  30. -
  31. apiVersion: v1
  32. kind: Pod
  33. metadata:
  34. generateName: metrics-deployer-
  35. spec:
  36. containers:
  37. - image: ${IMAGE_PREFIX}metrics-deployer:${IMAGE_VERSION}
  38. name: deployer
  39. volumeMounts:
  40. - name: secret
  41. mountPath: /secret
  42. readOnly: true
  43. - name: empty
  44. mountPath: /etc/deploy
  45. env:
  46. - name: PROJECT
  47. valueFrom:
  48. fieldRef:
  49. fieldPath: metadata.namespace
  50. - name: IMAGE_PREFIX
  51. value: ${IMAGE_PREFIX}
  52. - name: IMAGE_VERSION
  53. value: ${IMAGE_VERSION}
  54. - name: MASTER_URL
  55. value: ${MASTER_URL}
  56. - name: MODE
  57. value: ${MODE}
  58. - name: REDEPLOY
  59. value: ${REDEPLOY}
  60. - name: IGNORE_PREFLIGHT
  61. value: ${IGNORE_PREFLIGHT}
  62. - name: USE_PERSISTENT_STORAGE
  63. value: ${USE_PERSISTENT_STORAGE}
  64. - name: HAWKULAR_METRICS_HOSTNAME
  65. value: ${HAWKULAR_METRICS_HOSTNAME}
  66. - name: CASSANDRA_NODES
  67. value: ${CASSANDRA_NODES}
  68. - name: CASSANDRA_PV_SIZE
  69. value: ${CASSANDRA_PV_SIZE}
  70. - name: METRIC_DURATION
  71. value: ${METRIC_DURATION}
  72. - name: HEAPSTER_NODE_ID
  73. value: ${HEAPSTER_NODE_ID}
  74. - name: METRIC_RESOLUTION
  75. value: ${METRIC_RESOLUTION}
  76. dnsPolicy: ClusterFirst
  77. restartPolicy: Never
  78. serviceAccount: metrics-deployer
  79. volumes:
  80. - name: empty
  81. emptyDir: {}
  82. - name: secret
  83. secret:
  84. secretName: metrics-deployer
  85. parameters:
  86. -
  87. description: 'Specify prefix for metrics components; e.g. for "openshift/origin-metrics-deployer:latest", set prefix "openshift/origin-"'
  88. name: IMAGE_PREFIX
  89. value: "openshift/origin-"
  90. -
  91. description: 'Specify version for metrics components; e.g. for "openshift/origin-metrics-deployer:latest", set version "latest"'
  92. name: IMAGE_VERSION
  93. value: "latest"
  94. -
  95. description: "Internal URL for the master, for authentication retrieval"
  96. name: MASTER_URL
  97. value: "https://kubernetes.default.svc:443"
  98. -
  99. description: "External hostname where clients will reach Hawkular Metrics"
  100. name: HAWKULAR_METRICS_HOSTNAME
  101. required: true
  102. -
  103. description: "Can be set to: 'preflight' to perform validation before a deployment; 'deploy' to perform an initial deployment; 'refresh' to delete and redeploy all components but to keep persisted data and routes; 'redeploy' to delete and redeploy everything (losing all data in the process); 'validate' to re-run validations after a deployment"
  104. name: MODE
  105. value: "deploy"
  106. -
  107. description: "(Deprecated) Turns 'deploy' mode into 'redeploy' mode, deleting and redeploying everything (losing all data in the process)"
  108. name: REDEPLOY
  109. value: "false"
  110. -
  111. description: "If preflight validation is blocking deployment and you're sure you don't care about it, this will ignore the results and proceed to deploy."
  112. name: IGNORE_PREFLIGHT
  113. value: "false"
  114. -
  115. description: "Set to true for persistent storage, set to false to use non persistent storage"
  116. name: USE_PERSISTENT_STORAGE
  117. value: "true"
  118. -
  119. description: "The number of Cassandra Nodes to deploy for the initial cluster"
  120. name: CASSANDRA_NODES
  121. value: "1"
  122. -
  123. description: "The persistent volume size for each of the Cassandra nodes"
  124. name: CASSANDRA_PV_SIZE
  125. value: "10Gi"
  126. -
  127. description: "How many days metrics should be stored for."
  128. name: METRIC_DURATION
  129. value: "7"
  130. -
  131. description: "The identifier used when generating metric ids in Hawkular"
  132. name: HEAPSTER_NODE_ID
  133. value: "nodename"
  134. -
  135. description: "How often metrics should be gathered. Defaults value of '10s' for 10 seconds"
  136. name: METRIC_RESOLUTION
  137. value: "10s"