Skip to content

Commit e4a47b2

Browse files
committed
Update kepler version and container template
Update kepler image default version to v0.10.2. The new kepler (starting from 0.10) has completely different set of config options so kepler's template was updated correspondingly. - Removed '-v' option as it's no longer supported. - Added option --config.file to specify a file with settings - There is no longer need to specify desired metrics using environment variables as all metrics are enabled by default. Also changed kepler healthcheck script: - 'healthz' URL path no longer exist, so use 'metrics' instead. - Fetch only headers and status code for healthcheck in order to minimize load. - Removed check for 'ok' in response as it is no longer relevant.
1 parent da4023c commit e4a47b2

File tree

5 files changed

+24
-19
lines changed

5 files changed

+24
-19
lines changed

roles/edpm_telemetry_power_monitoring/defaults/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ edpm_telemetry_image_download_retries: "{{ edpm_download_retries | default(5) }}
3838
edpm_telemetry_old_tripleo_compute_sevices:
3939
- tripleo_ceilometer_agent_ipmi.service
4040
# Image to use for kepler
41-
edpm_telemetry_kepler_image: "quay.io/sustainable_computing_io/kepler:release-0.7.12"
41+
edpm_telemetry_kepler_image: "quay.io/sustainable_computing_io/kepler:v0.10.2"
4242
# Instruction for distribution of container health check scripts
4343
edpm_telemetry_power_monitoring_healthcheck_sources:
4444
ceilometer_agent_ipmi: ceilometer_agent

roles/edpm_telemetry_power_monitoring/files/healthchecks/exporter/healthcheck

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,11 @@
1515
# License for the specific language governing permissions and limitations
1616
# under the License.
1717

18-
URL="http://0.0.0.0:8888/healthz"
18+
URL="http://0.0.0.0:8888/metrics"
1919
TIMEOUT=5 # Timeout in seconds
2020

2121
# Get the HTTP status code and response body using curl
22-
RESPONSE=$(curl -s -w "%{http_code}" $URL --max-time $TIMEOUT)
22+
RESPONSE=$(curl -I -s -w "%{http_code}" $URL --max-time $TIMEOUT)
2323
BODY=${RESPONSE:0:-3} # Extract the body (all but the last 3 characters)
2424
HTTP_CODE=${RESPONSE: -3} # Extract the last 3 characters as the HTTP status code
2525

@@ -29,11 +29,5 @@ if [ "$HTTP_CODE" -ne 200 ]; then
2929
exit 1
3030
fi
3131

32-
# Check if the response body contains "ok"
33-
if [[ "$BODY" != *"ok"* ]]; then
34-
echo "$1 Health check failed: Response body does not contain 'ok'"
35-
exit 1
36-
fi
37-
38-
echo "$1 Health check passed: HTTP status code $HTTP_CODE, Health response 'ok'"
32+
echo "$1 Health check passed: HTTP status code $HTTP_CODE"
3933
exit 0

roles/edpm_telemetry_power_monitoring/tasks/configure.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@
9898
path: "{{ edpm_telemetry_certs }}/tls.key"
9999
register: tls_key_stat
100100

101+
- name: Gather virtualization fact
102+
ansible.builtin.setup:
103+
gather_subset:
104+
- "!all"
105+
- "!min"
106+
- "virtual"
107+
101108
- name: Render container config templates
102109
ansible.builtin.template:
103110
src: "{{ item }}"
@@ -108,6 +115,7 @@
108115
vars:
109116
ca_bundle_exists: "{{ ca_bundle_stat_res.stat.exists }}"
110117
tls_cert_exists: "{{ tls_crt_stat.stat.exists and tls_key_stat.stat.exists }}"
118+
running_in_vm: "{{ ansible_facts['virtualization_role'] == 'guest' }}"
111119

112120
- name: Configure tls if present
113121
when:
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
web:
2+
listenAddresses:
3+
- :8888
4+
{% if running_in_vm|bool %}
5+
# WARN DO NOT ENABLE THIS IN PRODUCTION - for CI testing only
6+
dev:
7+
fake-cpu-meter:
8+
enabled: true
9+
zones: ["package", "core", "dram"]
10+
{% endif %}

roles/edpm_telemetry_power_monitoring/templates/kepler.json.j2

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,16 @@
44
"restart": "always",
55
"ports": ["8888:8888"],
66
"net": "host",
7-
"command": "-v=2",
7+
"command": "--config.file=/etc/kepler/kepler-config.yaml",
88
"recreate": true,
9-
"environment": {
10-
"ENABLE_GPU": "true",
11-
"EXPOSE_CONTAINER_METRICS": "true",
12-
"ENABLE_PROCESS_METRICS": "true",
13-
"EXPOSE_VM_METRICS": "true",
14-
"EXPOSE_ESTIMATED_IDLE_POWER_METRICS": "false",
15-
"LIBVIRT_METADATA_URI": "http://openstack.org/xmlns/libvirt/nova/1.1"
16-
},
179
{% if edpm_telemetry_power_monitoring_healthcheck %}
1810
"healthcheck": {
1911
"test": "/openstack/healthcheck kepler",
2012
"mount": "/var/lib/openstack/healthchecks/kepler"
2113
},
2214
{% endif %}
2315
"volumes": [
16+
"{{ edpm_telemetry_config_dest }}/kepler-config.yaml:/etc/kepler/kepler-config.yaml:ro",
2417
"/lib/modules:/lib/modules:ro",
2518
"/run/libvirt:/run/libvirt:shared,ro",
2619
"/sys:/sys",

0 commit comments

Comments
 (0)