feat: add support for external ClickHouse instances#54
Open
guidev wants to merge 4 commits into
Open
Conversation
Allow using an external ClickHouse instance (e.g. ClickHouse Cloud) instead of the bundled Helm-managed ClickHouse backed by EFS. This eliminates the need for EFS (~$400/month) for ClickHouse's write-heavy workload. When `clickhouse_deploy = false`, all EFS and ClickHouse PV resources are skipped, and the Helm chart is configured to connect to the external instance. Setting `clickhouse_deploy = true` (default) preserves existing behavior with zero breaking changes. New variables: clickhouse_deploy, clickhouse_host, clickhouse_http_port, clickhouse_native_port, clickhouse_database, clickhouse_user, clickhouse_password, clickhouse_ssl, clickhouse_cluster_enabled. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Steffen911
reviewed
Apr 28, 2026
Without these, upgrading an existing deployment would destroy and recreate the EFS file system (losing ClickHouse data), the random ClickHouse password (breaking auth), and related IAM/SG resources when their addresses gain a [0] index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
clickhouse_deployvariable (defaulttrue) to toggle between bundled and external ClickHouseclickhouse_deploy = false, skip all EFS and ClickHouse PV/access point resources, and configure the Helm chart to connect to an external ClickHouse instanceclickhouse_host,clickhouse_http_port,clickhouse_native_port,clickhouse_database,clickhouse_user,clickhouse_password,clickhouse_ssl,clickhouse_cluster_enabledclickhouse_deployclickhouse_deploy = truecontinue to work identicallyMotivation
The bundled ClickHouse deployment uses EFS for persistent storage, which incurs ~$400/month due to ClickHouse's write-heavy I/O patterns. Using an external ClickHouse instance (e.g. ClickHouse Cloud) eliminates the need for EFS entirely, significantly reducing costs while improving ClickHouse performance.
Test plan
terraform validatepassesterraform planwithclickhouse_deploy = true(default) shows no resource additions or deletions — only cosmetic Helm values restructuring and automatic[0]index movesterraform planwithclickhouse_deploy = false+ external ClickHouse vars shows EFS/ClickHouse resources removed and Helm values updatedclickhouse_deploy = trueon a live deployment confirming backward compatibility🤖 Generated with Claude Code