summaryrefslogtreecommitdiffstats
path: root/roles/openshift_metrics/templates
diff options
context:
space:
mode:
authorJeff Cantrill <jcantrill@users.noreply.github.com>2016-12-15 15:46:10 -0500
committerJeff Cantrill <jcantril@redhat.com>2017-01-17 11:45:04 -0500
commitb335bd4e88d5ec50aa3106f789f4e08a8baac9b2 (patch)
tree130b5a1ed5cb5d40cc7226b4426073c71b82de65 /roles/openshift_metrics/templates
parent9d0b2eed6f2b897280660949d12e09a3b7993b2b (diff)
downloadopenshift-b335bd4e88d5ec50aa3106f789f4e08a8baac9b2.tar.gz
openshift-b335bd4e88d5ec50aa3106f789f4e08a8baac9b2.tar.bz2
openshift-b335bd4e88d5ec50aa3106f789f4e08a8baac9b2.tar.xz
openshift-b335bd4e88d5ec50aa3106f789f4e08a8baac9b2.zip
allow definition of cpu/memory limits/resources (#11)
Diffstat (limited to 'roles/openshift_metrics/templates')
-rw-r--r--roles/openshift_metrics/templates/hawkular_cassandra_rc.j229
-rw-r--r--roles/openshift_metrics/templates/hawkular_metrics_rc.j229
-rw-r--r--roles/openshift_metrics/templates/heapster.j229
3 files changed, 87 insertions, 0 deletions
diff --git a/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2 b/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
index 7cea5f040..7ce1a6a87 100644
--- a/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
+++ b/roles/openshift_metrics/templates/hawkular_cassandra_rc.j2
@@ -69,6 +69,35 @@ spec:
mountPath: "/cassandra_data"
- name: hawkular-cassandra-secrets
mountPath: "/secret"
+{% if ((openshift_metrics_cassandra_limits_cpu is defined and openshift_metrics_cassandra_limits_cpu is not none)
+ or (openshift_metrics_cassandra_limits_memory is defined and openshift_metrics_cassandra_limits_memory is not none)
+ or (openshift_metrics_cassandra_requests_cpu is defined and openshift_metrics_cassandra_requests_cpu is not none)
+ or (openshift_metrics_cassandra_requests_memory is defined and openshift_metrics_cassandra_requests_memory is not none))
+%}
+ resources:
+{% if (openshift_metrics_cassandra_limits_cpu is not none
+ or openshift_metrics_cassandra_limits_memory is not none)
+%}
+ limits:
+{% if openshift_metrics_cassandra_limits_cpu is not none %}
+ cpu: "{{openshift_metrics_cassandra_limits_cpu}}"
+{% endif %}
+{% if openshift_metrics_cassandra_limits_memory is not none %}
+ memory: "{{openshift_metrics_cassandra_limits_memory}}"
+{% endif %}
+{% endif %}
+{% if (openshift_metrics_cassandra_requests_cpu is not none
+ or openshift_metrics_cassandra_requests_memory is not none)
+%}
+ requests:
+{% if openshift_metrics_cassandra_requests_cpu is not none %}
+ cpu: "{{openshift_metrics_cassandra_requests_cpu}}"
+{% endif %}
+{% if openshift_metrics_cassandra_requests_memory is not none %}
+ memory: "{{openshift_metrics_cassandra_requests_memory}}"
+{% endif %}
+{% endif %}
+{% endif %}
readinessProbe:
exec:
command:
diff --git a/roles/openshift_metrics/templates/hawkular_metrics_rc.j2 b/roles/openshift_metrics/templates/hawkular_metrics_rc.j2
index 647a4bfbb..4314800a3 100644
--- a/roles/openshift_metrics/templates/hawkular_metrics_rc.j2
+++ b/roles/openshift_metrics/templates/hawkular_metrics_rc.j2
@@ -73,6 +73,35 @@ spec:
mountPath: "/secrets"
- name: hawkular-metrics-client-secrets
mountPath: "/client-secrets"
+{% 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:
diff --git a/roles/openshift_metrics/templates/heapster.j2 b/roles/openshift_metrics/templates/heapster.j2
index 90227db68..04fb76982 100644
--- a/roles/openshift_metrics/templates/heapster.j2
+++ b/roles/openshift_metrics/templates/heapster.j2
@@ -42,6 +42,35 @@ spec:
env:
- name: STARTUP_TIMEOUT
value: "{{ openshift_metrics_startup_timeout }}"
+{% if ((openshift_metrics_heapster_limits_cpu is defined and openshift_metrics_heapster_limits_cpu is not none)
+ or (openshift_metrics_heapster_limits_memory is defined and openshift_metrics_heapster_limits_memory is not none)
+ or (openshift_metrics_heapster_requests_cpu is defined and openshift_metrics_heapster_requests_cpu is not none)
+ or (openshift_metrics_heapster_requests_memory is defined and openshift_metrics_heapster_requests_memory is not none))
+%}
+ resources:
+{% if (openshift_metrics_heapster_limits_cpu is not none
+ or openshift_metrics_heapster_limits_memory is not none)
+%}
+ limits:
+{% if openshift_metrics_heapster_limits_cpu is not none %}
+ cpu: "{{openshift_metrics_heapster_limits_cpu}}"
+{% endif %}
+{% if openshift_metrics_heapster_limits_memory is not none %}
+ memory: "{{openshift_metrics_heapster_limits_memory}}"
+{% endif %}
+{% endif %}
+{% if (openshift_metrics_heapster_requests_cpu is not none
+ or openshift_metrics_heapster_requests_memory is not none)
+%}
+ requests:
+{% if openshift_metrics_heapster_requests_cpu is not none %}
+ cpu: "{{openshift_metrics_heapster_requests_cpu}}"
+{% endif %}
+{% if openshift_metrics_heapster_requests_memory is not none %}
+ memory: "{{openshift_metrics_heapster_requests_memory}}"
+{% endif %}
+{% endif %}
+{% endif %}
volumeMounts:
- name: heapster-secrets
mountPath: "/secrets"