timonel 2.8.0 → 2.8.3
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/CHANGELOG.md +12 -0
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js +319 -191
- package/dist/index.d.ts +0 -5
- package/dist/index.js +0 -6
- package/dist/lib/helm.d.ts +0 -472
- package/dist/lib/helm.js +0 -481
- package/dist/lib/helmChartWriter.d.ts +0 -178
- package/dist/lib/helmChartWriter.js +0 -180
- package/dist/lib/resources/baseResourceProvider.d.ts +0 -46
- package/dist/lib/resources/baseResourceProvider.js +1 -47
- package/dist/lib/resources/cloud/aws/awsResources.d.ts +0 -144
- package/dist/lib/resources/cloud/aws/awsResources.js +1 -163
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts +0 -132
- package/dist/lib/resources/cloud/aws/karpenterResources.js +0 -75
- package/dist/lib/rutter.d.ts +0 -324
- package/dist/lib/rutter.js +8 -352
- package/dist/lib/security.d.ts +0 -119
- package/dist/lib/security.js +4 -160
- package/dist/lib/umbrella.d.ts +0 -24
- package/dist/lib/umbrella.js +0 -24
- package/dist/lib/umbrellaRutter.d.ts +0 -71
- package/dist/lib/umbrellaRutter.js +2 -82
- package/dist/lib/utils/helmHelpers.d.ts +0 -39
- package/dist/lib/utils/helmHelpers.js +0 -32
- package/package.json +1 -1
- package/dist/cli.d.ts.map +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/lib/helm.d.ts.map +0 -1
- package/dist/lib/helm.js.map +0 -1
- package/dist/lib/helmChartWriter.d.ts.map +0 -1
- package/dist/lib/helmChartWriter.js.map +0 -1
- package/dist/lib/resources/baseResourceProvider.d.ts.map +0 -1
- package/dist/lib/resources/baseResourceProvider.js.map +0 -1
- package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +0 -1
- package/dist/lib/resources/cloud/aws/awsResources.js.map +0 -1
- package/dist/lib/resources/cloud/aws/karpenterResources.d.ts.map +0 -1
- package/dist/lib/resources/cloud/aws/karpenterResources.js.map +0 -1
- package/dist/lib/rutter.d.ts.map +0 -1
- package/dist/lib/rutter.js.map +0 -1
- package/dist/lib/security.d.ts.map +0 -1
- package/dist/lib/security.js.map +0 -1
- package/dist/lib/umbrella.d.ts.map +0 -1
- package/dist/lib/umbrella.js.map +0 -1
- package/dist/lib/umbrellaRutter.d.ts.map +0 -1
- package/dist/lib/umbrellaRutter.js.map +0 -1
- package/dist/lib/utils/helmHelpers.d.ts.map +0 -1
- package/dist/lib/utils/helmHelpers.js.map +0 -1
package/dist/lib/rutter.d.ts
CHANGED
|
@@ -5,13 +5,6 @@ import type { ServiceAccount, Ingress } from 'cdk8s-plus-33';
|
|
|
5
5
|
import type { AWSALBIngressSpec, AWSEBSStorageClassSpec, AWSECRServiceAccountSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec } from './resources/cloud/aws/awsResources.js';
|
|
6
6
|
import type { KarpenterEC2NodeClassSpec, KarpenterNodeClaimSpec, KarpenterNodePoolSpec } from './resources/cloud/aws/karpenterResources.js';
|
|
7
7
|
import type { HelperDefinition } from './utils/helmHelpers.js';
|
|
8
|
-
/**
|
|
9
|
-
* Rutter class with modular architecture
|
|
10
|
-
* Provides a clean API while delegating to specialized resource providers
|
|
11
|
-
* Maintains full backward compatibility with the original Rutter class
|
|
12
|
-
*
|
|
13
|
-
* @since 2.4.0
|
|
14
|
-
*/
|
|
15
8
|
export declare class Rutter {
|
|
16
9
|
private static readonly HELPER_NAME;
|
|
17
10
|
private readonly app;
|
|
@@ -24,168 +17,13 @@ export declare class Rutter {
|
|
|
24
17
|
private readonly props;
|
|
25
18
|
private readonly assets;
|
|
26
19
|
constructor(props: RutterProps);
|
|
27
|
-
/**
|
|
28
|
-
* Creates an AWS EBS StorageClass
|
|
29
|
-
* @param spec - EBS StorageClass specification
|
|
30
|
-
* @returns Created StorageClass ApiObject
|
|
31
|
-
*
|
|
32
|
-
* @example
|
|
33
|
-
* ```typescript
|
|
34
|
-
* rutter.addAWSEBSStorageClass({
|
|
35
|
-
* name: 'fast-ebs',
|
|
36
|
-
* volumeType: 'gp3',
|
|
37
|
-
* encrypted: true,
|
|
38
|
-
* allowVolumeExpansion: true
|
|
39
|
-
* });
|
|
40
|
-
* ```
|
|
41
|
-
*
|
|
42
|
-
* @since 1.0.0
|
|
43
|
-
*/
|
|
44
20
|
addAWSEBSStorageClass(spec: AWSEBSStorageClassSpec): ApiObject;
|
|
45
|
-
/**
|
|
46
|
-
* Creates an AWS EFS StorageClass
|
|
47
|
-
* @param spec - EFS StorageClass specification
|
|
48
|
-
* @returns Created StorageClass ApiObject
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* rutter.addAWSEFSStorageClass({
|
|
53
|
-
* name: 'efs-storage',
|
|
54
|
-
* fileSystemId: 'fs-12345678',
|
|
55
|
-
* directoryPerms: '0755'
|
|
56
|
-
* });
|
|
57
|
-
* ```
|
|
58
|
-
*
|
|
59
|
-
* @since 1.0.0
|
|
60
|
-
*/
|
|
61
21
|
addAWSEFSStorageClass(spec: AWSEFSStorageClassSpec): ApiObject;
|
|
62
|
-
/**
|
|
63
|
-
* Creates an AWS IRSA ServiceAccount
|
|
64
|
-
* @param spec - IRSA ServiceAccount specification
|
|
65
|
-
* @returns Created ServiceAccount ApiObject
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```typescript
|
|
69
|
-
* rutter.addAWSIRSAServiceAccount({
|
|
70
|
-
* name: 'my-service-account',
|
|
71
|
-
* roleArn: 'arn:aws:iam::ACCOUNT_ID:role/MyRole'
|
|
72
|
-
* });
|
|
73
|
-
* ```
|
|
74
|
-
*
|
|
75
|
-
* @since 1.0.0
|
|
76
|
-
*/
|
|
77
22
|
addAWSIRSAServiceAccount(spec: AWSIRSAServiceAccountSpec): ServiceAccount;
|
|
78
|
-
/**
|
|
79
|
-
* Creates an AWS ALB Ingress
|
|
80
|
-
* @param spec - ALB Ingress specification
|
|
81
|
-
* @returns Created Ingress ApiObject
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* rutter.addAWSALBIngress({
|
|
86
|
-
* name: 'web-ingress',
|
|
87
|
-
* rules: [{
|
|
88
|
-
* paths: [{
|
|
89
|
-
* path: '/',
|
|
90
|
-
* pathType: 'Prefix',
|
|
91
|
-
* backend: { service: { name: 'web-service', port: { number: 80 } } }
|
|
92
|
-
* }]
|
|
93
|
-
* }],
|
|
94
|
-
* scheme: 'internet-facing'
|
|
95
|
-
* });
|
|
96
|
-
* ```
|
|
97
|
-
*
|
|
98
|
-
* @since 1.0.0
|
|
99
|
-
*/
|
|
100
23
|
addAWSALBIngress(spec: AWSALBIngressSpec): Ingress;
|
|
101
|
-
/**
|
|
102
|
-
* Creates a Karpenter NodePool resource
|
|
103
|
-
* @param spec - NodePool specification
|
|
104
|
-
* @returns Created NodePool ApiObject
|
|
105
|
-
*
|
|
106
|
-
* @example
|
|
107
|
-
* ```typescript
|
|
108
|
-
* rutter.addKarpenterNodePool({
|
|
109
|
-
* name: 'default-nodepool',
|
|
110
|
-
* template: {
|
|
111
|
-
* spec: {
|
|
112
|
-
* nodeClassRef: {
|
|
113
|
-
* apiVersion: 'karpenter.k8s.aws/v1beta1',
|
|
114
|
-
* kind: 'EC2NodeClass',
|
|
115
|
-
* name: 'default'
|
|
116
|
-
* }
|
|
117
|
-
* }
|
|
118
|
-
* }
|
|
119
|
-
* });
|
|
120
|
-
* ```
|
|
121
|
-
*
|
|
122
|
-
* @since 2.7.0
|
|
123
|
-
*/
|
|
124
24
|
addKarpenterNodePool(spec: KarpenterNodePoolSpec): ApiObject;
|
|
125
|
-
/**
|
|
126
|
-
* Creates a Karpenter NodeClaim resource
|
|
127
|
-
* @param spec - NodeClaim specification
|
|
128
|
-
* @returns Created NodeClaim ApiObject
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```typescript
|
|
132
|
-
* rutter.addKarpenterNodeClaim({
|
|
133
|
-
* name: 'my-node-claim',
|
|
134
|
-
* nodeClassRef: {
|
|
135
|
-
* apiVersion: 'karpenter.k8s.aws/v1beta1',
|
|
136
|
-
* kind: 'EC2NodeClass',
|
|
137
|
-
* name: 'default'
|
|
138
|
-
* }
|
|
139
|
-
* });
|
|
140
|
-
* ```
|
|
141
|
-
*
|
|
142
|
-
* @since 2.7.0
|
|
143
|
-
*/
|
|
144
25
|
addKarpenterNodeClaim(spec: KarpenterNodeClaimSpec): ApiObject;
|
|
145
|
-
/**
|
|
146
|
-
* Creates a Karpenter EC2NodeClass resource
|
|
147
|
-
* @param spec - EC2NodeClass specification
|
|
148
|
-
* @returns Created EC2NodeClass ApiObject
|
|
149
|
-
*
|
|
150
|
-
* @example
|
|
151
|
-
* ```typescript
|
|
152
|
-
* rutter.addKarpenterEC2NodeClass({
|
|
153
|
-
* name: 'default',
|
|
154
|
-
* amiFamily: 'AL2',
|
|
155
|
-
* subnetSelectorTerms: [{ tags: { 'karpenter.sh/discovery': 'my-cluster' } }],
|
|
156
|
-
* securityGroupSelectorTerms: [{ tags: { 'karpenter.sh/discovery': 'my-cluster' } }]
|
|
157
|
-
* });
|
|
158
|
-
* ```
|
|
159
|
-
*
|
|
160
|
-
* @since 2.7.0
|
|
161
|
-
*/
|
|
162
26
|
addKarpenterEC2NodeClass(spec: KarpenterEC2NodeClassSpec): ApiObject;
|
|
163
|
-
/**
|
|
164
|
-
* Creates a Karpenter NodePool with optimized disruption settings for cost efficiency
|
|
165
|
-
* @param spec - NodePool specification with disruption optimization
|
|
166
|
-
* @returns Created NodePool ApiObject
|
|
167
|
-
*
|
|
168
|
-
* @example
|
|
169
|
-
* ```typescript
|
|
170
|
-
* rutter.addKarpenterNodePoolWithDisruption({
|
|
171
|
-
* name: 'cost-optimized',
|
|
172
|
-
* nodeClassRef: {
|
|
173
|
-
* apiVersion: 'karpenter.k8s.aws/v1beta1',
|
|
174
|
-
* kind: 'EC2NodeClass',
|
|
175
|
-
* name: 'default'
|
|
176
|
-
* },
|
|
177
|
-
* consolidationPolicy: 'WhenEmptyOrUnderutilized',
|
|
178
|
-
* consolidateAfter: '30s',
|
|
179
|
-
* expireAfter: '24h',
|
|
180
|
-
* disruptionBudgets: [
|
|
181
|
-
* { nodes: '20%' },
|
|
182
|
-
* { nodes: '0', schedule: '0 9 * * 1-5', duration: '8h' }
|
|
183
|
-
* ]
|
|
184
|
-
* });
|
|
185
|
-
* ```
|
|
186
|
-
*
|
|
187
|
-
* @since 2.7.1
|
|
188
|
-
*/
|
|
189
27
|
addKarpenterNodePoolWithDisruption(spec: {
|
|
190
28
|
name: string;
|
|
191
29
|
nodeClassRef: {
|
|
@@ -211,33 +49,6 @@ export declare class Rutter {
|
|
|
211
49
|
labels?: Record<string, string>;
|
|
212
50
|
annotations?: Record<string, string>;
|
|
213
51
|
}): ApiObject;
|
|
214
|
-
/**
|
|
215
|
-
* Creates a Karpenter NodePool with scheduling constraints and priorities
|
|
216
|
-
* @param spec - NodePool specification with scheduling optimization
|
|
217
|
-
* @returns Created NodePool ApiObject
|
|
218
|
-
*
|
|
219
|
-
* @example
|
|
220
|
-
* ```typescript
|
|
221
|
-
* rutter.addKarpenterNodePoolWithScheduling({
|
|
222
|
-
* name: 'gpu-workloads',
|
|
223
|
-
* nodeClassRef: {
|
|
224
|
-
* apiVersion: 'karpenter.k8s.aws/v1beta1',
|
|
225
|
-
* kind: 'EC2NodeClass',
|
|
226
|
-
* name: 'gpu-nodeclass'
|
|
227
|
-
* },
|
|
228
|
-
* requirements: [
|
|
229
|
-
* { key: 'node.kubernetes.io/instance-type', operator: 'In', values: ['g4dn.xlarge', 'g4dn.2xlarge'] }
|
|
230
|
-
* ],
|
|
231
|
-
* taints: [
|
|
232
|
-
* { key: 'nvidia.com/gpu', effect: 'NoSchedule' }
|
|
233
|
-
* ],
|
|
234
|
-
* terminationGracePeriod: '60s',
|
|
235
|
-
* weight: 100
|
|
236
|
-
* });
|
|
237
|
-
* ```
|
|
238
|
-
*
|
|
239
|
-
* @since 2.7.1
|
|
240
|
-
*/
|
|
241
52
|
addKarpenterNodePoolWithScheduling(spec: {
|
|
242
53
|
name: string;
|
|
243
54
|
nodeClassRef: {
|
|
@@ -266,150 +77,20 @@ export declare class Rutter {
|
|
|
266
77
|
labels?: Record<string, string>;
|
|
267
78
|
annotations?: Record<string, string>;
|
|
268
79
|
}): ApiObject;
|
|
269
|
-
/**
|
|
270
|
-
* Creates a ServiceAccount with ECR access annotations
|
|
271
|
-
* @param spec - ECR ServiceAccount specification
|
|
272
|
-
* @returns Created ServiceAccount ApiObject
|
|
273
|
-
*
|
|
274
|
-
* @example
|
|
275
|
-
* ```typescript
|
|
276
|
-
* rutter.addAWSECRServiceAccount({
|
|
277
|
-
* name: 'ecr-service-account',
|
|
278
|
-
* roleArn: 'arn:aws:iam::ACCOUNT_ID:role/ECRAccessRole'
|
|
279
|
-
* });
|
|
280
|
-
* ```
|
|
281
|
-
*
|
|
282
|
-
* @since 2.7.0
|
|
283
|
-
*/
|
|
284
80
|
addAWSECRServiceAccount(spec: AWSECRServiceAccountSpec): ServiceAccount;
|
|
285
|
-
/**
|
|
286
|
-
* Adds a Kubernetes manifest to the chart using CDK8S
|
|
287
|
-
*
|
|
288
|
-
* This method allows you to add any Kubernetes manifest (CRDs, custom resources, etc.)
|
|
289
|
-
* either as YAML strings or as objects. The manifest will be processed using CDK8S
|
|
290
|
-
* for better type safety and validation.
|
|
291
|
-
*
|
|
292
|
-
* @param yamlOrObject - Kubernetes manifest as YAML string or object
|
|
293
|
-
* @param id - Unique identifier for the manifest (required for multiple manifests)
|
|
294
|
-
*
|
|
295
|
-
* @example
|
|
296
|
-
* ```typescript
|
|
297
|
-
* // Using YAML string for CRD
|
|
298
|
-
* rutter.addManifest(`
|
|
299
|
-
* apiVersion: apiextensions.k8s.io/v1
|
|
300
|
-
* kind: CustomResourceDefinition
|
|
301
|
-
* metadata:
|
|
302
|
-
* name: example.com
|
|
303
|
-
* spec:
|
|
304
|
-
* group: example.com
|
|
305
|
-
* versions: []
|
|
306
|
-
* `, 'my-crd');
|
|
307
|
-
*
|
|
308
|
-
* // Using object for any Kubernetes resource
|
|
309
|
-
* rutter.addManifest({
|
|
310
|
-
* apiVersion: 'v1',
|
|
311
|
-
* kind: 'ConfigMap',
|
|
312
|
-
* metadata: { name: 'my-config' },
|
|
313
|
-
* data: { key: 'value' }
|
|
314
|
-
* }, 'my-configmap');
|
|
315
|
-
* ```
|
|
316
|
-
*
|
|
317
|
-
* @since 3.0.0
|
|
318
|
-
* @note Consider using cdk8s-plus constructs for better type safety when available
|
|
319
|
-
*/
|
|
320
81
|
addManifest(yamlOrObject: string | Record<string, unknown>, id: string): ApiObject;
|
|
321
|
-
/**
|
|
322
|
-
* Adds a Kubernetes manifest wrapped in a Helm conditional
|
|
323
|
-
*
|
|
324
|
-
* This method creates a manifest that will only be rendered if the specified
|
|
325
|
-
* condition evaluates to true. The condition is checked against .Values in Helm.
|
|
326
|
-
*
|
|
327
|
-
* @param manifestObject - JavaScript object representing the Kubernetes manifest
|
|
328
|
-
* @param condition - Path to the condition value in .Values (e.g., 'createNamespace')
|
|
329
|
-
* @param id - Unique identifier for this manifest within the chart
|
|
330
|
-
* @returns The created ApiObject instance
|
|
331
|
-
* @throws {Error} If the manifest structure is incorrect or condition path is invalid
|
|
332
|
-
*
|
|
333
|
-
* @example
|
|
334
|
-
* ```typescript
|
|
335
|
-
* // Add a namespace that's only created if .Values.createNamespace is true
|
|
336
|
-
* rutter.addConditionalManifest(
|
|
337
|
-
* {
|
|
338
|
-
* apiVersion: 'v1',
|
|
339
|
-
* kind: 'Namespace',
|
|
340
|
-
* metadata: {
|
|
341
|
-
* name: valuesRef('namespace'),
|
|
342
|
-
* labels: {
|
|
343
|
-
* environment: conditionalRef('environment', 'environment')
|
|
344
|
-
* }
|
|
345
|
-
* }
|
|
346
|
-
* },
|
|
347
|
-
* 'createNamespace',
|
|
348
|
-
* 'namespace'
|
|
349
|
-
* );
|
|
350
|
-
* ```
|
|
351
|
-
*
|
|
352
|
-
* @since 2.7.4
|
|
353
|
-
*/
|
|
354
82
|
addConditionalManifest(manifestObject: Record<string, unknown>, condition: string, id: string): ApiObject;
|
|
355
|
-
/**
|
|
356
|
-
* Validates the structure of a Kubernetes manifest object
|
|
357
|
-
* @param manifest - The manifest object to validate
|
|
358
|
-
* @private
|
|
359
|
-
* @since 3.0.0
|
|
360
|
-
*/
|
|
361
83
|
private validateManifestStructure;
|
|
362
|
-
/**
|
|
363
|
-
* Gets chart metadata
|
|
364
|
-
* @returns Chart metadata
|
|
365
|
-
*
|
|
366
|
-
* @since 1.0.0
|
|
367
|
-
*/
|
|
368
84
|
getMeta(): ChartMetadata;
|
|
369
|
-
/**
|
|
370
|
-
* Gets default values
|
|
371
|
-
* @returns Default values object
|
|
372
|
-
*
|
|
373
|
-
* @since 1.0.0
|
|
374
|
-
*/
|
|
375
85
|
getDefaultValues(): Record<string, unknown>;
|
|
376
|
-
/**
|
|
377
|
-
* Gets environment-specific values
|
|
378
|
-
* @returns Environment values object
|
|
379
|
-
*
|
|
380
|
-
* @since 1.0.0
|
|
381
|
-
*/
|
|
382
86
|
getEnvValues(): Record<string, Record<string, unknown>>;
|
|
383
|
-
/**
|
|
384
|
-
* Gets all assets (CRDs, etc.)
|
|
385
|
-
* @returns Array of assets
|
|
386
|
-
*
|
|
387
|
-
* @since 1.0.0
|
|
388
|
-
*/
|
|
389
87
|
getAssets(): Array<{
|
|
390
88
|
id: string;
|
|
391
89
|
yaml: string;
|
|
392
90
|
target: string;
|
|
393
91
|
}>;
|
|
394
|
-
/**
|
|
395
|
-
* Converts the chart to SynthAsset array for HelmChartWriter
|
|
396
|
-
* @returns Array of synthesized assets
|
|
397
|
-
*
|
|
398
|
-
* @since 2.4.0
|
|
399
|
-
*/
|
|
400
92
|
private toSynthArray;
|
|
401
|
-
/**
|
|
402
|
-
* Process YAML content to remove quotes from Helm templates
|
|
403
|
-
* This fixes the issue where YAML.stringify adds quotes around Helm template expressions
|
|
404
|
-
* Removes quotes from all Helm template expressions
|
|
405
|
-
*/
|
|
406
93
|
private processHelmTemplates;
|
|
407
|
-
/**
|
|
408
|
-
* Writes the Helm chart to the specified output directory
|
|
409
|
-
* @param outDir - Output directory path
|
|
410
|
-
*
|
|
411
|
-
* @since 1.0.0
|
|
412
|
-
*/
|
|
413
94
|
write(outDir: string): void;
|
|
414
95
|
}
|
|
415
96
|
export interface ChartMetadata {
|
|
@@ -432,14 +113,9 @@ export interface RutterProps {
|
|
|
432
113
|
envValues?: Record<string, Record<string, unknown>>;
|
|
433
114
|
namespace?: string;
|
|
434
115
|
chartProps?: ChartProps;
|
|
435
|
-
/** Custom Helm helpers content or definitions */
|
|
436
116
|
helpersTpl?: string | HelperDefinition[];
|
|
437
|
-
/** Cloud provider for default helpers */
|
|
438
117
|
cloudProvider?: 'aws';
|
|
439
|
-
/** Custom prefix for manifest files */
|
|
440
118
|
manifestPrefix?: string;
|
|
441
|
-
/** Combine all resources into single manifest file */
|
|
442
119
|
singleManifestFile?: boolean;
|
|
443
120
|
}
|
|
444
121
|
export type { AWSEBSStorageClassSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec, AWSALBIngressSpec, } from './resources/cloud/aws/awsResources.js';
|
|
445
|
-
//# sourceMappingURL=rutter.d.ts.map
|