Skip to content

Add instanceha metrics service#590

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
lmiccini:add-instanceha-metrics-service
May 28, 2026
Merged

Add instanceha metrics service#590
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
lmiccini:add-instanceha-metrics-service

Conversation

@lmiccini

@lmiccini lmiccini commented May 27, 2026

Copy link
Copy Markdown
Contributor

With this commit we add a Kubernetes Service exposing the InstanceHA metrics endpoint (port 8080/TCP) with labels "metrics: enabled" and "service: instanceha" for Prometheus scrapeconfig discovery by telemetry-operator.
We also add an optional MetricsTLS field (tls.SimpleService) to the InstanceHa API, allowing TLS certificate configuration for the metrics endpoint.
With openstack-k8s-operators/openstack-operator#1932 we automatically create the certificate from openstack-operator when podlevel tls is enabled, so the instanceha controller checks if this exists (and the user did not override it via MetricsTLS) and automatically sets the proper field/adds the volume etc.

@openshift-ci openshift-ci Bot requested review from dciabrin and stuggi May 27, 2026 18:30
@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/72ebe139b5834fe0bd94261a1ab6164b

openstack-k8s-operators-content-provider FAILURE in 4m 40s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider

- Add a Kubernetes Service exposing the InstanceHA Prometheus metrics
  endpoint, with labels for automatic discovery by the telemetry
  operator's ScrapeConfig.
- Add MetricsTLS field (tls.SimpleService) to the InstanceHa API,
  allowing TLS certificate configuration for the metrics endpoint.
- Mount TLS certificate secret into the deployment and pass cert/key
  paths via environment variables when MetricsTLS is enabled.
- Validate the MetricsTLS secret in the controller with hash tracking
  for automatic pod rollout on certificate rotation.
- Add field indexer for the metrics TLS secret so the controller
  reconciles on secret changes.
- Update the Python health/metrics server to wrap the HTTP socket with
  TLS when certificate environment variables are present.
- Add RBAC annotation for Services to the InstanceHA controller.
- Add functional tests for the metrics Service creation.
- Update documentation for Prometheus metrics integration.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@lmiccini lmiccini force-pushed the add-instanceha-metrics-service branch from 81fbb18 to 474cf86 Compare May 28, 2026 05:50
Comment thread docs/instanceha_prometheus.md
Comment thread docs/instanceha_prometheus.md
Comment thread templates/instanceha/bin/instanceha.py
@openshift-ci

openshift-ci Bot commented May 28, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dciabrin, lmiccini

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@lmiccini lmiccini removed the request for review from stuggi May 28, 2026 13:20
@openshift-merge-bot openshift-merge-bot Bot merged commit 48b751f into openstack-k8s-operators:main May 28, 2026
7 checks passed
@lmiccini lmiccini deleted the add-instanceha-metrics-service branch May 28, 2026 13:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants