blob: 401db4e5890a57b6e3f929ead539c015bc8c64c3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
|
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.iteritems() %}
{{key}}: "{{value}}"
{% endfor %}
{% endif %}
containers:
- image: {{openshift_metrics_image_prefix}}metrics-hawkular-metrics:{{openshift_metrics_image_version}}
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}}"
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: 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
|