Skip to content

Commit 9a9b1ad

Browse files
committed
dev: refactor merge #930 add Root CA
2 parents 0e4ee70 + 4880065 commit 9a9b1ad

18 files changed

+57
-12
lines changed

deploy/operator/clickhouse-operator-install-ansible.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,9 @@ spec:
28472847
password:
28482848
type: string
28492849
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2850+
rootCA:
2851+
type: string
2852+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28502853
secret:
28512854
type: object
28522855
properties:

deploy/operator/clickhouse-operator-install-bundle-v1beta1.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,9 @@ spec:
28122812
password:
28132813
type: string
28142814
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2815+
rootCA:
2816+
type: string
2817+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28152818
secret:
28162819
type: object
28172820
properties:

deploy/operator/clickhouse-operator-install-bundle.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,9 @@ spec:
28402840
password:
28412841
type: string
28422842
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2843+
rootCA:
2844+
type: string
2845+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28432846
secret:
28442847
type: object
28452848
properties:

deploy/operator/clickhouse-operator-install-template-v1beta1.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2812,6 +2812,9 @@ spec:
28122812
password:
28132813
type: string
28142814
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2815+
rootCA:
2816+
type: string
2817+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28152818
secret:
28162819
type: object
28172820
properties:

deploy/operator/clickhouse-operator-install-template.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,9 @@ spec:
28402840
password:
28412841
type: string
28422842
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2843+
rootCA:
2844+
type: string
2845+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28432846
secret:
28442847
type: object
28452848
properties:

deploy/operator/clickhouse-operator-install-tf.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2847,6 +2847,9 @@ spec:
28472847
password:
28482848
type: string
28492849
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2850+
rootCA:
2851+
type: string
2852+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28502853
secret:
28512854
type: object
28522855
properties:

deploy/operator/parts/crd.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2840,6 +2840,9 @@ spec:
28402840
password:
28412841
type: string
28422842
description: "ClickHouse password to be used by operator to connect to ClickHouse instances, deprecated, use chCredentialsSecretName"
2843+
rootCA:
2844+
type: string
2845+
description: "Root certificate authority that clients use when verifying server certificates. Used for https connection to ClickHouse"
28432846
secret:
28442847
type: object
28452848
properties:

pkg/apis/clickhouse.altinity.com/v1/type_config_chop.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ const (
5555
defaultChUsername = ""
5656
defaultChPassword = ""
5757
defaultChPort = 8123
58-
defaultChRootCA = ""
58+
defaultChRootCA = ""
5959

6060
// defaultReconcileThreadsNumber specifies default number of controller threads running concurrently.
6161
// Used in case no other specified in config

pkg/apis/metrics/clickhouse_fetcher.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ type ClickHouseFetcher struct {
132132
}
133133

134134
// NewClickHouseFetcher creates new clickhouse fetcher object
135-
func NewClickHouseFetcher(scheme, hostname, username, password string, port int) *ClickHouseFetcher {
135+
func NewClickHouseFetcher(scheme, hostname, username, password, rootCA string, port int) *ClickHouseFetcher {
136136
return &ClickHouseFetcher{
137-
connectionParams: clickhouse.NewConnectionParams(scheme, hostname, username, password, port),
137+
connectionParams: clickhouse.NewConnectionParams(scheme, hostname, username, password, rootCA, port),
138138
}
139139
}
140140

pkg/apis/metrics/exporter.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,7 @@ func (e *Exporter) newFetcher(hostname string) *ClickHouseFetcher {
167167
hostname,
168168
e.chAccessInfo.Username,
169169
e.chAccessInfo.Password,
170+
e.chAccessInfo.RootCA,
170171
e.chAccessInfo.Port,
171172
).SetQueryTimeout(e.timeout)
172173
}

0 commit comments

Comments
 (0)