@intentius/chant-lexicon-cpln 0.124.30 → 0.124.32
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/api.js +88 -0
- package/dist/codegen/docs-cli.js +6 -0
- package/dist/codegen/docs.js +85 -0
- package/dist/codegen/generate-cli.js +25 -0
- package/dist/codegen/generate-lexicon.js +50 -0
- package/dist/codegen/generate-typescript.js +48 -0
- package/dist/codegen/generate.js +86 -0
- package/dist/codegen/naming.js +43 -0
- package/dist/codegen/package.js +31 -0
- package/dist/composites/catalog.js +556 -0
- package/dist/composites/cron-job.js +52 -0
- package/dist/composites/gvc-environment.js +49 -0
- package/dist/composites/index.js +6 -0
- package/dist/composites/public-domain.js +70 -0
- package/dist/composites/secret-access.js +82 -0
- package/dist/composites/serverless-service.js +58 -0
- package/dist/composites/stateful-service.js +87 -0
- package/dist/coverage.js +104 -0
- package/dist/describe-resources.js +264 -0
- package/dist/detect.js +52 -0
- package/dist/entity-props.js +100 -0
- package/dist/generated/index.js +169 -0
- package/dist/generated/runtime.js +4 -0
- package/dist/index.js +14 -0
- package/dist/init-templates.js +125 -0
- package/dist/integrity.json +2 -2
- package/dist/kinds.js +134 -0
- package/dist/lint/audit-catalog.js +90 -0
- package/dist/lint/audit-lineage.js +32 -0
- package/dist/lint/post-synth/cpl010-unrestricted-outbound.js +34 -0
- package/dist/lint/post-synth/cpl011-internal-firewall-scope.js +32 -0
- package/dist/lint/post-synth/cpl012-no-literal-credential-env.js +51 -0
- package/dist/lint/post-synth/cpl013-qualified-identity-principal.js +40 -0
- package/dist/lint/post-synth/cpl014-qualified-secret-ref.js +47 -0
- package/dist/lint/post-synth/cpl020-serverless-single-port.js +51 -0
- package/dist/lint/post-synth/cpl021-cron-job-shape.js +55 -0
- package/dist/lint/post-synth/cpl022-container-ports.js +53 -0
- package/dist/lint/post-synth/cpl023-container-resources.js +73 -0
- package/dist/lint/post-synth/cpl024-probe-handler.js +43 -0
- package/dist/lint/post-synth/cpl025-autoscaling-shape.js +84 -0
- package/dist/lint/post-synth/cpl026-scale-to-zero.js +59 -0
- package/dist/lint/post-synth/cpl027-capacity-ai-conflict.js +67 -0
- package/dist/lint/post-synth/cpl028-volume-set.js +155 -0
- package/dist/lint/post-synth/cpl029-link-targets.js +140 -0
- package/dist/lint/post-synth/cpl030-domain-routing.js +114 -0
- package/dist/lint/post-synth/cpl040-pinned-image.js +41 -0
- package/dist/lint/post-synth/cpl041-image-reference-form.js +52 -0
- package/dist/lint/post-synth/cpl042-gvc-placement.js +49 -0
- package/dist/lint/post-synth/cpl043-policy-scope.js +0 -0
- package/dist/lint/post-synth/helpers.js +102 -0
- package/dist/lint/post-synth/index.js +42 -0
- package/dist/lint/rules/cpl001-no-secret-literals.js +73 -0
- package/dist/lint/rules/cpl002-prefer-resource-reference.js +60 -0
- package/dist/lint/rules/index.js +6 -0
- package/dist/lsp/completions.d.ts.map +1 -1
- package/dist/lsp/completions.js +24 -0
- package/dist/lsp/hover.d.ts.map +1 -1
- package/dist/lsp/hover.js +106 -0
- package/dist/manifest.json +1 -1
- package/dist/ownership.js +25 -0
- package/dist/package-cli.js +21 -0
- package/dist/plugin.js +141 -0
- package/dist/reference-catalog.js +99 -0
- package/dist/serializer.js +217 -0
- package/dist/spec/fetch.d.ts.map +1 -1
- package/dist/spec/fetch.js +70 -0
- package/dist/spec/parse.js +338 -0
- package/dist/spec/snapshot-cli.js +60 -0
- package/dist/validate-cli.js +7 -0
- package/dist/validate.js +88 -0
- package/package.json +7 -7
- package/src/codegen/package.ts +2 -2
- package/src/lsp/completions.ts +2 -1
- package/src/lsp/hover.ts +2 -1
- package/src/spec/fetch.ts +2 -2
|
@@ -0,0 +1,556 @@
|
|
|
1
|
+
export const compositeCatalog = [
|
|
2
|
+
{
|
|
3
|
+
"name": "CronJob",
|
|
4
|
+
"lexicon": "cpln",
|
|
5
|
+
"description": "CronJob — a scheduled workload, with the constraints cron carries.",
|
|
6
|
+
"bundles": [
|
|
7
|
+
"Workload"
|
|
8
|
+
],
|
|
9
|
+
"params": [
|
|
10
|
+
{
|
|
11
|
+
"name": "name",
|
|
12
|
+
"type": "string",
|
|
13
|
+
"required": true,
|
|
14
|
+
"description": "Workload name."
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
"name": "gvc",
|
|
18
|
+
"type": "string",
|
|
19
|
+
"required": true,
|
|
20
|
+
"description": "GVC this job is deployed into."
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"name": "image",
|
|
24
|
+
"type": "string",
|
|
25
|
+
"required": true,
|
|
26
|
+
"description": "Container image."
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
"name": "schedule",
|
|
30
|
+
"type": "string",
|
|
31
|
+
"required": true,
|
|
32
|
+
"description": "Cron schedule, standard five-field syntax (e.g. `\"0 * * * *\"`)."
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
"name": "containerName",
|
|
36
|
+
"type": "string",
|
|
37
|
+
"required": false,
|
|
38
|
+
"description": "Container name (default `main`)."
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"name": "command",
|
|
42
|
+
"type": "string",
|
|
43
|
+
"required": false,
|
|
44
|
+
"description": "Entrypoint override."
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
"name": "args",
|
|
48
|
+
"type": "string[]",
|
|
49
|
+
"required": false,
|
|
50
|
+
"description": "Arguments passed to the entrypoint."
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
"name": "cpu",
|
|
54
|
+
"type": "string",
|
|
55
|
+
"required": false,
|
|
56
|
+
"description": "CPU in millicores (default `50m`)."
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
"name": "memory",
|
|
60
|
+
"type": "string",
|
|
61
|
+
"required": false,
|
|
62
|
+
"description": "Memory (default `128Mi`)."
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"name": "env",
|
|
66
|
+
"type": "Record<string, string>",
|
|
67
|
+
"required": false,
|
|
68
|
+
"description": "Environment variables, as a plain map."
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"name": "concurrencyPolicy",
|
|
72
|
+
"type": "\"Allow\" | \"Forbid\" | \"Replace\"",
|
|
73
|
+
"required": false,
|
|
74
|
+
"description": "What to do when a run is still going at the next scheduled time (default `Forbid` — skip the new run rather than overlap)."
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
"name": "restartPolicy",
|
|
78
|
+
"type": "\"Never\" | \"OnFailure\"",
|
|
79
|
+
"required": false,
|
|
80
|
+
"description": "Restart behaviour for a failed run (default `Never`)."
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "activeDeadlineSeconds",
|
|
84
|
+
"type": "number",
|
|
85
|
+
"required": false,
|
|
86
|
+
"description": "Seconds a run may take before it is killed."
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"name": "historyLimit",
|
|
90
|
+
"type": "number",
|
|
91
|
+
"required": false,
|
|
92
|
+
"description": "How many finished runs to retain."
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"name": "outboundAllowCidr",
|
|
96
|
+
"type": "string[]",
|
|
97
|
+
"required": false,
|
|
98
|
+
"description": "Hostnames or CIDRs the job may call out to."
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"name": "identityLink",
|
|
102
|
+
"type": "string",
|
|
103
|
+
"required": false,
|
|
104
|
+
"description": "Identity to run as, as a link (`//gvc/GVC/identity/NAME`)."
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"name": "tags",
|
|
108
|
+
"type": "Record<string, string>",
|
|
109
|
+
"required": false,
|
|
110
|
+
"description": "Tags applied to the workload."
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"name": "defaults",
|
|
114
|
+
"type": "{ workload?: Partial<ConstructorParameters<typeof Workload>[0]>; }",
|
|
115
|
+
"required": false,
|
|
116
|
+
"description": "Per-member defaults for customizing the underlying resource."
|
|
117
|
+
}
|
|
118
|
+
]
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
"name": "GvcEnvironment",
|
|
122
|
+
"lexicon": "cpln",
|
|
123
|
+
"description": "GvcEnvironment — a GVC placed in named locations, with its pull secrets.",
|
|
124
|
+
"bundles": [
|
|
125
|
+
"Gvc"
|
|
126
|
+
],
|
|
127
|
+
"params": [
|
|
128
|
+
{
|
|
129
|
+
"name": "name",
|
|
130
|
+
"type": "string",
|
|
131
|
+
"required": true,
|
|
132
|
+
"description": "GVC name."
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
"name": "org",
|
|
136
|
+
"type": "string",
|
|
137
|
+
"required": true,
|
|
138
|
+
"description": "Org the GVC belongs to."
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"name": "locations",
|
|
142
|
+
"type": "string[]",
|
|
143
|
+
"required": true,
|
|
144
|
+
"description": "Location ids to place workloads in, e.g. `[\"aws-us-east-1\"]`."
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
"name": "pullSecrets",
|
|
148
|
+
"type": "string[]",
|
|
149
|
+
"required": false,
|
|
150
|
+
"description": "Names of secrets used to pull private images."
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
"name": "endpointNamingFormat",
|
|
154
|
+
"type": "\"default\" | \"legacy\" | \"org\"",
|
|
155
|
+
"required": false,
|
|
156
|
+
"description": "Public endpoint naming scheme (default `org`, the default for new GVCs): `{workload}-{gvcAlias}.{orgPrefix}.cpln.app`."
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
"name": "env",
|
|
160
|
+
"type": "Record<string, string>",
|
|
161
|
+
"required": false,
|
|
162
|
+
"description": "Environment variables inherited by every workload in the GVC."
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
"name": "keda",
|
|
166
|
+
"type": "boolean",
|
|
167
|
+
"required": false,
|
|
168
|
+
"description": "Enable KEDA autoscaling for standard and stateful workloads in this GVC."
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"name": "tags",
|
|
172
|
+
"type": "Record<string, string>",
|
|
173
|
+
"required": false,
|
|
174
|
+
"description": "Tags applied to the GVC."
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"name": "defaults",
|
|
178
|
+
"type": "{ gvc?: Partial<ConstructorParameters<typeof Gvc>[0]>; }",
|
|
179
|
+
"required": false,
|
|
180
|
+
"description": "Per-member defaults for customizing the underlying resource."
|
|
181
|
+
}
|
|
182
|
+
]
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
"name": "PublicDomain",
|
|
186
|
+
"lexicon": "cpln",
|
|
187
|
+
"description": "PublicDomain — a custom domain routed to workloads in one GVC.",
|
|
188
|
+
"bundles": [
|
|
189
|
+
"Domain"
|
|
190
|
+
],
|
|
191
|
+
"params": [
|
|
192
|
+
{
|
|
193
|
+
"name": "name",
|
|
194
|
+
"type": "string",
|
|
195
|
+
"required": true,
|
|
196
|
+
"description": "The domain name, e.g. `api.example.com` or the apex `example.com`."
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"name": "gvc",
|
|
200
|
+
"type": "string",
|
|
201
|
+
"required": true,
|
|
202
|
+
"description": "The GVC every route targets."
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"name": "routes",
|
|
206
|
+
"type": "DomainRoute[]",
|
|
207
|
+
"required": false,
|
|
208
|
+
"description": "Routes for the domain."
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
"name": "dnsMode",
|
|
212
|
+
"type": "\"cname\" | \"ns\"",
|
|
213
|
+
"required": false,
|
|
214
|
+
"description": "DNS mode."
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
"name": "certChallengeType",
|
|
218
|
+
"type": "\"dns01\" | \"http01\"",
|
|
219
|
+
"required": false,
|
|
220
|
+
"description": "Certificate challenge type."
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
"name": "port",
|
|
224
|
+
"type": "number",
|
|
225
|
+
"required": false,
|
|
226
|
+
"description": "Public port (default 443)."
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
"name": "protocol",
|
|
230
|
+
"type": "\"http\" | \"http2\" | \"tcp\"",
|
|
231
|
+
"required": false,
|
|
232
|
+
"description": "Protocol (default `http2`)."
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
"name": "tags",
|
|
236
|
+
"type": "Record<string, string>",
|
|
237
|
+
"required": false,
|
|
238
|
+
"description": "Tags applied to the domain."
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"name": "defaults",
|
|
242
|
+
"type": "{ domain?: Partial<ConstructorParameters<typeof Domain>[0]>; }",
|
|
243
|
+
"required": false,
|
|
244
|
+
"description": "Per-member defaults for customizing the underlying resource."
|
|
245
|
+
}
|
|
246
|
+
]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
"name": "SecretAccess",
|
|
250
|
+
"lexicon": "cpln",
|
|
251
|
+
"description": "SecretAccess — the identity and policy a workload needs to read a secret.",
|
|
252
|
+
"bundles": [
|
|
253
|
+
"Identity",
|
|
254
|
+
"Policy"
|
|
255
|
+
],
|
|
256
|
+
"params": [
|
|
257
|
+
{
|
|
258
|
+
"name": "name",
|
|
259
|
+
"type": "string",
|
|
260
|
+
"required": true,
|
|
261
|
+
"description": "Identity name."
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
"name": "gvc",
|
|
265
|
+
"type": "string",
|
|
266
|
+
"required": true,
|
|
267
|
+
"description": "GVC the identity lives in."
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
"name": "secrets",
|
|
271
|
+
"type": "string[]",
|
|
272
|
+
"required": true,
|
|
273
|
+
"description": "Names of the org-scoped secrets this identity may read."
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
"name": "policyName",
|
|
277
|
+
"type": "string",
|
|
278
|
+
"required": false,
|
|
279
|
+
"description": "Policy name (default `<name>-secret-access`)."
|
|
280
|
+
},
|
|
281
|
+
{
|
|
282
|
+
"name": "permissions",
|
|
283
|
+
"type": "string[]",
|
|
284
|
+
"required": false,
|
|
285
|
+
"description": "Permissions granted on the target secrets (default `[\"reveal\"]`)."
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
"name": "tags",
|
|
289
|
+
"type": "Record<string, string>",
|
|
290
|
+
"required": false,
|
|
291
|
+
"description": "Tags applied to both resources."
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "defaults",
|
|
295
|
+
"type": "{ identity?: Partial<ConstructorParameters<typeof Identity>[0]>; policy?: Partial<ConstructorParameters<typeof Policy...",
|
|
296
|
+
"required": false,
|
|
297
|
+
"description": "Per-member defaults for customizing individual resources."
|
|
298
|
+
}
|
|
299
|
+
]
|
|
300
|
+
},
|
|
301
|
+
{
|
|
302
|
+
"name": "ServerlessService",
|
|
303
|
+
"lexicon": "cpln",
|
|
304
|
+
"description": "ServerlessService — a serverless workload with the port, probe and firewall settings a public HTTP service actually needs.",
|
|
305
|
+
"bundles": [
|
|
306
|
+
"Workload"
|
|
307
|
+
],
|
|
308
|
+
"params": [
|
|
309
|
+
{
|
|
310
|
+
"name": "name",
|
|
311
|
+
"type": "string",
|
|
312
|
+
"required": true,
|
|
313
|
+
"description": "Workload name."
|
|
314
|
+
},
|
|
315
|
+
{
|
|
316
|
+
"name": "gvc",
|
|
317
|
+
"type": "string",
|
|
318
|
+
"required": true,
|
|
319
|
+
"description": "GVC this workload is deployed into."
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
"name": "image",
|
|
323
|
+
"type": "string",
|
|
324
|
+
"required": true,
|
|
325
|
+
"description": "Container image."
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"name": "port",
|
|
329
|
+
"type": "number",
|
|
330
|
+
"required": false,
|
|
331
|
+
"description": "The port the container listens on."
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
"name": "protocol",
|
|
335
|
+
"type": "\"http\" | \"http2\"",
|
|
336
|
+
"required": false,
|
|
337
|
+
"description": "Protocol for the exposed port (default `http`)."
|
|
338
|
+
},
|
|
339
|
+
{
|
|
340
|
+
"name": "containerName",
|
|
341
|
+
"type": "string",
|
|
342
|
+
"required": false,
|
|
343
|
+
"description": "Container name (default `main`)."
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
"name": "cpu",
|
|
347
|
+
"type": "string",
|
|
348
|
+
"required": false,
|
|
349
|
+
"description": "CPU in millicores (default `50m`)."
|
|
350
|
+
},
|
|
351
|
+
{
|
|
352
|
+
"name": "memory",
|
|
353
|
+
"type": "string",
|
|
354
|
+
"required": false,
|
|
355
|
+
"description": "Memory (default `128Mi`)."
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
"name": "env",
|
|
359
|
+
"type": "Record<string, string>",
|
|
360
|
+
"required": false,
|
|
361
|
+
"description": "Environment variables, as a plain map."
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"name": "inboundAllowCidr",
|
|
365
|
+
"type": "string[]",
|
|
366
|
+
"required": false,
|
|
367
|
+
"description": "CIDRs allowed to reach the workload from the internet."
|
|
368
|
+
},
|
|
369
|
+
{
|
|
370
|
+
"name": "outboundAllowCidr",
|
|
371
|
+
"type": "string[]",
|
|
372
|
+
"required": false,
|
|
373
|
+
"description": "Hostnames or CIDRs the workload may call out to."
|
|
374
|
+
},
|
|
375
|
+
{
|
|
376
|
+
"name": "minScale",
|
|
377
|
+
"type": "number",
|
|
378
|
+
"required": false,
|
|
379
|
+
"description": "Minimum replicas (default 1)."
|
|
380
|
+
},
|
|
381
|
+
{
|
|
382
|
+
"name": "maxScale",
|
|
383
|
+
"type": "number",
|
|
384
|
+
"required": false,
|
|
385
|
+
"description": "Maximum replicas (default 5)."
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
"name": "autoscalingMetric",
|
|
389
|
+
"type": "\"concurrency\" | \"rps\" | \"cpu\" | \"memory\" | \"disabled\"",
|
|
390
|
+
"required": false,
|
|
391
|
+
"description": "Autoscaling strategy (default `concurrency`)."
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
"name": "autoscalingTarget",
|
|
395
|
+
"type": "number",
|
|
396
|
+
"required": false,
|
|
397
|
+
"description": "Scaling target (default 95)."
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
"name": "identityLink",
|
|
401
|
+
"type": "string",
|
|
402
|
+
"required": false,
|
|
403
|
+
"description": "Identity to run as, as a link (`//gvc/GVC/identity/NAME`)."
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"name": "tags",
|
|
407
|
+
"type": "Record<string, string>",
|
|
408
|
+
"required": false,
|
|
409
|
+
"description": "Tags applied to the workload."
|
|
410
|
+
},
|
|
411
|
+
{
|
|
412
|
+
"name": "defaults",
|
|
413
|
+
"type": "{ workload?: Partial<ConstructorParameters<typeof Workload>[0]>; }",
|
|
414
|
+
"required": false,
|
|
415
|
+
"description": "Per-member defaults for customizing the underlying resource."
|
|
416
|
+
}
|
|
417
|
+
]
|
|
418
|
+
},
|
|
419
|
+
{
|
|
420
|
+
"name": "StatefulService",
|
|
421
|
+
"lexicon": "cpln",
|
|
422
|
+
"description": "StatefulService — a stateful workload with its volume set, mounted.",
|
|
423
|
+
"bundles": [
|
|
424
|
+
"VolumeSet",
|
|
425
|
+
"Workload"
|
|
426
|
+
],
|
|
427
|
+
"params": [
|
|
428
|
+
{
|
|
429
|
+
"name": "name",
|
|
430
|
+
"type": "string",
|
|
431
|
+
"required": true,
|
|
432
|
+
"description": "Workload name."
|
|
433
|
+
},
|
|
434
|
+
{
|
|
435
|
+
"name": "gvc",
|
|
436
|
+
"type": "string",
|
|
437
|
+
"required": true,
|
|
438
|
+
"description": "GVC for both the workload and the volume set."
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
"name": "image",
|
|
442
|
+
"type": "string",
|
|
443
|
+
"required": true,
|
|
444
|
+
"description": "Container image."
|
|
445
|
+
},
|
|
446
|
+
{
|
|
447
|
+
"name": "mountPath",
|
|
448
|
+
"type": "string",
|
|
449
|
+
"required": true,
|
|
450
|
+
"description": "Mount path inside the container."
|
|
451
|
+
},
|
|
452
|
+
{
|
|
453
|
+
"name": "capacityGb",
|
|
454
|
+
"type": "number",
|
|
455
|
+
"required": true,
|
|
456
|
+
"description": "Initial volume capacity in GB."
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
"name": "volumeSetName",
|
|
460
|
+
"type": "string",
|
|
461
|
+
"required": false,
|
|
462
|
+
"description": "Volume set name (default `<name>-data`)."
|
|
463
|
+
},
|
|
464
|
+
{
|
|
465
|
+
"name": "fileSystemType",
|
|
466
|
+
"type": "\"ext4\" | \"xfs\" | \"shared\"",
|
|
467
|
+
"required": false,
|
|
468
|
+
"description": "Filesystem (default `ext4`)."
|
|
469
|
+
},
|
|
470
|
+
{
|
|
471
|
+
"name": "performanceClass",
|
|
472
|
+
"type": "\"general-purpose-ssd\" | \"high-throughput-ssd\" | \"shared\"",
|
|
473
|
+
"required": false,
|
|
474
|
+
"description": "Performance class (default `general-purpose-ssd`)."
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "recoveryPolicy",
|
|
478
|
+
"type": "\"retain\" | \"recycle\"",
|
|
479
|
+
"required": false,
|
|
480
|
+
"description": "What happens to the volume when the workload releases it (default `retain`)."
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
"name": "ports",
|
|
484
|
+
"type": "Array<{ number: number; protocol?: \"http\" | \"http2\" | \"grpc\" | \"tcp\" }>",
|
|
485
|
+
"required": false,
|
|
486
|
+
"description": "Ports the container exposes."
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
"name": "containerName",
|
|
490
|
+
"type": "string",
|
|
491
|
+
"required": false,
|
|
492
|
+
"description": "Container name (default `main`)."
|
|
493
|
+
},
|
|
494
|
+
{
|
|
495
|
+
"name": "cpu",
|
|
496
|
+
"type": "string",
|
|
497
|
+
"required": false,
|
|
498
|
+
"description": "CPU in millicores (default `50m`)."
|
|
499
|
+
},
|
|
500
|
+
{
|
|
501
|
+
"name": "memory",
|
|
502
|
+
"type": "string",
|
|
503
|
+
"required": false,
|
|
504
|
+
"description": "Memory (default `128Mi`)."
|
|
505
|
+
},
|
|
506
|
+
{
|
|
507
|
+
"name": "env",
|
|
508
|
+
"type": "Record<string, string>",
|
|
509
|
+
"required": false,
|
|
510
|
+
"description": "Environment variables, as a plain map."
|
|
511
|
+
},
|
|
512
|
+
{
|
|
513
|
+
"name": "inboundAllowCidr",
|
|
514
|
+
"type": "string[]",
|
|
515
|
+
"required": false,
|
|
516
|
+
"description": "CIDRs allowed to reach the workload from the internet."
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
"name": "outboundAllowCidr",
|
|
520
|
+
"type": "string[]",
|
|
521
|
+
"required": false,
|
|
522
|
+
"description": "Hostnames or CIDRs the workload may call out to."
|
|
523
|
+
},
|
|
524
|
+
{
|
|
525
|
+
"name": "minScale",
|
|
526
|
+
"type": "number",
|
|
527
|
+
"required": false,
|
|
528
|
+
"description": "Minimum replicas (default 1)."
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
"name": "maxScale",
|
|
532
|
+
"type": "number",
|
|
533
|
+
"required": false,
|
|
534
|
+
"description": "Maximum replicas (default 1)."
|
|
535
|
+
},
|
|
536
|
+
{
|
|
537
|
+
"name": "identityLink",
|
|
538
|
+
"type": "string",
|
|
539
|
+
"required": false,
|
|
540
|
+
"description": "Identity to run as, as a link (`//gvc/GVC/identity/NAME`)."
|
|
541
|
+
},
|
|
542
|
+
{
|
|
543
|
+
"name": "tags",
|
|
544
|
+
"type": "Record<string, string>",
|
|
545
|
+
"required": false,
|
|
546
|
+
"description": "Tags applied to both resources."
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
"name": "defaults",
|
|
550
|
+
"type": "{ workload?: Partial<ConstructorParameters<typeof Workload>[0]>; volumeSet?: Partial<ConstructorParameters<typeof Vol...",
|
|
551
|
+
"required": false,
|
|
552
|
+
"description": "Per-member defaults for customizing individual resources."
|
|
553
|
+
}
|
|
554
|
+
]
|
|
555
|
+
}
|
|
556
|
+
];
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CronJob — a scheduled workload, with the constraints cron carries.
|
|
3
|
+
*
|
|
4
|
+
* Cron is the workload type with the most *silent* rules: it must not expose
|
|
5
|
+
* any port, its container has to exit on completion, and probes, autoscaling,
|
|
6
|
+
* `timeoutSeconds` and `debug` are all accepted and then ignored. Rather than
|
|
7
|
+
* let a caller set those and wonder why nothing happens, this composite has no
|
|
8
|
+
* knobs for them.
|
|
9
|
+
*
|
|
10
|
+
* A cron workload also deploys to every location in its GVC with no
|
|
11
|
+
* per-location override, so placement is a property of the GVC, not of this.
|
|
12
|
+
*/
|
|
13
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
14
|
+
import { Workload } from "../generated/index.js";
|
|
15
|
+
export const CronJob = Composite((props) => {
|
|
16
|
+
const { name, gvc, image, schedule, containerName = "main", command, args, cpu = "50m", memory = "128Mi", env, concurrencyPolicy = "Forbid", restartPolicy = "Never", activeDeadlineSeconds, historyLimit, outboundAllowCidr = [], identityLink, tags, defaults: defs, } = props;
|
|
17
|
+
const workload = new Workload(mergeDefaults({
|
|
18
|
+
name,
|
|
19
|
+
gvc,
|
|
20
|
+
...(tags && { tags }),
|
|
21
|
+
spec: {
|
|
22
|
+
type: "cron",
|
|
23
|
+
...(identityLink && { identityLink }),
|
|
24
|
+
job: {
|
|
25
|
+
schedule,
|
|
26
|
+
concurrencyPolicy,
|
|
27
|
+
restartPolicy,
|
|
28
|
+
...(activeDeadlineSeconds !== undefined && { activeDeadlineSeconds }),
|
|
29
|
+
...(historyLimit !== undefined && { historyLimit }),
|
|
30
|
+
},
|
|
31
|
+
containers: [
|
|
32
|
+
{
|
|
33
|
+
name: containerName,
|
|
34
|
+
image,
|
|
35
|
+
cpu,
|
|
36
|
+
memory,
|
|
37
|
+
...(command && { command }),
|
|
38
|
+
...(args && { args }),
|
|
39
|
+
...(env && {
|
|
40
|
+
env: Object.entries(env).map(([envName, value]) => ({ name: envName, value })),
|
|
41
|
+
}),
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
firewallConfig: {
|
|
45
|
+
// A cron job serves nothing, so inbound stays closed. Outbound is
|
|
46
|
+
// the only direction worth opening.
|
|
47
|
+
external: { inboundAllowCIDR: [], outboundAllowCIDR: outboundAllowCidr },
|
|
48
|
+
},
|
|
49
|
+
},
|
|
50
|
+
}, defs?.workload));
|
|
51
|
+
return { workload };
|
|
52
|
+
}, "CronJob");
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* GvcEnvironment — a GVC placed in named locations, with its pull secrets.
|
|
3
|
+
*
|
|
4
|
+
* Two things belong here rather than at the workload:
|
|
5
|
+
*
|
|
6
|
+
* - **Pull secrets are GVC-level** (`spec.pullSecretLinks`), not per-workload.
|
|
7
|
+
* Looking for them on a workload is a common wrong turn, and only the
|
|
8
|
+
* `docker`, `ecr` and `gcp` secret types are valid as pull secrets.
|
|
9
|
+
* - **Placement is GVC-level.** Location links use the full org-qualified path
|
|
10
|
+
* (`/org/ORG/location/aws-us-east-1`), which is why this takes an `org`.
|
|
11
|
+
*
|
|
12
|
+
* The location id format is `<provider>-<region>`: `aws-us-east-1`,
|
|
13
|
+
* `gcp-us-central1`, `azure-eastus`.
|
|
14
|
+
*/
|
|
15
|
+
import { Composite, mergeDefaults } from "@intentius/chant";
|
|
16
|
+
import { Gvc } from "../generated/index.js";
|
|
17
|
+
/** Location ids look like `aws-us-east-1`, `gcp-us-central1`, `azure-eastus`. */
|
|
18
|
+
const LOCATION_ID = /^(aws|gcp|azure)-[a-z0-9-]+$/;
|
|
19
|
+
export const GvcEnvironment = Composite((props) => {
|
|
20
|
+
const { name, org, locations, pullSecrets, endpointNamingFormat = "org", env, keda, tags, defaults: defs, } = props;
|
|
21
|
+
if (locations.length === 0) {
|
|
22
|
+
throw new Error(`GvcEnvironment "${name}": no locations. A GVC with no placement accepts workloads and runs them nowhere.`);
|
|
23
|
+
}
|
|
24
|
+
for (const location of locations) {
|
|
25
|
+
if (!LOCATION_ID.test(location)) {
|
|
26
|
+
throw new Error(`GvcEnvironment "${name}": "${location}" is not a location id. Expected <provider>-<region>, ` +
|
|
27
|
+
`e.g. "aws-us-east-1", "gcp-us-central1", "azure-eastus".`);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
const gvc = new Gvc(mergeDefaults({
|
|
31
|
+
name,
|
|
32
|
+
...(tags && { tags }),
|
|
33
|
+
spec: {
|
|
34
|
+
endpointNamingFormat,
|
|
35
|
+
staticPlacement: {
|
|
36
|
+
locationLinks: [...locations].sort().map((location) => `/org/${org}/location/${location}`),
|
|
37
|
+
},
|
|
38
|
+
...(pullSecrets &&
|
|
39
|
+
pullSecrets.length > 0 && {
|
|
40
|
+
pullSecretLinks: [...pullSecrets].sort().map((secret) => `//secret/${secret}`),
|
|
41
|
+
}),
|
|
42
|
+
...(env && {
|
|
43
|
+
env: Object.entries(env).map(([envName, value]) => ({ name: envName, value })),
|
|
44
|
+
}),
|
|
45
|
+
...(keda !== undefined && { keda: { enabled: keda } }),
|
|
46
|
+
},
|
|
47
|
+
}, defs?.gvc));
|
|
48
|
+
return { gvc };
|
|
49
|
+
}, "GvcEnvironment");
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { GvcEnvironment } from "./gvc-environment.js";
|
|
2
|
+
export { ServerlessService } from "./serverless-service.js";
|
|
3
|
+
export { CronJob } from "./cron-job.js";
|
|
4
|
+
export { StatefulService } from "./stateful-service.js";
|
|
5
|
+
export { SecretAccess, identityLink, secretRef } from "./secret-access.js";
|
|
6
|
+
export { PublicDomain, isApexDomain } from "./public-domain.js";
|