hawkular_metrics_rc.j2 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121
  1. apiVersion: v1
  2. kind: ReplicationController
  3. metadata:
  4. name: hawkular-metrics
  5. labels:
  6. metrics-infra: hawkular-metrics
  7. name: hawkular-metrics
  8. spec:
  9. selector:
  10. name: hawkular-metrics
  11. replicas: {{replica_count}}
  12. template:
  13. version: v1
  14. metadata:
  15. labels:
  16. metrics-infra: hawkular-metrics
  17. name: hawkular-metrics
  18. spec:
  19. serviceAccount: hawkular
  20. containers:
  21. - image: {{openshift_metrics_image_prefix}}metrics-hawkular-metrics:{{openshift_metrics_image_version}}
  22. name: hawkular-metrics
  23. ports:
  24. - name: http-endpoint
  25. containerPort: 8080
  26. - name: https-endpoint
  27. containerPort: 8443
  28. - name: ping
  29. containerPort: 8888
  30. command:
  31. - "/opt/hawkular/scripts/hawkular-metrics-wrapper.sh"
  32. - "-b"
  33. - 0.0.0.0
  34. - "-Dhawkular.metrics.cassandra.nodes=hawkular-cassandra"
  35. - "-Dhawkular.metrics.cassandra.use-ssl"
  36. - "-Dhawkular.metrics.openshift.auth-methods=openshift-oauth,htpasswd"
  37. - "-Dhawkular.metrics.openshift.htpasswd-file=/secrets/hawkular-metrics.htpasswd.file"
  38. - "-Dhawkular.metrics.allowed-cors-access-control-allow-headers=authorization"
  39. - "-Dhawkular.metrics.default-ttl={{openshift_metrics_duration}}"
  40. - "-Dhawkular.metrics.admin-tenant=_hawkular_admin"
  41. - "-Dhawkular-alerts.cassandra-nodes=hawkular-cassandra"
  42. - "-Dhawkular-alerts.cassandra-use-ssl"
  43. - "-Dhawkular.alerts.openshift.auth-methods=openshift-oauth,htpasswd"
  44. - "-Dhawkular.alerts.openshift.htpasswd-file=/secrets/hawkular-metrics.htpasswd.file"
  45. - "-Dhawkular.alerts.allowed-cors-access-control-allow-headers=authorization"
  46. - "-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
  47. - "-Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true"
  48. - "-Dcom.datastax.driver.FORCE_NIO=true"
  49. - "-DKUBERNETES_MASTER_URL={{openshift_metrics_master_url}}"
  50. - "-DUSER_WRITE_ACCESS={{openshift_metrics_hawkular_user_write_access}}"
  51. - "--hmw.keystore=/secrets/hawkular-metrics.keystore"
  52. - "--hmw.truststore=/secrets/hawkular-metrics.truststore"
  53. - "--hmw.keystore_password_file=/secrets/hawkular-metrics.keystore.password"
  54. - "--hmw.truststore_password_file=/secrets/hawkular-metrics.truststore.password"
  55. - "--hmw.jgroups_keystore=/secrets/hawkular-metrics.jgroups.keystore"
  56. - "--hmw.jgroups_keystore_password_file=/secrets/hawkular-metrics.jgroups.keystore.password"
  57. - "--hmw.jgroups_alias_file=/secrets/hawkular-metrics.jgroups.alias"
  58. env:
  59. - name: POD_NAMESPACE
  60. valueFrom:
  61. fieldRef:
  62. fieldPath: metadata.namespace
  63. - name: MASTER_URL
  64. value: "{{ openshift_metrics_master_url }}"
  65. - name: OPENSHIFT_KUBE_PING_NAMESPACE
  66. valueFrom:
  67. fieldRef:
  68. fieldPath: metadata.namespace
  69. - name: OPENSHIFT_KUBE_PING_LABELS
  70. value: "metrics-infra=hawkular-metrics,name=hawkular-metrics"
  71. - name: STARTUP_TIMEOUT
  72. value: "{{ openshift_metrics_startup_timeout }}"
  73. volumeMounts:
  74. - name: hawkular-metrics-secrets
  75. mountPath: "/secrets"
  76. - name: hawkular-metrics-client-secrets
  77. mountPath: "/client-secrets"
  78. {% if ((openshift_metrics_hawkular_limits_cpu is defined and openshift_metrics_hawkular_limits_cpu is not none)
  79. or (openshift_metrics_hawkular_limits_memory is defined and openshift_metrics_hawkular_limits_memory is not none)
  80. or (openshift_metrics_hawkular_requests_cpu is defined and openshift_metrics_hawkular_requests_cpu is not none)
  81. or (openshift_metrics_hawkular_requests_memory is defined and openshift_metrics_hawkular_requests_memory is not none))
  82. %}
  83. resources:
  84. {% if (openshift_metrics_hawkular_limits_cpu is not none
  85. or openshift_metrics_hawkular_limits_memory is not none)
  86. %}
  87. limits:
  88. {% if openshift_metrics_hawkular_limits_cpu is not none %}
  89. cpu: "{{openshift_metrics_hawkular_limits_cpu}}"
  90. {% endif %}
  91. {% if openshift_metrics_hawkular_limits_memory is not none %}
  92. memory: "{{openshift_metrics_hawkular_limits_memory}}"
  93. {% endif %}
  94. {% endif %}
  95. {% if (openshift_metrics_hawkular_requests_cpu is not none
  96. or openshift_metrics_hawkular_requests_memory is not none)
  97. %}
  98. requests:
  99. {% if openshift_metrics_hawkular_requests_cpu is not none %}
  100. cpu: "{{openshift_metrics_hawkular_requests_cpu}}"
  101. {% endif %}
  102. {% if openshift_metrics_hawkular_requests_memory is not none %}
  103. memory: "{{openshift_metrics_hawkular_requests_memory}}"
  104. {% endif %}
  105. {% endif %}
  106. {% endif %}
  107. readinessProbe:
  108. exec:
  109. command:
  110. - "/opt/hawkular/scripts/hawkular-metrics-readiness.py"
  111. livenessProbe:
  112. exec:
  113. command:
  114. - "/opt/hawkular/scripts/hawkular-metrics-liveness.py"
  115. volumes:
  116. - name: hawkular-metrics-secrets
  117. secret:
  118. secretName: hawkular-metrics-secrets
  119. - name: hawkular-metrics-client-secrets
  120. secret:
  121. secretName: hawkular-metrics-account