@kumulo/core 0.1.1
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/LICENSE +20 -0
- package/README.md +15 -0
- package/dist/config/decode.d.ts +5 -0
- package/dist/config/index.d.ts +3 -0
- package/dist/config/schema.d.ts +400 -0
- package/dist/config/yaml.d.ts +5 -0
- package/dist/dns/index.d.ts +2 -0
- package/dist/dns/ownership.d.ts +6 -0
- package/dist/dns-noop/index.d.ts +7 -0
- package/dist/domain/capabilities.d.ts +6 -0
- package/dist/domain/types.d.ts +175 -0
- package/dist/errors/renderer.d.ts +12 -0
- package/dist/errors/retryable.d.ts +2 -0
- package/dist/errors/tagged.d.ts +138 -0
- package/dist/index.d.ts +39 -0
- package/dist/index.mjs +602 -0
- package/dist/k8s/client.d.ts +23 -0
- package/dist/k8s/index.d.ts +7 -0
- package/dist/k8s/kubeconfig.d.ts +18 -0
- package/dist/k8s/node-ops.d.ts +19 -0
- package/dist/k8s/readiness.d.ts +12 -0
- package/dist/plan/diff.d.ts +12 -0
- package/dist/plan/hash.d.ts +2 -0
- package/dist/plan/index.d.ts +4 -0
- package/dist/plan/naming.d.ts +8 -0
- package/dist/plan/types.d.ts +29 -0
- package/dist/ports/addon.d.ts +13 -0
- package/dist/ports/cloud-provider.d.ts +19 -0
- package/dist/ports/credentials-sink.d.ts +10 -0
- package/dist/ports/distro.d.ts +29 -0
- package/dist/ports/dns-provider.d.ts +12 -0
- package/dist/ports/object-storage-provider.d.ts +14 -0
- package/dist/ports/provider-profile.d.ts +27 -0
- package/dist/ports/validation.d.ts +5 -0
- package/dist/ports/volume-provider.d.ts +14 -0
- package/dist/present/decide.d.ts +15 -0
- package/dist/present/index.d.ts +3 -0
- package/dist/present/render.d.ts +2 -0
- package/dist/profiles/generic.d.ts +22 -0
- package/dist/profiles/index.d.ts +1 -0
- package/dist/reconcile/apply.d.ts +8 -0
- package/dist/reconcile/index.d.ts +3 -0
- package/dist/reconcile/phases.d.ts +5 -0
- package/dist/reconcile/pipeline.d.ts +9 -0
- package/dist/reconcile/poll.d.ts +12 -0
- package/package.json +58 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 David Stahl-Gruber
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# @kumulo/core
|
|
2
|
+
|
|
3
|
+
Shared domain model for kumulo: config schema, ports (cloud/DNS/volume/storage providers), tagged errors and plan types.
|
|
4
|
+
|
|
5
|
+
Part of [kumulo](../../README.md) — a CLI that provisions and manages
|
|
6
|
+
Kubernetes clusters on OVH from a single YAML config. This package is
|
|
7
|
+
published from that workspace and is normally consumed through the `kumulo`
|
|
8
|
+
CLI rather than directly.
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
bun add @kumulo/core
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
See the [root README](../../README.md) for configuration, commands and
|
|
15
|
+
examples, and the [changelog](../../CHANGELOG.md) for release notes.
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { ConfigInvalid } from "../errors/tagged";
|
|
3
|
+
import { type ClusterConfig as ClusterConfigType } from "./schema";
|
|
4
|
+
export declare const decodeConfig: (input: unknown) => Effect.Effect<ClusterConfigType, ConfigInvalid>;
|
|
5
|
+
export declare const encodeConfig: (config: ClusterConfigType) => Effect.Effect<unknown, ConfigInvalid>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { decodeConfig, encodeConfig } from "./decode";
|
|
2
|
+
export { ClusterConfig, type ClusterConfigEncoded, K3sClusterConfig, type K3sClusterConfigEncoded, MksClusterConfig, type MksClusterConfigEncoded, OutputsFormat, type WorkerPool } from "./schema";
|
|
3
|
+
export { parseConfigYaml, stringifyConfigYaml } from "./yaml";
|
|
@@ -0,0 +1,400 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
declare const WorkerPool: Schema.Struct<{
|
|
3
|
+
readonly name: Schema.NonEmptyString;
|
|
4
|
+
readonly flavor: Schema.NonEmptyString;
|
|
5
|
+
readonly count: Schema.Number;
|
|
6
|
+
readonly labels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
7
|
+
readonly taints: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
8
|
+
readonly autoscaling: Schema.optionalKey<Schema.Struct<{
|
|
9
|
+
readonly enabled: Schema.Boolean;
|
|
10
|
+
readonly min: Schema.Number;
|
|
11
|
+
readonly max: Schema.Number;
|
|
12
|
+
}>>;
|
|
13
|
+
}>;
|
|
14
|
+
export declare const OutputsFormat: Schema.Literals<readonly ["yaml", "json"]>;
|
|
15
|
+
export type OutputsFormat = typeof OutputsFormat.Type;
|
|
16
|
+
export declare const K3sClusterConfig: Schema.Struct<{
|
|
17
|
+
readonly name: Schema.NonEmptyString;
|
|
18
|
+
readonly outputs: Schema.optionalKey<Schema.Struct<{
|
|
19
|
+
readonly format: Schema.Literals<readonly ["yaml", "json"]>;
|
|
20
|
+
}>>;
|
|
21
|
+
readonly auth: Schema.Struct<{
|
|
22
|
+
readonly method: Schema.Literals<readonly ["application_credential", "clouds_yaml", "env", "api_token"]>;
|
|
23
|
+
readonly region: Schema.NonEmptyString;
|
|
24
|
+
}>;
|
|
25
|
+
readonly worker_pools: Schema.$Array<Schema.Struct<{
|
|
26
|
+
readonly name: Schema.NonEmptyString;
|
|
27
|
+
readonly flavor: Schema.NonEmptyString;
|
|
28
|
+
readonly count: Schema.Number;
|
|
29
|
+
readonly labels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
30
|
+
readonly taints: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
31
|
+
readonly autoscaling: Schema.optionalKey<Schema.Struct<{
|
|
32
|
+
readonly enabled: Schema.Boolean;
|
|
33
|
+
readonly min: Schema.Number;
|
|
34
|
+
readonly max: Schema.Number;
|
|
35
|
+
}>>;
|
|
36
|
+
}>>;
|
|
37
|
+
readonly volumes: Schema.Union<readonly [Schema.Struct<{
|
|
38
|
+
readonly module: Schema.Literal<"none">;
|
|
39
|
+
}>, Schema.Struct<{
|
|
40
|
+
readonly module: Schema.Literal<"cinder">;
|
|
41
|
+
readonly managed: Schema.$Array<Schema.Struct<{
|
|
42
|
+
readonly name: Schema.NonEmptyString;
|
|
43
|
+
readonly size_gb: Schema.Number;
|
|
44
|
+
readonly type: Schema.NonEmptyString;
|
|
45
|
+
readonly retain: Schema.Boolean;
|
|
46
|
+
readonly pvc: Schema.optionalKey<Schema.Struct<{
|
|
47
|
+
readonly namespace: Schema.NonEmptyString;
|
|
48
|
+
readonly access_modes: Schema.$Array<Schema.Literals<readonly ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"]>>;
|
|
49
|
+
}>>;
|
|
50
|
+
}>>;
|
|
51
|
+
}>, Schema.Struct<{
|
|
52
|
+
readonly module: Schema.Literal<"hcloud">;
|
|
53
|
+
readonly managed: Schema.$Array<Schema.Struct<{
|
|
54
|
+
readonly name: Schema.NonEmptyString;
|
|
55
|
+
readonly size_gb: Schema.Number;
|
|
56
|
+
readonly type: Schema.NonEmptyString;
|
|
57
|
+
readonly retain: Schema.Boolean;
|
|
58
|
+
readonly pvc: Schema.optionalKey<Schema.Struct<{
|
|
59
|
+
readonly namespace: Schema.NonEmptyString;
|
|
60
|
+
readonly access_modes: Schema.$Array<Schema.Literals<readonly ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"]>>;
|
|
61
|
+
}>>;
|
|
62
|
+
}>>;
|
|
63
|
+
}>]>;
|
|
64
|
+
readonly object_storage: Schema.Union<readonly [Schema.Struct<{
|
|
65
|
+
readonly module: Schema.Literal<"none">;
|
|
66
|
+
}>, Schema.Struct<{
|
|
67
|
+
readonly module: Schema.Literal<"ovh">;
|
|
68
|
+
readonly buckets: Schema.$Array<Schema.Struct<{
|
|
69
|
+
readonly name: Schema.String;
|
|
70
|
+
readonly region: Schema.NonEmptyString;
|
|
71
|
+
readonly versioning: Schema.Boolean;
|
|
72
|
+
readonly encryption: Schema.Boolean;
|
|
73
|
+
readonly retain: Schema.Boolean;
|
|
74
|
+
}>>;
|
|
75
|
+
}>]>;
|
|
76
|
+
readonly secrets: Schema.Union<readonly [Schema.Struct<{
|
|
77
|
+
readonly sink: Schema.Literal<"none">;
|
|
78
|
+
}>, Schema.Struct<{
|
|
79
|
+
readonly sink: Schema.Literal<"sops">;
|
|
80
|
+
readonly dir: Schema.NonEmptyString;
|
|
81
|
+
readonly sops: Schema.Struct<{
|
|
82
|
+
readonly age_recipient: Schema.String;
|
|
83
|
+
}>;
|
|
84
|
+
}>]>;
|
|
85
|
+
readonly provider: Schema.Literals<readonly ["ovh", "generic", "hetzner"]>;
|
|
86
|
+
readonly distro: Schema.Literal<"k3s">;
|
|
87
|
+
readonly version: Schema.String;
|
|
88
|
+
readonly dns: Schema.Union<readonly [Schema.Struct<{
|
|
89
|
+
readonly module: Schema.Literal<"none">;
|
|
90
|
+
}>, Schema.Struct<{
|
|
91
|
+
readonly module: Schema.Literals<readonly ["ovh", "hetzner"]>;
|
|
92
|
+
readonly zone: Schema.NonEmptyString;
|
|
93
|
+
readonly ttl: Schema.Number;
|
|
94
|
+
readonly records: Schema.$Array<Schema.Struct<{
|
|
95
|
+
readonly name: Schema.NonEmptyString;
|
|
96
|
+
readonly target: Schema.NonEmptyString;
|
|
97
|
+
}>>;
|
|
98
|
+
}>]>;
|
|
99
|
+
readonly network: Schema.Struct<{
|
|
100
|
+
readonly cidr: Schema.String;
|
|
101
|
+
readonly public_access: Schema.Literals<readonly ["bastionless", "nat"]>;
|
|
102
|
+
}>;
|
|
103
|
+
readonly api_server: Schema.Struct<{
|
|
104
|
+
readonly high_availability: Schema.Boolean;
|
|
105
|
+
readonly allowed_cidrs: Schema.$Array<Schema.String>;
|
|
106
|
+
}>;
|
|
107
|
+
readonly ssh: Schema.Struct<{
|
|
108
|
+
readonly public_key_path: Schema.NonEmptyString;
|
|
109
|
+
readonly allowed_cidrs: Schema.$Array<Schema.String>;
|
|
110
|
+
}>;
|
|
111
|
+
readonly masters: Schema.Struct<{
|
|
112
|
+
readonly flavor: Schema.NonEmptyString;
|
|
113
|
+
readonly count: Schema.Number;
|
|
114
|
+
readonly image: Schema.NonEmptyString;
|
|
115
|
+
}>;
|
|
116
|
+
readonly addons: Schema.Struct<{
|
|
117
|
+
readonly cloud_controller_manager: Schema.Boolean;
|
|
118
|
+
readonly cinder_csi: Schema.Struct<{
|
|
119
|
+
readonly enabled: Schema.Boolean;
|
|
120
|
+
readonly default_volume_type: Schema.NonEmptyString;
|
|
121
|
+
}>;
|
|
122
|
+
readonly hcloud_csi: Schema.Struct<{
|
|
123
|
+
readonly enabled: Schema.Boolean;
|
|
124
|
+
}>;
|
|
125
|
+
readonly system_upgrade_controller: Schema.Boolean;
|
|
126
|
+
readonly cni: Schema.Literals<readonly ["flannel", "cilium"]>;
|
|
127
|
+
}>;
|
|
128
|
+
readonly k3s: Schema.Struct<{
|
|
129
|
+
readonly extra_server_args: Schema.$Array<Schema.String>;
|
|
130
|
+
readonly extra_agent_args: Schema.$Array<Schema.String>;
|
|
131
|
+
}>;
|
|
132
|
+
}>;
|
|
133
|
+
export declare const MksClusterConfig: Schema.Struct<{
|
|
134
|
+
readonly name: Schema.NonEmptyString;
|
|
135
|
+
readonly outputs: Schema.optionalKey<Schema.Struct<{
|
|
136
|
+
readonly format: Schema.Literals<readonly ["yaml", "json"]>;
|
|
137
|
+
}>>;
|
|
138
|
+
readonly auth: Schema.Struct<{
|
|
139
|
+
readonly method: Schema.Literals<readonly ["application_credential", "clouds_yaml", "env", "api_token"]>;
|
|
140
|
+
readonly region: Schema.NonEmptyString;
|
|
141
|
+
}>;
|
|
142
|
+
readonly worker_pools: Schema.$Array<Schema.Struct<{
|
|
143
|
+
readonly name: Schema.NonEmptyString;
|
|
144
|
+
readonly flavor: Schema.NonEmptyString;
|
|
145
|
+
readonly count: Schema.Number;
|
|
146
|
+
readonly labels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
147
|
+
readonly taints: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
148
|
+
readonly autoscaling: Schema.optionalKey<Schema.Struct<{
|
|
149
|
+
readonly enabled: Schema.Boolean;
|
|
150
|
+
readonly min: Schema.Number;
|
|
151
|
+
readonly max: Schema.Number;
|
|
152
|
+
}>>;
|
|
153
|
+
}>>;
|
|
154
|
+
readonly object_storage: Schema.Union<readonly [Schema.Struct<{
|
|
155
|
+
readonly module: Schema.Literal<"none">;
|
|
156
|
+
}>, Schema.Struct<{
|
|
157
|
+
readonly module: Schema.Literal<"ovh">;
|
|
158
|
+
readonly buckets: Schema.$Array<Schema.Struct<{
|
|
159
|
+
readonly name: Schema.String;
|
|
160
|
+
readonly region: Schema.NonEmptyString;
|
|
161
|
+
readonly versioning: Schema.Boolean;
|
|
162
|
+
readonly encryption: Schema.Boolean;
|
|
163
|
+
readonly retain: Schema.Boolean;
|
|
164
|
+
}>>;
|
|
165
|
+
}>]>;
|
|
166
|
+
readonly secrets: Schema.Union<readonly [Schema.Struct<{
|
|
167
|
+
readonly sink: Schema.Literal<"none">;
|
|
168
|
+
}>, Schema.Struct<{
|
|
169
|
+
readonly sink: Schema.Literal<"sops">;
|
|
170
|
+
readonly dir: Schema.NonEmptyString;
|
|
171
|
+
readonly sops: Schema.Struct<{
|
|
172
|
+
readonly age_recipient: Schema.String;
|
|
173
|
+
}>;
|
|
174
|
+
}>]>;
|
|
175
|
+
readonly provider: Schema.Literal<"ovh">;
|
|
176
|
+
readonly distro: Schema.Literal<"ovh-mks">;
|
|
177
|
+
readonly version: Schema.String;
|
|
178
|
+
readonly dns: Schema.Union<readonly [Schema.Struct<{
|
|
179
|
+
readonly module: Schema.Literal<"none">;
|
|
180
|
+
}>, Schema.Struct<{
|
|
181
|
+
readonly module: Schema.Literals<readonly ["ovh", "hetzner"]>;
|
|
182
|
+
readonly zone: Schema.NonEmptyString;
|
|
183
|
+
readonly ttl: Schema.Number;
|
|
184
|
+
readonly records: Schema.$Array<Schema.Struct<{
|
|
185
|
+
readonly name: Schema.NonEmptyString;
|
|
186
|
+
readonly target: Schema.NonEmptyString;
|
|
187
|
+
}>>;
|
|
188
|
+
}>]>;
|
|
189
|
+
readonly volumes: Schema.Union<readonly [Schema.Struct<{
|
|
190
|
+
readonly module: Schema.Literal<"none">;
|
|
191
|
+
}>, Schema.Struct<{
|
|
192
|
+
readonly module: Schema.Literal<"cinder">;
|
|
193
|
+
readonly managed: Schema.$Array<Schema.Struct<{
|
|
194
|
+
readonly name: Schema.NonEmptyString;
|
|
195
|
+
readonly size_gb: Schema.Number;
|
|
196
|
+
readonly type: Schema.NonEmptyString;
|
|
197
|
+
readonly retain: Schema.Boolean;
|
|
198
|
+
readonly pvc: Schema.optionalKey<Schema.Struct<{
|
|
199
|
+
readonly namespace: Schema.NonEmptyString;
|
|
200
|
+
readonly access_modes: Schema.$Array<Schema.Literals<readonly ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"]>>;
|
|
201
|
+
}>>;
|
|
202
|
+
}>>;
|
|
203
|
+
}>]>;
|
|
204
|
+
}>;
|
|
205
|
+
export declare const ClusterConfig: Schema.Union<readonly [Schema.Struct<{
|
|
206
|
+
readonly name: Schema.NonEmptyString;
|
|
207
|
+
readonly outputs: Schema.optionalKey<Schema.Struct<{
|
|
208
|
+
readonly format: Schema.Literals<readonly ["yaml", "json"]>;
|
|
209
|
+
}>>;
|
|
210
|
+
readonly auth: Schema.Struct<{
|
|
211
|
+
readonly method: Schema.Literals<readonly ["application_credential", "clouds_yaml", "env", "api_token"]>;
|
|
212
|
+
readonly region: Schema.NonEmptyString;
|
|
213
|
+
}>;
|
|
214
|
+
readonly worker_pools: Schema.$Array<Schema.Struct<{
|
|
215
|
+
readonly name: Schema.NonEmptyString;
|
|
216
|
+
readonly flavor: Schema.NonEmptyString;
|
|
217
|
+
readonly count: Schema.Number;
|
|
218
|
+
readonly labels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
219
|
+
readonly taints: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
220
|
+
readonly autoscaling: Schema.optionalKey<Schema.Struct<{
|
|
221
|
+
readonly enabled: Schema.Boolean;
|
|
222
|
+
readonly min: Schema.Number;
|
|
223
|
+
readonly max: Schema.Number;
|
|
224
|
+
}>>;
|
|
225
|
+
}>>;
|
|
226
|
+
readonly volumes: Schema.Union<readonly [Schema.Struct<{
|
|
227
|
+
readonly module: Schema.Literal<"none">;
|
|
228
|
+
}>, Schema.Struct<{
|
|
229
|
+
readonly module: Schema.Literal<"cinder">;
|
|
230
|
+
readonly managed: Schema.$Array<Schema.Struct<{
|
|
231
|
+
readonly name: Schema.NonEmptyString;
|
|
232
|
+
readonly size_gb: Schema.Number;
|
|
233
|
+
readonly type: Schema.NonEmptyString;
|
|
234
|
+
readonly retain: Schema.Boolean;
|
|
235
|
+
readonly pvc: Schema.optionalKey<Schema.Struct<{
|
|
236
|
+
readonly namespace: Schema.NonEmptyString;
|
|
237
|
+
readonly access_modes: Schema.$Array<Schema.Literals<readonly ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"]>>;
|
|
238
|
+
}>>;
|
|
239
|
+
}>>;
|
|
240
|
+
}>, Schema.Struct<{
|
|
241
|
+
readonly module: Schema.Literal<"hcloud">;
|
|
242
|
+
readonly managed: Schema.$Array<Schema.Struct<{
|
|
243
|
+
readonly name: Schema.NonEmptyString;
|
|
244
|
+
readonly size_gb: Schema.Number;
|
|
245
|
+
readonly type: Schema.NonEmptyString;
|
|
246
|
+
readonly retain: Schema.Boolean;
|
|
247
|
+
readonly pvc: Schema.optionalKey<Schema.Struct<{
|
|
248
|
+
readonly namespace: Schema.NonEmptyString;
|
|
249
|
+
readonly access_modes: Schema.$Array<Schema.Literals<readonly ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"]>>;
|
|
250
|
+
}>>;
|
|
251
|
+
}>>;
|
|
252
|
+
}>]>;
|
|
253
|
+
readonly object_storage: Schema.Union<readonly [Schema.Struct<{
|
|
254
|
+
readonly module: Schema.Literal<"none">;
|
|
255
|
+
}>, Schema.Struct<{
|
|
256
|
+
readonly module: Schema.Literal<"ovh">;
|
|
257
|
+
readonly buckets: Schema.$Array<Schema.Struct<{
|
|
258
|
+
readonly name: Schema.String;
|
|
259
|
+
readonly region: Schema.NonEmptyString;
|
|
260
|
+
readonly versioning: Schema.Boolean;
|
|
261
|
+
readonly encryption: Schema.Boolean;
|
|
262
|
+
readonly retain: Schema.Boolean;
|
|
263
|
+
}>>;
|
|
264
|
+
}>]>;
|
|
265
|
+
readonly secrets: Schema.Union<readonly [Schema.Struct<{
|
|
266
|
+
readonly sink: Schema.Literal<"none">;
|
|
267
|
+
}>, Schema.Struct<{
|
|
268
|
+
readonly sink: Schema.Literal<"sops">;
|
|
269
|
+
readonly dir: Schema.NonEmptyString;
|
|
270
|
+
readonly sops: Schema.Struct<{
|
|
271
|
+
readonly age_recipient: Schema.String;
|
|
272
|
+
}>;
|
|
273
|
+
}>]>;
|
|
274
|
+
readonly provider: Schema.Literals<readonly ["ovh", "generic", "hetzner"]>;
|
|
275
|
+
readonly distro: Schema.Literal<"k3s">;
|
|
276
|
+
readonly version: Schema.String;
|
|
277
|
+
readonly dns: Schema.Union<readonly [Schema.Struct<{
|
|
278
|
+
readonly module: Schema.Literal<"none">;
|
|
279
|
+
}>, Schema.Struct<{
|
|
280
|
+
readonly module: Schema.Literals<readonly ["ovh", "hetzner"]>;
|
|
281
|
+
readonly zone: Schema.NonEmptyString;
|
|
282
|
+
readonly ttl: Schema.Number;
|
|
283
|
+
readonly records: Schema.$Array<Schema.Struct<{
|
|
284
|
+
readonly name: Schema.NonEmptyString;
|
|
285
|
+
readonly target: Schema.NonEmptyString;
|
|
286
|
+
}>>;
|
|
287
|
+
}>]>;
|
|
288
|
+
readonly network: Schema.Struct<{
|
|
289
|
+
readonly cidr: Schema.String;
|
|
290
|
+
readonly public_access: Schema.Literals<readonly ["bastionless", "nat"]>;
|
|
291
|
+
}>;
|
|
292
|
+
readonly api_server: Schema.Struct<{
|
|
293
|
+
readonly high_availability: Schema.Boolean;
|
|
294
|
+
readonly allowed_cidrs: Schema.$Array<Schema.String>;
|
|
295
|
+
}>;
|
|
296
|
+
readonly ssh: Schema.Struct<{
|
|
297
|
+
readonly public_key_path: Schema.NonEmptyString;
|
|
298
|
+
readonly allowed_cidrs: Schema.$Array<Schema.String>;
|
|
299
|
+
}>;
|
|
300
|
+
readonly masters: Schema.Struct<{
|
|
301
|
+
readonly flavor: Schema.NonEmptyString;
|
|
302
|
+
readonly count: Schema.Number;
|
|
303
|
+
readonly image: Schema.NonEmptyString;
|
|
304
|
+
}>;
|
|
305
|
+
readonly addons: Schema.Struct<{
|
|
306
|
+
readonly cloud_controller_manager: Schema.Boolean;
|
|
307
|
+
readonly cinder_csi: Schema.Struct<{
|
|
308
|
+
readonly enabled: Schema.Boolean;
|
|
309
|
+
readonly default_volume_type: Schema.NonEmptyString;
|
|
310
|
+
}>;
|
|
311
|
+
readonly hcloud_csi: Schema.Struct<{
|
|
312
|
+
readonly enabled: Schema.Boolean;
|
|
313
|
+
}>;
|
|
314
|
+
readonly system_upgrade_controller: Schema.Boolean;
|
|
315
|
+
readonly cni: Schema.Literals<readonly ["flannel", "cilium"]>;
|
|
316
|
+
}>;
|
|
317
|
+
readonly k3s: Schema.Struct<{
|
|
318
|
+
readonly extra_server_args: Schema.$Array<Schema.String>;
|
|
319
|
+
readonly extra_agent_args: Schema.$Array<Schema.String>;
|
|
320
|
+
}>;
|
|
321
|
+
}>, Schema.Struct<{
|
|
322
|
+
readonly name: Schema.NonEmptyString;
|
|
323
|
+
readonly outputs: Schema.optionalKey<Schema.Struct<{
|
|
324
|
+
readonly format: Schema.Literals<readonly ["yaml", "json"]>;
|
|
325
|
+
}>>;
|
|
326
|
+
readonly auth: Schema.Struct<{
|
|
327
|
+
readonly method: Schema.Literals<readonly ["application_credential", "clouds_yaml", "env", "api_token"]>;
|
|
328
|
+
readonly region: Schema.NonEmptyString;
|
|
329
|
+
}>;
|
|
330
|
+
readonly worker_pools: Schema.$Array<Schema.Struct<{
|
|
331
|
+
readonly name: Schema.NonEmptyString;
|
|
332
|
+
readonly flavor: Schema.NonEmptyString;
|
|
333
|
+
readonly count: Schema.Number;
|
|
334
|
+
readonly labels: Schema.optionalKey<Schema.$Record<Schema.String, Schema.String>>;
|
|
335
|
+
readonly taints: Schema.optionalKey<Schema.$Array<Schema.String>>;
|
|
336
|
+
readonly autoscaling: Schema.optionalKey<Schema.Struct<{
|
|
337
|
+
readonly enabled: Schema.Boolean;
|
|
338
|
+
readonly min: Schema.Number;
|
|
339
|
+
readonly max: Schema.Number;
|
|
340
|
+
}>>;
|
|
341
|
+
}>>;
|
|
342
|
+
readonly object_storage: Schema.Union<readonly [Schema.Struct<{
|
|
343
|
+
readonly module: Schema.Literal<"none">;
|
|
344
|
+
}>, Schema.Struct<{
|
|
345
|
+
readonly module: Schema.Literal<"ovh">;
|
|
346
|
+
readonly buckets: Schema.$Array<Schema.Struct<{
|
|
347
|
+
readonly name: Schema.String;
|
|
348
|
+
readonly region: Schema.NonEmptyString;
|
|
349
|
+
readonly versioning: Schema.Boolean;
|
|
350
|
+
readonly encryption: Schema.Boolean;
|
|
351
|
+
readonly retain: Schema.Boolean;
|
|
352
|
+
}>>;
|
|
353
|
+
}>]>;
|
|
354
|
+
readonly secrets: Schema.Union<readonly [Schema.Struct<{
|
|
355
|
+
readonly sink: Schema.Literal<"none">;
|
|
356
|
+
}>, Schema.Struct<{
|
|
357
|
+
readonly sink: Schema.Literal<"sops">;
|
|
358
|
+
readonly dir: Schema.NonEmptyString;
|
|
359
|
+
readonly sops: Schema.Struct<{
|
|
360
|
+
readonly age_recipient: Schema.String;
|
|
361
|
+
}>;
|
|
362
|
+
}>]>;
|
|
363
|
+
readonly provider: Schema.Literal<"ovh">;
|
|
364
|
+
readonly distro: Schema.Literal<"ovh-mks">;
|
|
365
|
+
readonly version: Schema.String;
|
|
366
|
+
readonly dns: Schema.Union<readonly [Schema.Struct<{
|
|
367
|
+
readonly module: Schema.Literal<"none">;
|
|
368
|
+
}>, Schema.Struct<{
|
|
369
|
+
readonly module: Schema.Literals<readonly ["ovh", "hetzner"]>;
|
|
370
|
+
readonly zone: Schema.NonEmptyString;
|
|
371
|
+
readonly ttl: Schema.Number;
|
|
372
|
+
readonly records: Schema.$Array<Schema.Struct<{
|
|
373
|
+
readonly name: Schema.NonEmptyString;
|
|
374
|
+
readonly target: Schema.NonEmptyString;
|
|
375
|
+
}>>;
|
|
376
|
+
}>]>;
|
|
377
|
+
readonly volumes: Schema.Union<readonly [Schema.Struct<{
|
|
378
|
+
readonly module: Schema.Literal<"none">;
|
|
379
|
+
}>, Schema.Struct<{
|
|
380
|
+
readonly module: Schema.Literal<"cinder">;
|
|
381
|
+
readonly managed: Schema.$Array<Schema.Struct<{
|
|
382
|
+
readonly name: Schema.NonEmptyString;
|
|
383
|
+
readonly size_gb: Schema.Number;
|
|
384
|
+
readonly type: Schema.NonEmptyString;
|
|
385
|
+
readonly retain: Schema.Boolean;
|
|
386
|
+
readonly pvc: Schema.optionalKey<Schema.Struct<{
|
|
387
|
+
readonly namespace: Schema.NonEmptyString;
|
|
388
|
+
readonly access_modes: Schema.$Array<Schema.Literals<readonly ["ReadWriteOnce", "ReadWriteMany", "ReadOnlyMany"]>>;
|
|
389
|
+
}>>;
|
|
390
|
+
}>>;
|
|
391
|
+
}>]>;
|
|
392
|
+
}>]>;
|
|
393
|
+
export type K3sClusterConfig = typeof K3sClusterConfig.Type;
|
|
394
|
+
export type K3sClusterConfigEncoded = typeof K3sClusterConfig.Encoded;
|
|
395
|
+
export type MksClusterConfig = typeof MksClusterConfig.Type;
|
|
396
|
+
export type MksClusterConfigEncoded = typeof MksClusterConfig.Encoded;
|
|
397
|
+
export type ClusterConfig = typeof ClusterConfig.Type;
|
|
398
|
+
export type ClusterConfigEncoded = typeof ClusterConfig.Encoded;
|
|
399
|
+
export type WorkerPool = typeof WorkerPool.Type;
|
|
400
|
+
export {};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Effect } from "effect";
|
|
2
|
+
import { ConfigInvalid } from "../errors/tagged";
|
|
3
|
+
import type { ClusterConfig } from "./schema";
|
|
4
|
+
export declare const parseConfigYaml: (text: string) => Effect.Effect<ClusterConfig, ConfigInvalid>;
|
|
5
|
+
export declare const stringifyConfigYaml: (config: ClusterConfig) => string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const OWNERSHIP_PREFIX = "kumulo.cluster=";
|
|
2
|
+
export declare const ownershipTarget: (tag: string) => string;
|
|
3
|
+
export declare const ownerTagOf: (target: string) => string | undefined;
|
|
4
|
+
export type DnsRecordKind = "TXT" | "A" | "AAAA" | "CNAME";
|
|
5
|
+
/** Record type inferred from the resolved target value (no explicit field on `DesiredRecord`). */
|
|
6
|
+
export declare const recordKind: (target: string) => DnsRecordKind;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Effect, Layer } from "effect";
|
|
2
|
+
import { DnsProvider } from "../ports/dns-provider";
|
|
3
|
+
export declare const dnsNoop: {
|
|
4
|
+
ensureRecords: () => Effect.Effect<void, never, never>;
|
|
5
|
+
removeClusterRecords: () => Effect.Effect<void, never, never>;
|
|
6
|
+
};
|
|
7
|
+
export declare const dnsNoopLive: Layer.Layer<DnsProvider, never, never>;
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import type { Redacted } from "effect";
|
|
2
|
+
export type ClusterTag = string;
|
|
3
|
+
export type NodeRole = "master" | "worker";
|
|
4
|
+
export type DistroKind = "k3s" | "ovh-mks";
|
|
5
|
+
export type Capability = "octavia" | "floatingIps" | "cilium";
|
|
6
|
+
export type Version = string;
|
|
7
|
+
export interface NetworkSpec {
|
|
8
|
+
readonly cidr: string;
|
|
9
|
+
}
|
|
10
|
+
export interface NetworkInfo {
|
|
11
|
+
readonly id: string;
|
|
12
|
+
readonly cidr: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Provider-neutral ingress rule — the intersection of what Neutron
|
|
16
|
+
* security-group-rules and Hetzner firewall rules actually need. Egress is
|
|
17
|
+
* not modelled (both providers default to allow-all out).
|
|
18
|
+
*/
|
|
19
|
+
export interface SecGroupRule {
|
|
20
|
+
readonly protocol: "tcp" | "udp" | "icmp" | "any";
|
|
21
|
+
/** Omitted port range means "all ports" for tcp/udp. */
|
|
22
|
+
readonly portMin?: number;
|
|
23
|
+
readonly portMax?: number;
|
|
24
|
+
/** Ingress source; omitted when `remoteGroupSelf` is set. */
|
|
25
|
+
readonly remoteCidr?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Source is the cluster's own members. Providers without a self-reference
|
|
28
|
+
* concept (Hetzner) resolve this to the cluster network CIDR.
|
|
29
|
+
*/
|
|
30
|
+
readonly remoteGroupSelf?: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SecGroupSpec {
|
|
33
|
+
readonly rules: ReadonlyArray<SecGroupRule>;
|
|
34
|
+
}
|
|
35
|
+
export interface SecGroupInfo {
|
|
36
|
+
readonly id: string;
|
|
37
|
+
}
|
|
38
|
+
export interface LbSpec {
|
|
39
|
+
readonly members: ReadonlyArray<string>;
|
|
40
|
+
}
|
|
41
|
+
export interface LbInfo {
|
|
42
|
+
readonly id: string;
|
|
43
|
+
readonly vip: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ServerSpec {
|
|
46
|
+
readonly name: string;
|
|
47
|
+
readonly role: NodeRole;
|
|
48
|
+
readonly flavor: string;
|
|
49
|
+
readonly image: string;
|
|
50
|
+
readonly tag: ClusterTag;
|
|
51
|
+
}
|
|
52
|
+
export interface ServerInfo {
|
|
53
|
+
readonly id: string;
|
|
54
|
+
readonly name: string;
|
|
55
|
+
readonly ip: string;
|
|
56
|
+
readonly configHash?: string | undefined;
|
|
57
|
+
}
|
|
58
|
+
export type ImageRef = string;
|
|
59
|
+
export type ImageId = string;
|
|
60
|
+
export type FlavorRef = string;
|
|
61
|
+
export type FlavorId = string;
|
|
62
|
+
export interface Inventory {
|
|
63
|
+
readonly servers: ReadonlyArray<ServerInfo>;
|
|
64
|
+
readonly networks: ReadonlyArray<NetworkInfo>;
|
|
65
|
+
readonly securityGroups: ReadonlyArray<SecGroupInfo>;
|
|
66
|
+
readonly loadBalancers: ReadonlyArray<LbInfo>;
|
|
67
|
+
}
|
|
68
|
+
export interface ManagedClusterRef {
|
|
69
|
+
readonly id: string;
|
|
70
|
+
}
|
|
71
|
+
export interface ManagedClusterInfo {
|
|
72
|
+
readonly id: string;
|
|
73
|
+
readonly apiEndpoint: string;
|
|
74
|
+
readonly status: string;
|
|
75
|
+
}
|
|
76
|
+
export interface Kubeconfig {
|
|
77
|
+
readonly content: string;
|
|
78
|
+
}
|
|
79
|
+
export interface SshTarget {
|
|
80
|
+
readonly host: string;
|
|
81
|
+
readonly user: string;
|
|
82
|
+
}
|
|
83
|
+
export interface NodeContext {
|
|
84
|
+
readonly name: string;
|
|
85
|
+
readonly role: NodeRole;
|
|
86
|
+
readonly token?: string;
|
|
87
|
+
readonly apiEndpoint: string;
|
|
88
|
+
}
|
|
89
|
+
export interface BootstrapPlan {
|
|
90
|
+
readonly order: ReadonlyArray<string>;
|
|
91
|
+
}
|
|
92
|
+
export interface NodeRef {
|
|
93
|
+
readonly name: string;
|
|
94
|
+
readonly role: NodeRole;
|
|
95
|
+
}
|
|
96
|
+
export interface ResolvedVersion {
|
|
97
|
+
readonly value: string;
|
|
98
|
+
}
|
|
99
|
+
export interface K8sManifest {
|
|
100
|
+
readonly apiVersion: string;
|
|
101
|
+
readonly kind: string;
|
|
102
|
+
readonly [key: string]: unknown;
|
|
103
|
+
}
|
|
104
|
+
export interface AddonContext {
|
|
105
|
+
readonly clusterName: string;
|
|
106
|
+
readonly capabilities: ReadonlyArray<Capability>;
|
|
107
|
+
}
|
|
108
|
+
export interface DesiredRecord {
|
|
109
|
+
readonly name: string;
|
|
110
|
+
readonly target: "api_server" | "ingress" | string;
|
|
111
|
+
}
|
|
112
|
+
export interface VolumeSpec {
|
|
113
|
+
readonly name: string;
|
|
114
|
+
readonly sizeGb: number;
|
|
115
|
+
readonly type: string;
|
|
116
|
+
readonly retain: boolean;
|
|
117
|
+
}
|
|
118
|
+
export interface VolumeInfo {
|
|
119
|
+
readonly id: string;
|
|
120
|
+
readonly name: string;
|
|
121
|
+
}
|
|
122
|
+
export interface VolumeRef {
|
|
123
|
+
readonly id: string;
|
|
124
|
+
}
|
|
125
|
+
export interface BucketSpec {
|
|
126
|
+
readonly name: string;
|
|
127
|
+
readonly region: string;
|
|
128
|
+
readonly versioning: boolean;
|
|
129
|
+
readonly encryption: boolean;
|
|
130
|
+
readonly retain: boolean;
|
|
131
|
+
}
|
|
132
|
+
export interface BucketInfo {
|
|
133
|
+
readonly name: string;
|
|
134
|
+
readonly region: string;
|
|
135
|
+
readonly endpoint: string;
|
|
136
|
+
}
|
|
137
|
+
export interface BucketRef {
|
|
138
|
+
readonly name: string;
|
|
139
|
+
readonly region: string;
|
|
140
|
+
}
|
|
141
|
+
export interface S3Credentials {
|
|
142
|
+
readonly user: string;
|
|
143
|
+
readonly accessKey: Redacted.Redacted<string>;
|
|
144
|
+
readonly secretKey: Redacted.Redacted<string>;
|
|
145
|
+
readonly buckets: ReadonlyArray<BucketInfo>;
|
|
146
|
+
}
|
|
147
|
+
export interface CredentialEntry {
|
|
148
|
+
readonly key: string;
|
|
149
|
+
readonly value: Redacted.Redacted<string>;
|
|
150
|
+
}
|
|
151
|
+
export interface AutoscalingRule {
|
|
152
|
+
readonly enabled: boolean;
|
|
153
|
+
}
|
|
154
|
+
export interface WorkerPoolShape {
|
|
155
|
+
readonly name: string;
|
|
156
|
+
readonly autoscaling?: AutoscalingRule;
|
|
157
|
+
}
|
|
158
|
+
export interface ClusterConfigShape {
|
|
159
|
+
readonly distro: DistroKind;
|
|
160
|
+
readonly worker_pools: ReadonlyArray<WorkerPoolShape>;
|
|
161
|
+
readonly addons: {
|
|
162
|
+
readonly cni: "flannel" | "cilium";
|
|
163
|
+
};
|
|
164
|
+
readonly auth?: {
|
|
165
|
+
readonly region: string;
|
|
166
|
+
};
|
|
167
|
+
readonly api_server?: {
|
|
168
|
+
readonly high_availability: boolean;
|
|
169
|
+
};
|
|
170
|
+
readonly volumes?: {
|
|
171
|
+
readonly managed: ReadonlyArray<{
|
|
172
|
+
readonly type: string;
|
|
173
|
+
}>;
|
|
174
|
+
};
|
|
175
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KumuloError, KumuloErrorTag } from "./tagged";
|
|
2
|
+
export type RendererRegistry = {
|
|
3
|
+
readonly [Tag in KumuloErrorTag]: (error: Extract<KumuloError, {
|
|
4
|
+
readonly _tag: Tag;
|
|
5
|
+
}>) => string;
|
|
6
|
+
};
|
|
7
|
+
export declare const renderError: <Tag extends KumuloErrorTag>(args: {
|
|
8
|
+
readonly registry: RendererRegistry;
|
|
9
|
+
readonly error: Extract<KumuloError, {
|
|
10
|
+
readonly _tag: Tag;
|
|
11
|
+
}>;
|
|
12
|
+
}) => string;
|