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,316 @@
|
|
|
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 { isCelExpression, isKubernetesRef } from '../../../utils/type-guards.js';
|
|
20
|
+
import { createResource } from '../../shared.js';
|
|
21
|
+
import { assertPositiveIntegerCount } from '../utils/validation.js';
|
|
22
|
+
import { compileZonePinnedLayout } from '../utils/zone-layout.js';
|
|
23
|
+
/**
|
|
24
|
+
* Known CHI/CHK reconcile status strings.
|
|
25
|
+
*
|
|
26
|
+
* Source: clickhouse-operator `pkg/apis/clickhouse.altinity.com/v1/type_status.go`
|
|
27
|
+
* (StatusInProgress/StatusCompleted/StatusAborted/StatusTerminating). The
|
|
28
|
+
* operator writes them to `status.status`; `Completed` means the installation
|
|
29
|
+
* is fully reconciled.
|
|
30
|
+
*/
|
|
31
|
+
export const CHI_STATUS = {
|
|
32
|
+
IN_PROGRESS: 'InProgress',
|
|
33
|
+
COMPLETED: 'Completed',
|
|
34
|
+
ABORTED: 'Aborted',
|
|
35
|
+
TERMINATING: 'Terminating',
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* CHI/CHK Readiness Evaluator
|
|
39
|
+
*
|
|
40
|
+
* Keys off the operator-reported `status.status` reconcile state (see
|
|
41
|
+
* CHI_STATUS). Unlike condition-based CRDs, the clickhouse-operator reports a
|
|
42
|
+
* single status string plus host progress counters.
|
|
43
|
+
*/
|
|
44
|
+
export function chiReadinessEvaluator(liveResource) {
|
|
45
|
+
const resource = liveResource;
|
|
46
|
+
const status = resource?.status;
|
|
47
|
+
if (!status || status.status === undefined) {
|
|
48
|
+
return {
|
|
49
|
+
ready: false,
|
|
50
|
+
message: 'Installation has no status yet',
|
|
51
|
+
reason: 'StatusMissing',
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (status.status === CHI_STATUS.COMPLETED) {
|
|
55
|
+
return {
|
|
56
|
+
ready: true,
|
|
57
|
+
message: `Installation reconciled (${status.hostsCompletedCount ?? status.hostsCount ?? 0}/${status.hostsCount ?? 0} hosts)`,
|
|
58
|
+
reason: 'Completed',
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
if (status.status === CHI_STATUS.IN_PROGRESS) {
|
|
62
|
+
return {
|
|
63
|
+
ready: false,
|
|
64
|
+
message: `Reconcile in progress (${status.hostsCompletedCount ?? 0}/${status.hostsCount ?? 0} hosts)`,
|
|
65
|
+
reason: 'InProgress',
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
if (status.status === CHI_STATUS.ABORTED) {
|
|
69
|
+
return {
|
|
70
|
+
ready: false,
|
|
71
|
+
message: `Reconcile aborted${status.errors?.length ? `: ${status.errors[0]}` : ''}`,
|
|
72
|
+
reason: 'Aborted',
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (status.status === CHI_STATUS.TERMINATING) {
|
|
76
|
+
return {
|
|
77
|
+
ready: false,
|
|
78
|
+
message: 'Installation is terminating',
|
|
79
|
+
reason: 'Terminating',
|
|
80
|
+
};
|
|
81
|
+
}
|
|
82
|
+
return {
|
|
83
|
+
ready: false,
|
|
84
|
+
message: `Unknown installation status: ${status.status}`,
|
|
85
|
+
reason: 'UnknownStatus',
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
/** Default ClickHouse server image repository. */
|
|
89
|
+
const DEFAULT_CLICKHOUSE_IMAGE_REPOSITORY = 'clickhouse/clickhouse-server';
|
|
90
|
+
/**
|
|
91
|
+
* Default logical cluster name.
|
|
92
|
+
*
|
|
93
|
+
* SIGNOZ COMPATIBILITY: SigNoz's ClickHouse migrations hardcode the cluster
|
|
94
|
+
* name `cluster`, so a CHI consumed by SigNoz MUST keep this default.
|
|
95
|
+
*/
|
|
96
|
+
export const DEFAULT_CHI_CLUSTER_NAME = 'cluster';
|
|
97
|
+
/** Name of the generated data volume claim template. */
|
|
98
|
+
const DATA_VOLUME_TEMPLATE = 'data-volume';
|
|
99
|
+
/** Base name for generated pod templates. */
|
|
100
|
+
const POD_TEMPLATE_BASE = 'clickhouse';
|
|
101
|
+
/** True when the value is a graph reference (KubernetesRef or CEL expression). */
|
|
102
|
+
function isGraphRef(value) {
|
|
103
|
+
return isKubernetesRef(value) || isCelExpression(value);
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* LOUD build-time validation: the CHI compiler BRANCHES on these fields
|
|
107
|
+
* (zone round-robin, template enumeration, path-keyed user settings), so a
|
|
108
|
+
* KubernetesRef/CEL expression here can never work — it would either crash
|
|
109
|
+
* graph construction or serialize garbage paths. Fail fast with a pointer to
|
|
110
|
+
* the build-time constructor instead of leaking `__KUBERNETES_REF__` markers.
|
|
111
|
+
*/
|
|
112
|
+
function assertConcreteTopology(config) {
|
|
113
|
+
const reject = (field) => {
|
|
114
|
+
throw new Error(`clickHouseInstallation: '${field}' is a BUILD-TIME topology field and received a ` +
|
|
115
|
+
`schema reference or CEL expression. The compiler enumerates pod templates and ` +
|
|
116
|
+
`per-replica layout entries from it, so it must be a concrete JS value. ` +
|
|
117
|
+
`For schema-driven compositions, fix the topology at construction time with ` +
|
|
118
|
+
`makeClickHouseCluster({ zones, replicas, shards, users }) and pass only runtime ` +
|
|
119
|
+
`fields (name, version, storage, credentials, keeper host) through the spec.`);
|
|
120
|
+
};
|
|
121
|
+
if (isGraphRef(config.shards))
|
|
122
|
+
reject('shards');
|
|
123
|
+
if (isGraphRef(config.replicas))
|
|
124
|
+
reject('replicas');
|
|
125
|
+
if (isGraphRef(config.zones))
|
|
126
|
+
reject('zones');
|
|
127
|
+
if (Array.isArray(config.zones)) {
|
|
128
|
+
for (const zone of config.zones) {
|
|
129
|
+
if (isGraphRef(zone))
|
|
130
|
+
reject('zones[]');
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
if (isGraphRef(config.users))
|
|
134
|
+
reject('users');
|
|
135
|
+
if (Array.isArray(config.users)) {
|
|
136
|
+
config.users.forEach((user, index) => {
|
|
137
|
+
if (isGraphRef(user))
|
|
138
|
+
reject(`users[${index}]`);
|
|
139
|
+
if (isGraphRef(user.name))
|
|
140
|
+
reject(`users[${index}].name`);
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Flatten the typed users ARRAY to the operator's path-keyed format.
|
|
146
|
+
*
|
|
147
|
+
* User names become path fragments (`<user>/password_sha256_hex`) — they are
|
|
148
|
+
* validated concrete by `assertConcreteTopology`. The password hash and
|
|
149
|
+
* networks are plain VALUES and may be schema references (they serialize to
|
|
150
|
+
* CEL cleanly).
|
|
151
|
+
*/
|
|
152
|
+
function compileUsers(users) {
|
|
153
|
+
const compiled = {};
|
|
154
|
+
for (const user of users) {
|
|
155
|
+
if (user.passwordSha256Hex !== undefined) {
|
|
156
|
+
compiled[`${user.name}/password_sha256_hex`] = user.passwordSha256Hex;
|
|
157
|
+
}
|
|
158
|
+
if (user.networksIp !== undefined) {
|
|
159
|
+
compiled[`${user.name}/networks/ip`] = user.networksIp;
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
return compiled;
|
|
163
|
+
}
|
|
164
|
+
/** Compile the high-level config into a full CHI spec. */
|
|
165
|
+
function compileInstallationSpec(config) {
|
|
166
|
+
assertConcreteTopology(config);
|
|
167
|
+
const shards = config.shards ?? 1;
|
|
168
|
+
const replicas = config.replicas ?? 1;
|
|
169
|
+
// SHARED count validation for BOTH layout paths: the plain homogeneous
|
|
170
|
+
// layout would otherwise emit `shardsCount: 0` / `replicasCount: 0` —
|
|
171
|
+
// invalid operator input the zone-pinned path already rejected.
|
|
172
|
+
assertPositiveIntegerCount('clickHouseInstallation', 'shards', shards);
|
|
173
|
+
assertPositiveIntegerCount('clickHouseInstallation', 'replicas', replicas);
|
|
174
|
+
const clusterName = config.clusterName ?? DEFAULT_CHI_CLUSTER_NAME;
|
|
175
|
+
const image = config.image ?? `${DEFAULT_CLICKHOUSE_IMAGE_REPOSITORY}:${config.version}`;
|
|
176
|
+
const zones = config.zones ?? [];
|
|
177
|
+
// Shared ClickHouse server pod spec (per-zone templates add affinity).
|
|
178
|
+
const podSpec = {
|
|
179
|
+
containers: [
|
|
180
|
+
{
|
|
181
|
+
name: 'clickhouse',
|
|
182
|
+
image,
|
|
183
|
+
...(config.podResources && { resources: config.podResources }),
|
|
184
|
+
},
|
|
185
|
+
],
|
|
186
|
+
};
|
|
187
|
+
// Storage claim: only storageClassName is set from input. On EKS the class
|
|
188
|
+
// should be a WaitForFirstConsumer + allowVolumeExpansion gp3 StorageClass
|
|
189
|
+
// so the PVC binds in the zone the scheduler picks (and can expand later);
|
|
190
|
+
// WaitForFirstConsumer is a StorageClass property, not a PVC field.
|
|
191
|
+
const volumeClaimTemplates = [
|
|
192
|
+
{
|
|
193
|
+
name: DATA_VOLUME_TEMPLATE,
|
|
194
|
+
spec: {
|
|
195
|
+
accessModes: ['ReadWriteOnce'],
|
|
196
|
+
resources: { requests: { storage: config.storage.size } },
|
|
197
|
+
...(config.storage.storageClassName && {
|
|
198
|
+
storageClassName: config.storage.storageClassName,
|
|
199
|
+
}),
|
|
200
|
+
},
|
|
201
|
+
},
|
|
202
|
+
];
|
|
203
|
+
let layout;
|
|
204
|
+
let podTemplates;
|
|
205
|
+
let defaultPodTemplate;
|
|
206
|
+
if (zones.length > 0) {
|
|
207
|
+
// Zone-pinned per-replica layout: NO replicasCount — the explicit
|
|
208
|
+
// replicas list defines the replica count, and each replica references
|
|
209
|
+
// its zone's nodeAffinity-pinned pod template (round-robin across zones
|
|
210
|
+
// when replicas > zones.length). See utils/zone-layout.ts.
|
|
211
|
+
const zonePinned = compileZonePinnedLayout({
|
|
212
|
+
replicaCount: replicas,
|
|
213
|
+
zones,
|
|
214
|
+
podTemplateBaseName: POD_TEMPLATE_BASE,
|
|
215
|
+
podSpec,
|
|
216
|
+
});
|
|
217
|
+
podTemplates = zonePinned.podTemplates;
|
|
218
|
+
layout = {
|
|
219
|
+
clusters: [
|
|
220
|
+
{
|
|
221
|
+
name: clusterName,
|
|
222
|
+
layout: {
|
|
223
|
+
shardsCount: shards,
|
|
224
|
+
replicas: zonePinned.replicas,
|
|
225
|
+
},
|
|
226
|
+
},
|
|
227
|
+
],
|
|
228
|
+
};
|
|
229
|
+
}
|
|
230
|
+
else {
|
|
231
|
+
// Plain homogeneous layout: shardsCount x replicasCount with one shared
|
|
232
|
+
// pod template applied via defaults.
|
|
233
|
+
podTemplates = [{ name: POD_TEMPLATE_BASE, spec: podSpec }];
|
|
234
|
+
defaultPodTemplate = POD_TEMPLATE_BASE;
|
|
235
|
+
layout = {
|
|
236
|
+
clusters: [
|
|
237
|
+
{
|
|
238
|
+
name: clusterName,
|
|
239
|
+
layout: {
|
|
240
|
+
shardsCount: shards,
|
|
241
|
+
replicasCount: replicas,
|
|
242
|
+
},
|
|
243
|
+
},
|
|
244
|
+
],
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return {
|
|
248
|
+
defaults: {
|
|
249
|
+
templates: {
|
|
250
|
+
...(defaultPodTemplate && { podTemplate: defaultPodTemplate }),
|
|
251
|
+
dataVolumeClaimTemplate: DATA_VOLUME_TEMPLATE,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
configuration: {
|
|
255
|
+
...layout,
|
|
256
|
+
// The operator's `zookeeper` section serves clickhouse-keeper too.
|
|
257
|
+
...(config.keeper && {
|
|
258
|
+
zookeeper: {
|
|
259
|
+
nodes: [
|
|
260
|
+
{ host: config.keeper.host, port: config.keeper.port ?? 2181 },
|
|
261
|
+
],
|
|
262
|
+
},
|
|
263
|
+
}),
|
|
264
|
+
...(config.users && { users: compileUsers(config.users) }),
|
|
265
|
+
},
|
|
266
|
+
templates: {
|
|
267
|
+
podTemplates,
|
|
268
|
+
volumeClaimTemplates,
|
|
269
|
+
},
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
/**
|
|
273
|
+
* ClickHouseInstallation Factory (LOW-LEVEL, concrete topology)
|
|
274
|
+
*
|
|
275
|
+
* Creates a ClickHouse cluster managed by the Altinity clickhouse-operator.
|
|
276
|
+
*
|
|
277
|
+
* BUILD-TIME topology fields (`shards`, `replicas`, `zones`, user names) must
|
|
278
|
+
* be concrete JS values — the factory throws loudly if any receives a schema
|
|
279
|
+
* reference (the compiler enumerates templates/replica entries from them).
|
|
280
|
+
* Prefer `makeClickHouseCluster()` in compositions: it fixes the topology at
|
|
281
|
+
* construction time and exposes only proxy-safe runtime spec.
|
|
282
|
+
*
|
|
283
|
+
* @param config - High-level installation configuration
|
|
284
|
+
* @returns Enhanced ClickHouseInstallation resource with readiness evaluation
|
|
285
|
+
*
|
|
286
|
+
* @example
|
|
287
|
+
* ```typescript
|
|
288
|
+
* const chi = clickHouseInstallation({
|
|
289
|
+
* name: 'signoz-clickhouse',
|
|
290
|
+
* namespace: 'observability',
|
|
291
|
+
* version: '25.12.5', // SigNoz-coupled server version
|
|
292
|
+
* shards: 1,
|
|
293
|
+
* replicas: 2,
|
|
294
|
+
* zones: ['us-east-2a', 'us-east-2b'], // zone-pinned replicas (EBS is zonal)
|
|
295
|
+
* storage: { size: '100Gi', storageClassName: 'gp3-expandable' },
|
|
296
|
+
* users: [{ name: 'signoz', passwordSha256Hex: '...', networksIp: ['::/0'] }],
|
|
297
|
+
* keeper: { host: 'keeper-signoz.observability.svc.cluster.local' },
|
|
298
|
+
* id: 'signozClickhouse',
|
|
299
|
+
* });
|
|
300
|
+
* ```
|
|
301
|
+
*/
|
|
302
|
+
function createClickHouseInstallationResource(config) {
|
|
303
|
+
const spec = compileInstallationSpec(config);
|
|
304
|
+
return createResource({
|
|
305
|
+
apiVersion: 'clickhouse.altinity.com/v1',
|
|
306
|
+
kind: 'ClickHouseInstallation',
|
|
307
|
+
metadata: {
|
|
308
|
+
name: config.name,
|
|
309
|
+
...(config.namespace && { namespace: config.namespace }),
|
|
310
|
+
},
|
|
311
|
+
spec,
|
|
312
|
+
...(config.id && { id: config.id }),
|
|
313
|
+
}, { scope: 'namespaced', dnsAddressable: true }).withReadinessEvaluator(chiReadinessEvaluator);
|
|
314
|
+
}
|
|
315
|
+
export const clickHouseInstallation = createClickHouseInstallationResource;
|
|
316
|
+
//# sourceMappingURL=installation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"installation.js","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/installation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAOjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,uBAAuB,EAAE,MAAM,yBAAyB,CAAC;AAElE;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW,EAAE,YAAY;IACzB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,WAAW,EAAE,aAAa;CAClB,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CAAC,YAAqB;IACzD,MAAM,QAAQ,GAAG,YAGJ,CAAC;IACd,MAAM,MAAM,GAAG,QAAQ,EAAE,MA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;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,SAAS,oCAAoC,CAC3C,MAAgD;IAEhD,MAAM,IAAI,GAAG,uBAAuB,CAAC,MAAM,CAAC,CAAC;IAE7C,OAAO,cAAc,CACnB;QACE,UAAU,EAAE,4BAA4B;QACxC,IAAI,EAAE,wBAAwB;QAC9B,QAAQ,EAAE;YACR,IAAI,EAAE,MAAM,CAAC,IAAI;YACjB,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,SAAS,EAAE,CAAC;SACzD;QACD,IAAI;QACJ,GAAG,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,EAAE,CAAC;KACpC,EACD,EAAE,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,IAAI,EAAE,CAC9C,CAAC,sBAAsB,CAAC,qBAAqB,CAG7C,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,sBAAsB,GAAG,oCAAoC,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouseKeeperInstallation (CHK) Factory
|
|
3
|
+
*
|
|
4
|
+
* Minimal typed factory for the `clickhouse-keeper.altinity.com/v1`
|
|
5
|
+
* ClickHouseKeeperInstallation CRD (coordination service for replicated
|
|
6
|
+
* ClickHouse tables — the modern replacement for ZooKeeper), managed by the
|
|
7
|
+
* same Altinity clickhouse-operator install as CHI resources.
|
|
8
|
+
*/
|
|
9
|
+
import type { Composable, Enhanced, ResourceStatus } from '../../../core/types/index.js';
|
|
10
|
+
import type { ClickHouseKeeperInstallationConfig, ClickHouseKeeperInstallationSpec, ClickHouseKeeperInstallationStatus } from '../types.js';
|
|
11
|
+
/**
|
|
12
|
+
* CHK Readiness Evaluator
|
|
13
|
+
*
|
|
14
|
+
* CHK reports the same `status.status` reconcile state machine as CHI
|
|
15
|
+
* ('InProgress' | 'Completed' | 'Aborted' | 'Terminating' — shared operator
|
|
16
|
+
* status code), so the CHI evaluator applies verbatim.
|
|
17
|
+
*/
|
|
18
|
+
export declare function chkReadinessEvaluator(liveResource: unknown): ResourceStatus;
|
|
19
|
+
/**
|
|
20
|
+
* ClickHouseKeeperInstallation Factory
|
|
21
|
+
*
|
|
22
|
+
* @param config - High-level keeper configuration
|
|
23
|
+
* @returns Enhanced ClickHouseKeeperInstallation resource with readiness
|
|
24
|
+
* evaluation
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```typescript
|
|
28
|
+
* const keeper = clickHouseKeeperInstallation({
|
|
29
|
+
* name: 'keeper',
|
|
30
|
+
* namespace: 'observability',
|
|
31
|
+
* replicas: 3, // odd count for quorum
|
|
32
|
+
* storage: { size: '10Gi', storageClassName: 'gp3-expandable' },
|
|
33
|
+
* id: 'clickhouseKeeper',
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
declare function createClickHouseKeeperInstallationResource(config: Composable<ClickHouseKeeperInstallationConfig>): Enhanced<ClickHouseKeeperInstallationSpec, ClickHouseKeeperInstallationStatus>;
|
|
38
|
+
export declare const clickHouseKeeperInstallation: typeof createClickHouseKeeperInstallationResource;
|
|
39
|
+
export {};
|
|
40
|
+
//# sourceMappingURL=keeper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keeper.d.ts","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/keeper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAGzF,OAAO,KAAK,EACV,kCAAkC,EAClC,gCAAgC,EAChC,kCAAkC,EACnC,MAAM,aAAa,CAAC;AAOrB;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CAAC,YAAY,EAAE,OAAO,GAAG,cAAc,CAE3E;AA2DD;;;;;;;;;;;;;;;;;GAiBG;AACH,iBAAS,0CAA0C,CACjD,MAAM,EAAE,UAAU,CAAC,kCAAkC,CAAC,GACrD,QAAQ,CAAC,gCAAgC,EAAE,kCAAkC,CAAC,CAmBhF;AAED,eAAO,MAAM,4BAA4B,mDAA6C,CAAC"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ClickHouseKeeperInstallation (CHK) Factory
|
|
3
|
+
*
|
|
4
|
+
* Minimal typed factory for the `clickhouse-keeper.altinity.com/v1`
|
|
5
|
+
* ClickHouseKeeperInstallation CRD (coordination service for replicated
|
|
6
|
+
* ClickHouse tables — the modern replacement for ZooKeeper), managed by the
|
|
7
|
+
* same Altinity clickhouse-operator install as CHI resources.
|
|
8
|
+
*/
|
|
9
|
+
import { isCelExpression, isKubernetesRef } from '../../../utils/type-guards.js';
|
|
10
|
+
import { createResource } from '../../shared.js';
|
|
11
|
+
import { assertPositiveIntegerCount } from '../utils/validation.js';
|
|
12
|
+
import { chiReadinessEvaluator } from './installation.js';
|
|
13
|
+
/** Name of the generated keeper data volume claim template. */
|
|
14
|
+
const KEEPER_DATA_VOLUME_TEMPLATE = 'data-volume';
|
|
15
|
+
/**
|
|
16
|
+
* CHK Readiness Evaluator
|
|
17
|
+
*
|
|
18
|
+
* CHK reports the same `status.status` reconcile state machine as CHI
|
|
19
|
+
* ('InProgress' | 'Completed' | 'Aborted' | 'Terminating' — shared operator
|
|
20
|
+
* status code), so the CHI evaluator applies verbatim.
|
|
21
|
+
*/
|
|
22
|
+
export function chkReadinessEvaluator(liveResource) {
|
|
23
|
+
return chiReadinessEvaluator(liveResource);
|
|
24
|
+
}
|
|
25
|
+
/** Compile the high-level config into a CHK spec. */
|
|
26
|
+
function compileKeeperSpec(config) {
|
|
27
|
+
// LOUD build-time validation: the compiler BRANCHES on these (storage
|
|
28
|
+
// presence selects the volume-claim template block; replicas defaults via
|
|
29
|
+
// `?? 1`), so schema refs here would silently mis-compile. Storage SIZE and
|
|
30
|
+
// class are plain values and may be refs.
|
|
31
|
+
for (const field of ['storage', 'replicas']) {
|
|
32
|
+
if (isKubernetesRef(config[field]) || isCelExpression(config[field])) {
|
|
33
|
+
throw new Error(`clickHouseKeeperInstallation: '${field}' is a BUILD-TIME field and received a ` +
|
|
34
|
+
`schema reference or CEL expression — pass a concrete value (the compiler ` +
|
|
35
|
+
`branches on it at graph-construction time).`);
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const replicas = config.replicas ?? 1;
|
|
39
|
+
// A CHK layout with `replicasCount: 0` (or a fractional/negative count) is
|
|
40
|
+
// invalid operator input — same shared validation as the CHI paths.
|
|
41
|
+
assertPositiveIntegerCount('clickHouseKeeperInstallation', 'replicas', replicas);
|
|
42
|
+
return {
|
|
43
|
+
configuration: {
|
|
44
|
+
clusters: [
|
|
45
|
+
{
|
|
46
|
+
name: config.name,
|
|
47
|
+
layout: { replicasCount: replicas },
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
},
|
|
51
|
+
...(config.storage && {
|
|
52
|
+
defaults: {
|
|
53
|
+
templates: {
|
|
54
|
+
dataVolumeClaimTemplate: KEEPER_DATA_VOLUME_TEMPLATE,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
templates: {
|
|
58
|
+
volumeClaimTemplates: [
|
|
59
|
+
{
|
|
60
|
+
name: KEEPER_DATA_VOLUME_TEMPLATE,
|
|
61
|
+
spec: {
|
|
62
|
+
accessModes: ['ReadWriteOnce'],
|
|
63
|
+
resources: { requests: { storage: config.storage.size } },
|
|
64
|
+
// On EKS: use a WaitForFirstConsumer + expandable gp3 class.
|
|
65
|
+
...(config.storage.storageClassName && {
|
|
66
|
+
storageClassName: config.storage.storageClassName,
|
|
67
|
+
}),
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
}),
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* ClickHouseKeeperInstallation Factory
|
|
77
|
+
*
|
|
78
|
+
* @param config - High-level keeper configuration
|
|
79
|
+
* @returns Enhanced ClickHouseKeeperInstallation resource with readiness
|
|
80
|
+
* evaluation
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```typescript
|
|
84
|
+
* const keeper = clickHouseKeeperInstallation({
|
|
85
|
+
* name: 'keeper',
|
|
86
|
+
* namespace: 'observability',
|
|
87
|
+
* replicas: 3, // odd count for quorum
|
|
88
|
+
* storage: { size: '10Gi', storageClassName: 'gp3-expandable' },
|
|
89
|
+
* id: 'clickhouseKeeper',
|
|
90
|
+
* });
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
function createClickHouseKeeperInstallationResource(config) {
|
|
94
|
+
const spec = compileKeeperSpec(config);
|
|
95
|
+
return createResource({
|
|
96
|
+
apiVersion: 'clickhouse-keeper.altinity.com/v1',
|
|
97
|
+
kind: 'ClickHouseKeeperInstallation',
|
|
98
|
+
metadata: {
|
|
99
|
+
name: config.name,
|
|
100
|
+
...(config.namespace && { namespace: config.namespace }),
|
|
101
|
+
},
|
|
102
|
+
spec,
|
|
103
|
+
...(config.id && { id: config.id }),
|
|
104
|
+
}, { scope: 'namespaced', dnsAddressable: true }).withReadinessEvaluator(chkReadinessEvaluator);
|
|
105
|
+
}
|
|
106
|
+
export const clickHouseKeeperInstallation = createClickHouseKeeperInstallationResource;
|
|
107
|
+
//# sourceMappingURL=keeper.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"keeper.js","sourceRoot":"","sources":["../../../../src/factories/clickhouse/resources/keeper.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAGH,OAAO,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AACjF,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAMjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,mBA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