123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128 |
- apiVersion: v1
- kind: ReplicationController
- metadata:
- name: hawkular-metrics
- labels:
- metrics-infra: hawkular-metrics
- name: hawkular-metrics
- spec:
- selector:
- name: hawkular-metrics
- replicas: {{replica_count}}
- template:
- version: v1
- metadata:
- labels:
- metrics-infra: hawkular-metrics
- name: hawkular-metrics
- spec:
- serviceAccount: hawkular
- {% if node_selector is iterable and node_selector | length > 0 %}
- nodeSelector:
- {% for key, value in node_selector.items() %}
- {{key}}: "{{value}}"
- {% endfor %}
- {% endif %}
- containers:
- - image: {{openshift_metrics_image_prefix}}metrics-hawkular-metrics:{{openshift_metrics_image_version}}
- imagePullPolicy: IfNotPresent
- name: hawkular-metrics
- ports:
- - name: http-endpoint
- containerPort: 8080
- - name: https-endpoint
- containerPort: 8443
- - name: ping
- containerPort: 8888
- command:
- - "/opt/hawkular/scripts/hawkular-metrics-wrapper.sh"
- - "-b"
- - 0.0.0.0
- - "-Dhawkular.metrics.cassandra.nodes=hawkular-cassandra"
- - "-Dhawkular.metrics.cassandra.use-ssl"
- - "-Dhawkular.metrics.openshift.auth-methods=openshift-oauth,htpasswd"
- - "-Dhawkular.metrics.openshift.htpasswd-file=/hawkular-account/hawkular-metrics.htpasswd"
- - "-Dhawkular.metrics.allowed-cors-access-control-allow-headers=authorization"
- - "-Dhawkular.metrics.default-ttl={{openshift_metrics_duration}}"
- - "-Dhawkular.metrics.admin-tenant=_hawkular_admin"
- - "-Dhawkular-alerts.cassandra-nodes=hawkular-cassandra"
- - "-Dhawkular-alerts.cassandra-use-ssl"
- - "-Dhawkular.alerts.openshift.auth-methods=openshift-oauth,htpasswd"
- - "-Dhawkular.alerts.openshift.htpasswd-file=/hawkular-account/hawkular-metrics.htpasswd"
- - "-Dhawkular.alerts.allowed-cors-access-control-allow-headers=authorization"
- - "-Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true"
- - "-Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true"
- - "-Dcom.datastax.driver.FORCE_NIO=true"
- - "-DKUBERNETES_MASTER_URL={{openshift_metrics_master_url}}"
- - "-DUSER_WRITE_ACCESS={{openshift_metrics_hawkular_user_write_access}}"
- - "-Dhawkular.metrics.jmx-reporting-enabled"
- env:
- - name: POD_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- - name: MASTER_URL
- value: "{{ openshift_metrics_master_url }}"
- - name: JGROUPS_PASSWORD
- value: "{{ 17 | oo_random_word }}"
- - name: TRUSTSTORE_AUTHORITIES
- value: "/hawkular-metrics-certs/tls.truststore.crt"
- - name: ENABLE_PROMETHEUS_ENDPOINT
- value: "{{ openshift_metrics_hawkular_enable_prometheus_endpoint }}"
- - name: OPENSHIFT_KUBE_PING_NAMESPACE
- valueFrom:
- fieldRef:
- fieldPath: metadata.namespace
- - name: OPENSHIFT_KUBE_PING_LABELS
- value: "metrics-infra=hawkular-metrics,name=hawkular-metrics"
- - name: STARTUP_TIMEOUT
- value: "{{ openshift_metrics_startup_timeout }}"
- volumeMounts:
- - name: hawkular-metrics-certs
- mountPath: "/hawkular-metrics-certs"
- - name: hawkular-metrics-account
- mountPath: "/hawkular-account"
- {% if ((openshift_metrics_hawkular_limits_cpu is defined and openshift_metrics_hawkular_limits_cpu is not none)
- or (openshift_metrics_hawkular_limits_memory is defined and openshift_metrics_hawkular_limits_memory is not none)
- or (openshift_metrics_hawkular_requests_cpu is defined and openshift_metrics_hawkular_requests_cpu is not none)
- or (openshift_metrics_hawkular_requests_memory is defined and openshift_metrics_hawkular_requests_memory is not none))
- %}
- resources:
- {% if (openshift_metrics_hawkular_limits_cpu is not none
- or openshift_metrics_hawkular_limits_memory is not none)
- %}
- limits:
- {% if openshift_metrics_hawkular_limits_cpu is not none %}
- cpu: "{{openshift_metrics_hawkular_limits_cpu}}"
- {% endif %}
- {% if openshift_metrics_hawkular_limits_memory is not none %}
- memory: "{{openshift_metrics_hawkular_limits_memory}}"
- {% endif %}
- {% endif %}
- {% if (openshift_metrics_hawkular_requests_cpu is not none
- or openshift_metrics_hawkular_requests_memory is not none)
- %}
- requests:
- {% if openshift_metrics_hawkular_requests_cpu is not none %}
- cpu: "{{openshift_metrics_hawkular_requests_cpu}}"
- {% endif %}
- {% if openshift_metrics_hawkular_requests_memory is not none %}
- memory: "{{openshift_metrics_hawkular_requests_memory}}"
- {% endif %}
- {% endif %}
- {% endif %}
- readinessProbe:
- exec:
- command:
- - "/opt/hawkular/scripts/hawkular-metrics-readiness.py"
- livenessProbe:
- exec:
- command:
- - "/opt/hawkular/scripts/hawkular-metrics-liveness.py"
- volumes:
- - name: hawkular-metrics-certs
- secret:
- secretName: hawkular-metrics-certs
- - name: hawkular-metrics-account
- secret:
- secretName: hawkular-metrics-account
|