Skip to content

Comments

feat(clickhouse): load TLS certificate from Kubernetes secret#3929

Draft
jkaflik wants to merge 6 commits intomainfrom
kk/clickhouse-peer-tls-k8s-secret
Draft

feat(clickhouse): load TLS certificate from Kubernetes secret#3929
jkaflik wants to merge 6 commits intomainfrom
kk/clickhouse-peer-tls-k8s-secret

Conversation

@jkaflik
Copy link
Contributor

@jkaflik jkaflik commented Feb 13, 2026

Adds tls_certificate_secret_name ClickHouse config that is used to dynamically load TLS certificate from Kubernetes secret, in a format compatible with cert-manager. (https://cert-manager.io/docs/usage/certificate/)

The feature is gated with PEERDB_CLICKHOUSE_TLS_K8S_SECRET_ENABLED and enabled by default. It can be used to force fallback into an inline certificate.

This comes with a little refactor to the ClickHouse peer's Connect function.

Adds `tls_certificate_secret_name` ClickHouse config that is used to dynamically load TLS certificate from Kubernetes secret, in a format compatible with `cert-manager`. (https://cert-manager.io/docs/usage/certificate/)

Feature is gated with `PEERDB_CLICKHOUSE_TLS_K8S_SECRET_ENABLED` and enabled by default. It enables to force fallback into inline certificate.

This comes with a little refactor to ClickHouse Connect function.
@codecov
Copy link

codecov bot commented Feb 14, 2026

❌ 2 Tests Failed:

Tests completed Failed Passed Skipped
1679 2 1677 163
View the top 2 failed test(s) by shortest run time
github.com/PeerDB-io/peerdb/flow/e2e::TestClickHouseTLSInlineCerts
Stack Traces | 0.03s run time
=== RUN   TestClickHouseTLSInlineCerts
    clickhouse_tls_test.go:88: 
        	Error Trace:	.../flow/e2e/clickhouse_tls_test.go:88
        	Error:      	Received unexpected error:
        	            	clickhouse [ScanRow]: (1) converting UInt8 to *uint64 is unsupported. try using *uint8
        	Test:       	TestClickHouseTLSInlineCerts
        	Messages:   	failed to execute SELECT 1
--- FAIL: TestClickHouseTLSInlineCerts (0.03s)
github.com/PeerDB-io/peerdb/flow/e2e::TestClickHouseTLSK8sSecret
Stack Traces | 0.2s run time
=== RUN   TestClickHouseTLSK8sSecret
2026/02/14 09:32:54 INFO K8s Secret store initialized namespace=test-namespace
    clickhouse_tls_test.go:163: 
        	Error Trace:	.../flow/e2e/clickhouse_tls_test.go:163
        	Error:      	Received unexpected error:
        	            	clickhouse [ScanRow]: (1) converting UInt8 to *uint64 is unsupported. try using *uint8
        	Test:       	TestClickHouseTLSK8sSecret
        	Messages:   	failed to execute SELECT 1
--- FAIL: TestClickHouseTLSK8sSecret (0.20s)

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant