Skip to content

fix(helm): derive metrics Certificate dnsNames from resourceName helper - #291

Open
kazuki-ma wants to merge 1 commit into
ClickHouse:mainfrom
kazuki-ma:fix/metrics-certs-dnsnames
Open

fix(helm): derive metrics Certificate dnsNames from resourceName helper#291
kazuki-ma wants to merge 1 commit into
ClickHouse:mainfrom
kazuki-ma:fix/metrics-certs-dnsnames

Conversation

@kazuki-ma

Copy link
Copy Markdown

Why

The metrics Certificate hardcoded its dnsNames as clickhouse-operator-metrics-service while the metrics Service and the ServiceMonitor's tlsConfig.serverName are rendered through the clickhouse-operator.resourceName helper. With any release name other than the default fullname the SAN never matched and secure scraping failed x509 verification (insecureSkipVerify: false when certManager is enabled).

What

Replaced the two hardcoded dnsNames entries in dist/chart/templates/cert-manager/metrics-certs.yaml with the same clickhouse-operator.resourceName helper (suffix metrics-service) that the metrics Service and the ServiceMonitor already use, so the certificate SANs always follow the rendered Service name.

Verified with helm template myrelease ./dist/chart --namespace demo --set prometheus.enabled=true --set certManager.enabled=true --set metrics.enabled=true --set metrics.secure=true: the Certificate dnsNames and the ServiceMonitor serverName now both render myrelease-clickhouse-operator-metrics-service.demo.svc.

Related Issues

Fixes #290

The metrics Certificate hardcoded its dnsNames as
clickhouse-operator-metrics-service while the metrics Service and the
ServiceMonitor's tlsConfig.serverName are rendered through the
clickhouse-operator.resourceName helper. With any release name other
than the default fullname the SAN never matched and secure scraping
failed x509 verification.

Fixes ClickHouse#290

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants