From 4d0e1dec5375ef4ee9dc4b215b8f1e2c5b8b7eb1 Mon Sep 17 00:00:00 2001 From: Pete Birley Date: Wed, 22 Aug 2018 09:08:58 -0500 Subject: [PATCH] Ceilometer: move all config to be driven via chart values This PS moves ceilometer inline with other charts, and drives all config directly from the charts values.yaml. Change-Id: I475302c8be97364e32286b642629e400590ae5f0 Signed-off-by: Pete Birley --- ceilometer/templates/configmap-etc.yaml | 5 +- .../templates/etc/_rally_tests.yaml.tpl | 65 ------------- .../templates/etc/_wsgi-ceilometer.conf.tpl | 42 -------- ceilometer/values.yaml | 95 +++++++++++++++++-- 4 files changed, 90 insertions(+), 117 deletions(-) delete mode 100644 ceilometer/templates/etc/_rally_tests.yaml.tpl delete mode 100644 ceilometer/templates/etc/_wsgi-ceilometer.conf.tpl diff --git a/ceilometer/templates/configmap-etc.yaml b/ceilometer/templates/configmap-etc.yaml index a0773d2fd2..d7d9653be5 100644 --- a/ceilometer/templates/configmap-etc.yaml +++ b/ceilometer/templates/configmap-etc.yaml @@ -112,7 +112,7 @@ metadata: name: ceilometer-etc data: rally_tests.yaml: | -{{- tuple .Values.conf.rally_tests "etc/_rally_tests.yaml.tpl" . | include "helm-toolkit.utils.configmap_templater" }} +{{ toYaml .Values.conf.rally_tests | indent 4 }} ceilometer.conf: | {{ include "helm-toolkit.utils.to_oslo_conf" .Values.conf.ceilometer | indent 4 }} api_paste.ini: | @@ -127,6 +127,5 @@ data: {{ toYaml .Values.conf.event_definitions | indent 4 }} gnocchi_resources.yaml: | {{ toYaml .Values.conf.gnocchi_resources | indent 4 }} - wsgi-ceilometer.conf: | -{{- tuple .Values.conf.wsgi_ceilometer "etc/_wsgi-ceilometer.conf.tpl" . | include "helm-toolkit.utils.configmap_templater" }} +{{- include "helm-toolkit.snippets.values_template_renderer" (dict "envAll" $envAll "template" .Values.conf.wsgi_ceilometer "key" "wsgi-ceilometer.conf" ) | indent 2 }} {{- end }} diff --git a/ceilometer/templates/etc/_rally_tests.yaml.tpl b/ceilometer/templates/etc/_rally_tests.yaml.tpl deleted file mode 100644 index 950eeb22a5..0000000000 --- a/ceilometer/templates/etc/_rally_tests.yaml.tpl +++ /dev/null @@ -1,65 +0,0 @@ ---- -CeilometerStats.create_meter_and_get_stats: - - - args: - user_id: "user-id" - resource_id: "resource-id" - counter_volume: 1.0 - counter_unit: "" - counter_type: "cumulative" - runner: - type: "constant" - times: 1 - concurrency: 1 - sla: - failure_rate: - max: 0 -CeilometerMeters.list_meters: - - - runner: - type: constant - times: 1 - concurrency: 1 - sla: - failure_rate: - max: 0 - context: - ceilometer: - counter_name: "benchmark_meter" - counter_type: "gauge" - counter_unit: "%" - counter_volume: 1 - resources_per_tenant: 1 - samples_per_resource: 1 - timestamp_interval: 10 - metadata_list: - - - status: "active" - name: "rally benchmark on" - deleted: "false" - - - status: "terminated" - name: "rally benchmark off" - deleted: "true" - args: - limit: 5 - metadata_query: - status: "terminated" -CeilometerQueries.create_and_query_samples: - - - args: - filter: {"=": {"counter_unit": "instance"}} - orderby: !!null - limit: 10 - counter_name: "cpu_util" - counter_type: "gauge" - counter_unit: "instance" - counter_volume: 1.0 - resource_id: "resource_id" - runner: - type: "constant" - times: 1 - concurrency: 1 - sla: - failure_rate: - max: 0 diff --git a/ceilometer/templates/etc/_wsgi-ceilometer.conf.tpl b/ceilometer/templates/etc/_wsgi-ceilometer.conf.tpl deleted file mode 100644 index 200f244e7a..0000000000 --- a/ceilometer/templates/etc/_wsgi-ceilometer.conf.tpl +++ /dev/null @@ -1,42 +0,0 @@ -{{/* -Copyright 2017 The Openstack-Helm Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/}} - -Listen 0.0.0.0:{{ tuple "metering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} - -LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined - - - LogLevel info - WSGIDaemonProcess ceilometer-api processes=2 threads=1 user=ceilometer group=ceilometer display-name=%{GROUP} python-path=/var/lib/kolla/venv/lib/python2.7/site-packages - WSGIProcessGroup ceilometer-api - - WSGIScriptReloading On - WSGIScriptAlias / /var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer/api/app.wsgi - - WSGIApplicationGroup %{GLOBAL} - - - = 2.4> - Require all granted - - - Order allow,deny - Allow from all - - - ErrorLog /dev/stdout - CustomLog /dev/stdout combined - diff --git a/ceilometer/values.yaml b/ceilometer/values.yaml index 5e7a12e01f..928903203e 100644 --- a/ceilometer/values.yaml +++ b/ceilometer/values.yaml @@ -1488,14 +1488,95 @@ conf: 'telemetry:get_sample': '' 'telemetry:get_samples': '' 'telemetry:query_sample': '' + wsgi_ceilometer: | + Listen 0.0.0.0:{{ tuple "metering" "internal" "api" . | include "helm-toolkit.endpoints.endpoint_port_lookup" }} + + LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined + + + LogLevel info + WSGIDaemonProcess ceilometer-api processes=2 threads=1 user=ceilometer group=ceilometer display-name=%{GROUP} python-path=/var/lib/kolla/venv/lib/python2.7/site-packages + WSGIProcessGroup ceilometer-api + + WSGIScriptReloading On + WSGIScriptAlias / /var/lib/kolla/venv/lib/python2.7/site-packages/ceilometer/api/app.wsgi + + WSGIApplicationGroup %{GLOBAL} + + + = 2.4> + Require all granted + + + Order allow,deny + Allow from all + + + ErrorLog /dev/stdout + CustomLog /dev/stdout combined + rally_tests: - append: null - metering: - meter_name: ram_util - statistic: avg - threshold: 10 - type: threshold - override: null + CeilometerStats.create_meter_and_get_stats: + - args: + user_id: user-id + resource_id: resource-id + counter_volume: 1 + counter_unit: '' + counter_type: cumulative + runner: + type: constant + times: 1 + concurrency: 1 + sla: + failure_rate: + max: 0 + CeilometerMeters.list_meters: + - runner: + type: constant + times: 1 + concurrency: 1 + sla: + failure_rate: + max: 0 + context: + ceilometer: + counter_name: benchmark_meter + counter_type: gauge + counter_unit: "%" + counter_volume: 1 + resources_per_tenant: 1 + samples_per_resource: 1 + timestamp_interval: 10 + metadata_list: + - status: active + name: rally benchmark on + deleted: 'false' + - status: terminated + name: rally benchmark off + deleted: 'true' + args: + limit: 5 + metadata_query: + status: terminated + CeilometerQueries.create_and_query_samples: + - args: + filter: + "=": + counter_unit: instance + orderby: + limit: 10 + counter_name: cpu_util + counter_type: gauge + counter_unit: instance + counter_volume: 1 + resource_id: resource_id + runner: + type: constant + times: 1 + concurrency: 1 + sla: + failure_rate: + max: 0 dependencies: dynamic: