typekro 0.22.1 → 0.23.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/.tsbuildinfo +1 -1
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts +78 -0
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.d.ts.map +1 -0
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.js +251 -0
- package/dist/factories/clickhouse/compositions/clickhouse-cluster.js.map +1 -0
- package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.d.ts +22 -0
- package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.d.ts.map +1 -0
- package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.js +35 -0
- package/dist/factories/clickhouse/compositions/clickhouse-helm-repository.js.map +1 -0
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts +68 -0
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.d.ts.map +1 -0
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js +137 -0
- package/dist/factories/clickhouse/compositions/clickhouse-operator-bootstrap.js.map +1 -0
- package/dist/factories/clickhouse/compositions/index.d.ts +4 -0
- package/dist/factories/clickhouse/compositions/index.d.ts.map +1 -0
- package/dist/factories/clickhouse/compositions/index.js +4 -0
- package/dist/factories/clickhouse/compositions/index.js.map +1 -0
- package/dist/factories/clickhouse/index.d.ts +70 -0
- package/dist/factories/clickhouse/index.d.ts.map +1 -0
- package/dist/factories/clickhouse/index.js +70 -0
- package/dist/factories/clickhouse/index.js.map +1 -0
- package/dist/factories/clickhouse/resources/helm.d.ts +62 -0
- package/dist/factories/clickhouse/resources/helm.d.ts.map +1 -0
- package/dist/factories/clickhouse/resources/helm.js +94 -0
- package/dist/factories/clickhouse/resources/helm.js.map +1 -0
- package/dist/factories/clickhouse/resources/index.d.ts +4 -0
- package/dist/factories/clickhouse/resources/index.d.ts.map +1 -0
- package/dist/factories/clickhouse/resources/index.js +4 -0
- package/dist/factories/clickhouse/resources/index.js.map +1 -0
- package/dist/factories/clickhouse/resources/installation.d.ts +83 -0
- package/dist/factories/clickhouse/resources/installation.d.ts.map +1 -0
- package/dist/factories/clickhouse/resources/installation.js +316 -0
- package/dist/factories/clickhouse/resources/installation.js.map +1 -0
- package/dist/factories/clickhouse/resources/keeper.d.ts +40 -0
- package/dist/factories/clickhouse/resources/keeper.d.ts.map +1 -0
- package/dist/factories/clickhouse/resources/keeper.js +107 -0
- package/dist/factories/clickhouse/resources/keeper.js.map +1 -0
- package/dist/factories/clickhouse/types.d.ts +532 -0
- package/dist/factories/clickhouse/types.d.ts.map +1 -0
- package/dist/factories/clickhouse/types.js +295 -0
- package/dist/factories/clickhouse/types.js.map +1 -0
- package/dist/factories/clickhouse/utils/helm-values-mapper.d.ts +65 -0
- package/dist/factories/clickhouse/utils/helm-values-mapper.d.ts.map +1 -0
- package/dist/factories/clickhouse/utils/helm-values-mapper.js +80 -0
- package/dist/factories/clickhouse/utils/helm-values-mapper.js.map +1 -0
- package/dist/factories/clickhouse/utils/index.d.ts +4 -0
- package/dist/factories/clickhouse/utils/index.d.ts.map +1 -0
- package/dist/factories/clickhouse/utils/index.js +4 -0
- package/dist/factories/clickhouse/utils/index.js.map +1 -0
- package/dist/factories/clickhouse/utils/validation.d.ts +21 -0
- package/dist/factories/clickhouse/utils/validation.d.ts.map +1 -0
- package/dist/factories/clickhouse/utils/validation.js +27 -0
- package/dist/factories/clickhouse/utils/validation.js.map +1 -0
- package/dist/factories/clickhouse/utils/zone-layout.d.ts +74 -0
- package/dist/factories/clickhouse/utils/zone-layout.d.ts.map +1 -0
- package/dist/factories/clickhouse/utils/zone-layout.js +103 -0
- package/dist/factories/clickhouse/utils/zone-layout.js.map +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouse (Altinity clickhouse-operator) Integration for TypeKro
|
|
3
|
+
*
|
|
4
|
+
* Provides type-safe factories for managing ClickHouse clusters on Kubernetes
|
|
5
|
+
* using the OFFICIAL Altinity clickhouse-operator (build-around: the official
|
|
6
|
+
* `altinity-clickhouse-operator` chart from https://helm.altinity.com,
|
|
7
|
+
* Apache-2.0 — never hand-rolled manifests).
|
|
8
|
+
*
|
|
9
|
+
* ONE OPERATOR PER CLUSTER: the operator is cluster-scoped and owns the
|
|
10
|
+
* ClickHouse CRDs; install exactly one `clickhouseOperatorBootstrap` per
|
|
11
|
+
* cluster and point every CHI/CHK at it.
|
|
12
|
+
*
|
|
13
|
+
* BUILD-TIME vs RUNTIME: topology (`zones`/`replicas`/`shards`/keeper
|
|
14
|
+
* presence/user names) is fixed at CONSTRUCTION time via
|
|
15
|
+
* `makeClickHouseCluster(topology)`; everything else (name, namespace,
|
|
16
|
+
* version, storage, credentials, keeper host) is proxy-safe RUNTIME spec.
|
|
17
|
+
*
|
|
18
|
+
* ## Compositions
|
|
19
|
+
* - `makeClickHouseCluster(topology)` — build-time topology constructor;
|
|
20
|
+
* returns a composition whose runtime spec is fully schema-ref safe and
|
|
21
|
+
* whose status exposes the typed connection contract
|
|
22
|
+
* - `clickHouseCluster` — the default single-node topology
|
|
23
|
+
* - `clickhouseOperatorBootstrap` — complete operator deployment
|
|
24
|
+
* (namespace + shared Helm repo singleton + release)
|
|
25
|
+
* - `clickhouseHelmRepositoryBootstrap` — shared HelmRepository singleton owner
|
|
26
|
+
*
|
|
27
|
+
* ## Resources
|
|
28
|
+
* - `clickHouseInstallation()` — LOW-LEVEL typed CHI (concrete topology only;
|
|
29
|
+
* zone-pinned replica layout, SigNoz-compatible `cluster` name default)
|
|
30
|
+
* - `clickHouseKeeperInstallation()` — typed CHK (coordination service)
|
|
31
|
+
* - `clickhouseHelmRepository()` — Altinity Helm chart repository
|
|
32
|
+
* - `clickhouseOperatorHelmRelease()` — operator installation via Helm
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import {
|
|
37
|
+
* clickhouseOperatorBootstrap,
|
|
38
|
+
* makeClickHouseCluster,
|
|
39
|
+
* } from 'typekro/clickhouse';
|
|
40
|
+
*
|
|
41
|
+
* // Install the operator (once per cluster)
|
|
42
|
+
* const operatorFactory = clickhouseOperatorBootstrap.factory('kro', {
|
|
43
|
+
* namespace: 'clickhouse-system',
|
|
44
|
+
* });
|
|
45
|
+
* await operatorFactory.deploy({ name: 'clickhouse-operator' });
|
|
46
|
+
*
|
|
47
|
+
* // Fix the topology at construction, deploy with runtime spec
|
|
48
|
+
* const clickhouse = makeClickHouseCluster({
|
|
49
|
+
* zones: ['us-east-2a', 'us-east-2b'],
|
|
50
|
+
* replicas: 2,
|
|
51
|
+
* users: [{ name: 'signoz' }],
|
|
52
|
+
* });
|
|
53
|
+
* await clickhouse.factory('kro', { namespace: 'observability' }).deploy({
|
|
54
|
+
* name: 'signoz-clickhouse',
|
|
55
|
+
* namespace: 'observability',
|
|
56
|
+
* version: '25.12.5',
|
|
57
|
+
* storage: { size: '100Gi', storageClassName: 'gp3-expandable' },
|
|
58
|
+
* keeper: { host: 'keeper-signoz.observability.svc.cluster.local' },
|
|
59
|
+
* users: { signoz: { passwordSha256Hex: '<sha256-hex>' } },
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see https://github.com/Altinity/clickhouse-operator
|
|
64
|
+
* @module
|
|
65
|
+
*/
|
|
66
|
+
export * from './compositions/index.js';
|
|
67
|
+
export * from './resources/index.js';
|
|
68
|
+
export * from './types.js';
|
|
69
|
+
export * from './utils/index.js';
|
|
70
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/factories/clickhouse/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouse (Altinity clickhouse-operator) Integration for TypeKro
|
|
3
|
+
*
|
|
4
|
+
* Provides type-safe factories for managing ClickHouse clusters on Kubernetes
|
|
5
|
+
* using the OFFICIAL Altinity clickhouse-operator (build-around: the official
|
|
6
|
+
* `altinity-clickhouse-operator` chart from https://helm.altinity.com,
|
|
7
|
+
* Apache-2.0 — never hand-rolled manifests).
|
|
8
|
+
*
|
|
9
|
+
* ONE OPERATOR PER CLUSTER: the operator is cluster-scoped and owns the
|
|
10
|
+
* ClickHouse CRDs; install exactly one `clickhouseOperatorBootstrap` per
|
|
11
|
+
* cluster and point every CHI/CHK at it.
|
|
12
|
+
*
|
|
13
|
+
* BUILD-TIME vs RUNTIME: topology (`zones`/`replicas`/`shards`/keeper
|
|
14
|
+
* presence/user names) is fixed at CONSTRUCTION time via
|
|
15
|
+
* `makeClickHouseCluster(topology)`; everything else (name, namespace,
|
|
16
|
+
* version, storage, credentials, keeper host) is proxy-safe RUNTIME spec.
|
|
17
|
+
*
|
|
18
|
+
* ## Compositions
|
|
19
|
+
* - `makeClickHouseCluster(topology)` — build-time topology constructor;
|
|
20
|
+
* returns a composition whose runtime spec is fully schema-ref safe and
|
|
21
|
+
* whose status exposes the typed connection contract
|
|
22
|
+
* - `clickHouseCluster` — the default single-node topology
|
|
23
|
+
* - `clickhouseOperatorBootstrap` — complete operator deployment
|
|
24
|
+
* (namespace + shared Helm repo singleton + release)
|
|
25
|
+
* - `clickhouseHelmRepositoryBootstrap` — shared HelmRepository singleton owner
|
|
26
|
+
*
|
|
27
|
+
* ## Resources
|
|
28
|
+
* - `clickHouseInstallation()` — LOW-LEVEL typed CHI (concrete topology only;
|
|
29
|
+
* zone-pinned replica layout, SigNoz-compatible `cluster` name default)
|
|
30
|
+
* - `clickHouseKeeperInstallation()` — typed CHK (coordination service)
|
|
31
|
+
* - `clickhouseHelmRepository()` — Altinity Helm chart repository
|
|
32
|
+
* - `clickhouseOperatorHelmRelease()` — operator installation via Helm
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* import {
|
|
37
|
+
* clickhouseOperatorBootstrap,
|
|
38
|
+
* makeClickHouseCluster,
|
|
39
|
+
* } from 'typekro/clickhouse';
|
|
40
|
+
*
|
|
41
|
+
* // Install the operator (once per cluster)
|
|
42
|
+
* const operatorFactory = clickhouseOperatorBootstrap.factory('kro', {
|
|
43
|
+
* namespace: 'clickhouse-system',
|
|
44
|
+
* });
|
|
45
|
+
* await operatorFactory.deploy({ name: 'clickhouse-operator' });
|
|
46
|
+
*
|
|
47
|
+
* // Fix the topology at construction, deploy with runtime spec
|
|
48
|
+
* const clickhouse = makeClickHouseCluster({
|
|
49
|
+
* zones: ['us-east-2a', 'us-east-2b'],
|
|
50
|
+
* replicas: 2,
|
|
51
|
+
* users: [{ name: 'signoz' }],
|
|
52
|
+
* });
|
|
53
|
+
* await clickhouse.factory('kro', { namespace: 'observability' }).deploy({
|
|
54
|
+
* name: 'signoz-clickhouse',
|
|
55
|
+
* namespace: 'observability',
|
|
56
|
+
* version: '25.12.5',
|
|
57
|
+
* storage: { size: '100Gi', storageClassName: 'gp3-expandable' },
|
|
58
|
+
* keeper: { host: 'keeper-signoz.observability.svc.cluster.local' },
|
|
59
|
+
* users: { signoz: { passwordSha256Hex: '<sha256-hex>' } },
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @see https://github.com/Altinity/clickhouse-operator
|
|
64
|
+
* @module
|
|
65
|
+
*/
|
|
66
|
+
export * from './compositions/index.js';
|
|
67
|
+
export * from './resources/index.js';
|
|
68
|
+
export * from './types.js';
|
|
69
|
+
export * from './utils/index.js';
|
|
70
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/factories/clickhouse/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,YAAY,CAAC;AAC3B,cAAc,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouse Operator Helm Resource Factories
|
|
3
|
+
*
|
|
4
|
+
* Wrappers around the generic Helm factories with Altinity-specific defaults.
|
|
5
|
+
* Used by the `clickhouseOperatorBootstrap` composition to install the
|
|
6
|
+
* OFFICIAL Altinity clickhouse-operator (build-around: we wrap the official
|
|
7
|
+
* chart rather than hand-rolling operator manifests).
|
|
8
|
+
*
|
|
9
|
+
* Chart: `altinity-clickhouse-operator` from https://helm.altinity.com
|
|
10
|
+
* (Apache-2.0). The operator is cluster-scoped and owns the ClickHouse CRDs —
|
|
11
|
+
* exactly ONE install per cluster.
|
|
12
|
+
*/
|
|
13
|
+
import type { Composable, Enhanced } from '../../../core/types/index.js';
|
|
14
|
+
import { type HelmRepositorySpec, type HelmRepositoryStatus } from '../../helm/helm-repository.js';
|
|
15
|
+
import type { HelmReleaseSpec, HelmReleaseStatus } from '../../helm/types.js';
|
|
16
|
+
import type { ClickHouseHelmRepositoryConfig, ClickHouseOperatorHelmReleaseConfig } from '../types.js';
|
|
17
|
+
/** Official Altinity Helm chart repository URL. */
|
|
18
|
+
export declare const DEFAULT_CLICKHOUSE_REPO_URL = "https://helm.altinity.com";
|
|
19
|
+
/** Default Flux HelmRepository name for the Altinity chart repository. */
|
|
20
|
+
export declare const DEFAULT_CLICKHOUSE_REPO_NAME = "altinity";
|
|
21
|
+
/** Official operator chart name. */
|
|
22
|
+
export declare const CLICKHOUSE_OPERATOR_CHART_NAME = "altinity-clickhouse-operator";
|
|
23
|
+
/** Default altinity-clickhouse-operator chart version. */
|
|
24
|
+
export declare const DEFAULT_CLICKHOUSE_OPERATOR_VERSION = "0.27.1";
|
|
25
|
+
/**
|
|
26
|
+
* Create a Flux HelmRepository for the official Altinity chart repository.
|
|
27
|
+
*
|
|
28
|
+
* @param config - Repository configuration with Altinity defaults
|
|
29
|
+
* @returns Enhanced HelmRepository resource
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```typescript
|
|
33
|
+
* const repo = clickhouseHelmRepository({
|
|
34
|
+
* name: 'altinity',
|
|
35
|
+
* namespace: 'flux-system',
|
|
36
|
+
* id: 'clickhouseHelmRepository',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare function clickhouseHelmRepository(config: Composable<ClickHouseHelmRepositoryConfig>): Enhanced<HelmRepositorySpec, HelmRepositoryStatus>;
|
|
41
|
+
/**
|
|
42
|
+
* Create a Flux HelmRelease for the Altinity clickhouse-operator.
|
|
43
|
+
*
|
|
44
|
+
* IMPORTANT: the operator owns the ClickHouse CRDs and watches cluster-wide —
|
|
45
|
+
* install exactly ONE release per cluster (enforced by convention via the
|
|
46
|
+
* `shared` default in `clickhouseOperatorBootstrap`).
|
|
47
|
+
*
|
|
48
|
+
* @param config - Release configuration with Altinity defaults
|
|
49
|
+
* @returns Enhanced HelmRelease resource
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```typescript
|
|
53
|
+
* const release = clickhouseOperatorHelmRelease({
|
|
54
|
+
* name: 'clickhouse-operator',
|
|
55
|
+
* namespace: 'clickhouse-system',
|
|
56
|
+
* version: '0.27.1',
|
|
57
|
+
* id: 'clickhouseOperatorHelmRelease',
|
|
58
|
+
* });
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function clickhouseOperatorHelmRelease(config: Composable<ClickHouseOperatorHelmReleaseConfig>): Enhanced<HelmReleaseSpec, HelmReleaseStatus>;
|
|
62
|
+
//# sourceMappingURL=helm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/helm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAIH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,8BAA8B,CAAC;AAEzE,OAAO,EAGL,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC9E,OAAO,KAAK,EACV,8BAA8B,EAC9B,mCAAmC,EACpC,MAAM,aAAa,CAAC;AAErB,mDAAmD;AACnD,eAAO,MAAM,2BAA2B,8BAA8B,CAAC;AAEvE,0EAA0E;AAC1E,eAAO,MAAM,4BAA4B,aAAa,CAAC;AAEvD,oCAAoC;AACpC,eAAO,MAAM,8BAA8B,iCAAiC,CAAC;AAE7E,0DAA0D;AAC1D,eAAO,MAAM,mCAAmC,WAAW,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,UAAU,CAAC,8BAA8B,CAAC,GACjD,QAAQ,CAAC,kBAAkB,EAAE,oBAAoB,CAAC,CAgBpD;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,6BAA6B,CAC3C,MAAM,EAAE,UAAU,CAAC,mCAAmC,CAAC,GACtD,QAAQ,CAAC,eAAe,EAAE,iBAAiB,CAAC,CAqB9C"}
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouse Operator Helm Resource Factories
|
|
3
|
+
*
|
|
4
|
+
* Wrappers around the generic Helm factories with Altinity-specific defaults.
|
|
5
|
+
* Used by the `clickhouseOperatorBootstrap` composition to install the
|
|
6
|
+
* OFFICIAL Altinity clickhouse-operator (build-around: we wrap the official
|
|
7
|
+
* chart rather than hand-rolling operator manifests).
|
|
8
|
+
*
|
|
9
|
+
* Chart: `altinity-clickhouse-operator` from https://helm.altinity.com
|
|
10
|
+
* (Apache-2.0). The operator is cluster-scoped and owns the ClickHouse CRDs —
|
|
11
|
+
* exactly ONE install per cluster.
|
|
12
|
+
*/
|
|
13
|
+
import { DEFAULT_FLUX_NAMESPACE } from '../../../core/config/defaults.js';
|
|
14
|
+
import { setMetadataField } from '../../../core/metadata/resource-metadata.js';
|
|
15
|
+
import { helmRelease } from '../../helm/helm-release.js';
|
|
16
|
+
import { createHelmRepositoryReadinessEvaluator, helmRepository, } from '../../helm/helm-repository.js';
|
|
17
|
+
import { createLabeledHelmReleaseEvaluator } from '../../helm/readiness-evaluators.js';
|
|
18
|
+
/** Official Altinity Helm chart repository URL. */
|
|
19
|
+
export const DEFAULT_CLICKHOUSE_REPO_URL = 'https://helm.altinity.com';
|
|
20
|
+
/** Default Flux HelmRepository name for the Altinity chart repository. */
|
|
21
|
+
export const DEFAULT_CLICKHOUSE_REPO_NAME = 'altinity';
|
|
22
|
+
/** Official operator chart name. */
|
|
23
|
+
export const CLICKHOUSE_OPERATOR_CHART_NAME = 'altinity-clickhouse-operator';
|
|
24
|
+
/** Default altinity-clickhouse-operator chart version. */
|
|
25
|
+
export const DEFAULT_CLICKHOUSE_OPERATOR_VERSION = '0.27.1';
|
|
26
|
+
/**
|
|
27
|
+
* Create a Flux HelmRepository for the official Altinity chart repository.
|
|
28
|
+
*
|
|
29
|
+
* @param config - Repository configuration with Altinity defaults
|
|
30
|
+
* @returns Enhanced HelmRepository resource
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```typescript
|
|
34
|
+
* const repo = clickhouseHelmRepository({
|
|
35
|
+
* name: 'altinity',
|
|
36
|
+
* namespace: 'flux-system',
|
|
37
|
+
* id: 'clickhouseHelmRepository',
|
|
38
|
+
* });
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
export function clickhouseHelmRepository(config) {
|
|
42
|
+
const repo = helmRepository({
|
|
43
|
+
name: config.name || DEFAULT_CLICKHOUSE_REPO_NAME,
|
|
44
|
+
namespace: config.namespace || DEFAULT_FLUX_NAMESPACE,
|
|
45
|
+
url: config.url || DEFAULT_CLICKHOUSE_REPO_URL,
|
|
46
|
+
interval: config.interval || '5m',
|
|
47
|
+
...(config.id && { id: config.id }),
|
|
48
|
+
}).withReadinessEvaluator(createHelmRepositoryReadinessEvaluator('ClickHouse'));
|
|
49
|
+
// The chart repository is one cluster-level Flux source shared by every
|
|
50
|
+
// consumer — never torn down with an individual instance.
|
|
51
|
+
setMetadataField(repo, 'scopes', ['cluster']);
|
|
52
|
+
return repo;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Create a Flux HelmRelease for the Altinity clickhouse-operator.
|
|
56
|
+
*
|
|
57
|
+
* IMPORTANT: the operator owns the ClickHouse CRDs and watches cluster-wide —
|
|
58
|
+
* install exactly ONE release per cluster (enforced by convention via the
|
|
59
|
+
* `shared` default in `clickhouseOperatorBootstrap`).
|
|
60
|
+
*
|
|
61
|
+
* @param config - Release configuration with Altinity defaults
|
|
62
|
+
* @returns Enhanced HelmRelease resource
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const release = clickhouseOperatorHelmRelease({
|
|
67
|
+
* name: 'clickhouse-operator',
|
|
68
|
+
* namespace: 'clickhouse-system',
|
|
69
|
+
* version: '0.27.1',
|
|
70
|
+
* id: 'clickhouseOperatorHelmRelease',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export function clickhouseOperatorHelmRelease(config) {
|
|
75
|
+
// Pass values directly — the core proxy system handles serialization.
|
|
76
|
+
return helmRelease({
|
|
77
|
+
name: config.name,
|
|
78
|
+
namespace: config.namespace || 'clickhouse-system',
|
|
79
|
+
chart: {
|
|
80
|
+
repository: DEFAULT_CLICKHOUSE_REPO_URL,
|
|
81
|
+
name: CLICKHOUSE_OPERATOR_CHART_NAME,
|
|
82
|
+
version: config.version || DEFAULT_CLICKHOUSE_OPERATOR_VERSION,
|
|
83
|
+
},
|
|
84
|
+
sourceRef: {
|
|
85
|
+
name: config.repositoryName || DEFAULT_CLICKHOUSE_REPO_NAME,
|
|
86
|
+
namespace: DEFAULT_FLUX_NAMESPACE,
|
|
87
|
+
kind: 'HelmRepository',
|
|
88
|
+
},
|
|
89
|
+
driftDetection: { mode: 'enabled' },
|
|
90
|
+
values: config.values || {},
|
|
91
|
+
...(config.id && { id: config.id }),
|
|
92
|
+
}).withReadinessEvaluator(createLabeledHelmReleaseEvaluator('ClickHouse'));
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=helm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"helm.js","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/helm.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,kCAAkC,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,6CAA6C,CAAC;AAE/E,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,EACL,sCAAsC,EACtC,cAAc,GAGf,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,iCAAiC,EAAE,MAAM,oCAAoC,CAAC;AAOvF,mDAAmD;AACnD,MAAM,CAAC,MAAM,2BAA2B,GAAG,2BAA2B,CAAC;AAEvE,0EAA0E;AAC1E,MAAM,CAAC,MAAM,4BAA4B,GAAG,UAAU,CAAC;AAEvD,oCAAoC;AACpC,MAAM,CAAC,MAAM,8BAA8B,GAAG,8BAA8B,CAAC;AAE7E,0DAA0D;AAC1D,MAAM,CAAC,MAAM,mCAAmC,GAAG,QAAQ,CAAC;AAE5D;;;;;;;;;;;;;;GAcG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAkD;IAElD,MAAM,IAAI,GAAG,cAAc,CAAC;QAC1B,IAAI,EAAE,MAAM,CAAC,IAAI,IAAI,4BAA4B;QACjD,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,sBAAsB;QACrD,GAAG,EAAE,MAAM,CAAC,GAAG,IAAI,2BAA2B;QAC9C,QAAQ,EAAE,MAAM,CAAC,QAAQ,IAAI,IAAI;QACjC,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;KACpC,CAAC,CAAC,sBAAsB,CACvB,sCAAsC,CAAC,YAAY,CAAC,CACC,CAAC;IAExD,wEAAwE;IACxE,0DAA0D;IAC1D,gBAAgB,CAAC,IAAI,EAAE,QAAQ,EAAE,CAAC,SAAS,CAAC,CAAC,CAAC;IAE9C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,6BAA6B,CAC3C,MAAuD;IAEvD,sEAAsE;IACtE,OAAO,WAAW,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC,IAAI;QACjB,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,mBAAmB;QAClD,KAAK,EAAE;YACL,UAAU,EAAE,2BAA2B;YACvC,IAAI,EAAE,8BAA8B;YACpC,OAAO,EAAE,MAAM,CAAC,OAAO,IAAI,mCAAmC;SAC/D;QACD,SAAS,EAAE;YACT,IAAI,EAAE,MAAM,CAAC,cAAc,IAAI,4BAA4B;YAC3D,SAAS,EAAE,sBAAsB;YACjC,IAAI,EAAE,gBAAgB;SACvB;QACD,cAAc,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE;QACnC,MAAM,EAAE,MAAM,CAAC,MAAM,IAAI,EAAE;QAC3B,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;KACpC,CAAC,CAAC,sBAAsB,CACvB,iCAAiC,CAAC,YAAY,CAAC,CACA,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouseInstallation (CHI) Factory
|
|
3
|
+
*
|
|
4
|
+
* Compiles a high-level typed config into a `clickhouse.altinity.com/v1`
|
|
5
|
+
* ClickHouseInstallation managed by the Altinity clickhouse-operator.
|
|
6
|
+
*
|
|
7
|
+
* THE POINT of this typed factory is the zone-pinned layout: the operator's
|
|
8
|
+
* `podDistribution` supports only the `kubernetes.io/hostname` topologyKey
|
|
9
|
+
* (Altinity/clickhouse-operator#772), so per-zone spreading must be compiled
|
|
10
|
+
* as a per-replica `layout.replicas:` list with zone-pinned pod templates.
|
|
11
|
+
* On EKS, EBS volumes are zonal — a replica rescheduled into another AZ
|
|
12
|
+
* strands its PVC (production incident) — so `zones` should be set for any
|
|
13
|
+
* multi-replica production CHI.
|
|
14
|
+
*
|
|
15
|
+
* CHI shape follows the official examples
|
|
16
|
+
* (docs/chi-examples/01-simple-layout-01-1shard-1repl.yaml and
|
|
17
|
+
* 14-zones-distribution-01.yaml in the operator repo).
|
|
18
|
+
*/
|
|
19
|
+
import type { Composable, Enhanced, ResourceStatus } from '../../../core/types/index.js';
|
|
20
|
+
import type { ClickHouseInstallationConfig, ClickHouseInstallationSpec, ClickHouseInstallationStatus } from '../types.js';
|
|
21
|
+
/**
|
|
22
|
+
* Known CHI/CHK reconcile status strings.
|
|
23
|
+
*
|
|
24
|
+
* Source: clickhouse-operator `pkg/apis/clickhouse.altinity.com/v1/type_status.go`
|
|
25
|
+
* (StatusInProgress/StatusCompleted/StatusAborted/StatusTerminating). The
|
|
26
|
+
* operator writes them to `status.status`; `Completed` means the installation
|
|
27
|
+
* is fully reconciled.
|
|
28
|
+
*/
|
|
29
|
+
export declare const CHI_STATUS: {
|
|
30
|
+
readonly IN_PROGRESS: "InProgress";
|
|
31
|
+
readonly COMPLETED: "Completed";
|
|
32
|
+
readonly ABORTED: "Aborted";
|
|
33
|
+
readonly TERMINATING: "Terminating";
|
|
34
|
+
};
|
|
35
|
+
/**
|
|
36
|
+
* CHI/CHK Readiness Evaluator
|
|
37
|
+
*
|
|
38
|
+
* Keys off the operator-reported `status.status` reconcile state (see
|
|
39
|
+
* CHI_STATUS). Unlike condition-based CRDs, the clickhouse-operator reports a
|
|
40
|
+
* single status string plus host progress counters.
|
|
41
|
+
*/
|
|
42
|
+
export declare function chiReadinessEvaluator(liveResource: unknown): ResourceStatus;
|
|
43
|
+
/**
|
|
44
|
+
* Default logical cluster name.
|
|
45
|
+
*
|
|
46
|
+
* SIGNOZ COMPATIBILITY: SigNoz's ClickHouse migrations hardcode the cluster
|
|
47
|
+
* name `cluster`, so a CHI consumed by SigNoz MUST keep this default.
|
|
48
|
+
*/
|
|
49
|
+
export declare const DEFAULT_CHI_CLUSTER_NAME = "cluster";
|
|
50
|
+
/**
|
|
51
|
+
* ClickHouseInstallation Factory (LOW-LEVEL, concrete topology)
|
|
52
|
+
*
|
|
53
|
+
* Creates a ClickHouse cluster managed by the Altinity clickhouse-operator.
|
|
54
|
+
*
|
|
55
|
+
* BUILD-TIME topology fields (`shards`, `replicas`, `zones`, user names) must
|
|
56
|
+
* be concrete JS values — the factory throws loudly if any receives a schema
|
|
57
|
+
* reference (the compiler enumerates templates/replica entries from them).
|
|
58
|
+
* Prefer `makeClickHouseCluster()` in compositions: it fixes the topology at
|
|
59
|
+
* construction time and exposes only proxy-safe runtime spec.
|
|
60
|
+
*
|
|
61
|
+
* @param config - High-level installation configuration
|
|
62
|
+
* @returns Enhanced ClickHouseInstallation resource with readiness evaluation
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```typescript
|
|
66
|
+
* const chi = clickHouseInstallation({
|
|
67
|
+
* name: 'signoz-clickhouse',
|
|
68
|
+
* namespace: 'observability',
|
|
69
|
+
* version: '25.12.5', // SigNoz-coupled server version
|
|
70
|
+
* shards: 1,
|
|
71
|
+
* replicas: 2,
|
|
72
|
+
* zones: ['us-east-2a', 'us-east-2b'], // zone-pinned replicas (EBS is zonal)
|
|
73
|
+
* storage: { size: '100Gi', storageClassName: 'gp3-expandable' },
|
|
74
|
+
* users: [{ name: 'signoz', passwordSha256Hex: '...', networksIp: ['::/0'] }],
|
|
75
|
+
* keeper: { host: 'keeper-signoz.observability.svc.cluster.local' },
|
|
76
|
+
* id: 'signozClickhouse',
|
|
77
|
+
* });
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
declare function createClickHouseInstallationResource(config: Composable<ClickHouseInstallationConfig>): Enhanced<ClickHouseInstallationSpec, ClickHouseInstallationStatus>;
|
|
81
|
+
export declare const clickHouseInstallation: typeof createClickHouseInstallationResource;
|
|
82
|
+
export {};
|
|
83
|
+
//# sourceMappingURL=installation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/installation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGzF,OAAO,KAAK,EAEV,4BAA4B,EAC5B,0BAA0B,EAC1B,4BAA4B,EAC7B,MAAM,aAAa,CAAC;AAIrB;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,OAAO,GAAG,cAAc,CAoD3E;AAKD;;;;;GAKG;AACH,eAAO,MAAM,wBAAwB,YAAY,CAAC;AA6LlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,iBAAS,oCAAoC,CAC3C,MAAM,EAAE,UAAU,CAAC,4BAA4B,CAAC,GAC/C,QAAQ,CAAC,0BAA0B,EAAE,4BAA4B,CAAC,CAmBpE;AAED,eAAO,MAAM,sBAAsB,6CAAuC,CAAC"}
|