timonel 2.8.0-beta.4 → 2.8.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.
Files changed (72) hide show
  1. package/CHANGELOG.md +9 -19
  2. package/README.md +12 -55
  3. package/dist/cli.js +2 -2
  4. package/dist/cli.js.map +1 -1
  5. package/dist/index.d.ts +7 -15
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +5 -7
  8. package/dist/index.js.map +1 -1
  9. package/dist/lib/helm.d.ts +234 -4
  10. package/dist/lib/helm.d.ts.map +1 -1
  11. package/dist/lib/helm.js +309 -20
  12. package/dist/lib/helm.js.map +1 -1
  13. package/dist/lib/helmChartWriter.js +5 -19
  14. package/dist/lib/helmChartWriter.js.map +1 -1
  15. package/dist/lib/resources/baseResourceProvider.d.ts +1 -1
  16. package/dist/lib/resources/baseResourceProvider.d.ts.map +1 -1
  17. package/dist/lib/resources/baseResourceProvider.js.map +1 -1
  18. package/dist/lib/resources/cloud/aws/awsResources.d.ts +5 -6
  19. package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +1 -1
  20. package/dist/lib/resources/cloud/aws/awsResources.js +59 -30
  21. package/dist/lib/resources/cloud/aws/awsResources.js.map +1 -1
  22. package/dist/lib/rutter.d.ts +73 -708
  23. package/dist/lib/rutter.d.ts.map +1 -1
  24. package/dist/lib/rutter.js +157 -837
  25. package/dist/lib/rutter.js.map +1 -1
  26. package/dist/lib/security.d.ts +2 -1
  27. package/dist/lib/security.d.ts.map +1 -1
  28. package/dist/lib/security.js +33 -4
  29. package/dist/lib/security.js.map +1 -1
  30. package/dist/lib/umbrellaRutter.d.ts +1 -1
  31. package/dist/lib/umbrellaRutter.d.ts.map +1 -1
  32. package/dist/lib/utils/helmHelpers.d.ts +2 -12
  33. package/dist/lib/utils/helmHelpers.d.ts.map +1 -1
  34. package/dist/lib/utils/helmHelpers.js +2 -46
  35. package/dist/lib/utils/helmHelpers.js.map +1 -1
  36. package/package.json +2 -2
  37. package/dist/lib/resources/autoscaling/autoscalingResources.d.ts +0 -248
  38. package/dist/lib/resources/autoscaling/autoscalingResources.d.ts.map +0 -1
  39. package/dist/lib/resources/autoscaling/autoscalingResources.js +0 -81
  40. package/dist/lib/resources/autoscaling/autoscalingResources.js.map +0 -1
  41. package/dist/lib/resources/cloud/azure/azureResources.d.ts +0 -169
  42. package/dist/lib/resources/cloud/azure/azureResources.d.ts.map +0 -1
  43. package/dist/lib/resources/cloud/azure/azureResources.js +0 -218
  44. package/dist/lib/resources/cloud/azure/azureResources.js.map +0 -1
  45. package/dist/lib/resources/cloud/gcp/gcpResources.d.ts +0 -164
  46. package/dist/lib/resources/cloud/gcp/gcpResources.d.ts.map +0 -1
  47. package/dist/lib/resources/cloud/gcp/gcpResources.js +0 -192
  48. package/dist/lib/resources/cloud/gcp/gcpResources.js.map +0 -1
  49. package/dist/lib/resources/core/coreResources.d.ts +0 -790
  50. package/dist/lib/resources/core/coreResources.d.ts.map +0 -1
  51. package/dist/lib/resources/core/coreResources.js +0 -1115
  52. package/dist/lib/resources/core/coreResources.js.map +0 -1
  53. package/dist/lib/resources/core/storageResources.d.ts +0 -133
  54. package/dist/lib/resources/core/storageResources.d.ts.map +0 -1
  55. package/dist/lib/resources/core/storageResources.js +0 -120
  56. package/dist/lib/resources/core/storageResources.js.map +0 -1
  57. package/dist/lib/resources/network/networkResources.d.ts +0 -229
  58. package/dist/lib/resources/network/networkResources.d.ts.map +0 -1
  59. package/dist/lib/resources/network/networkResources.js +0 -310
  60. package/dist/lib/resources/network/networkResources.js.map +0 -1
  61. package/dist/lib/resources/validation/validationResources.d.ts +0 -26
  62. package/dist/lib/resources/validation/validationResources.d.ts.map +0 -1
  63. package/dist/lib/resources/validation/validationResources.js +0 -33
  64. package/dist/lib/resources/validation/validationResources.js.map +0 -1
  65. package/dist/lib/utils/podTemplates.d.ts +0 -192
  66. package/dist/lib/utils/podTemplates.d.ts.map +0 -1
  67. package/dist/lib/utils/podTemplates.js +0 -331
  68. package/dist/lib/utils/podTemplates.js.map +0 -1
  69. package/dist/lib/utils/resourceNaming.d.ts +0 -57
  70. package/dist/lib/utils/resourceNaming.d.ts.map +0 -1
  71. package/dist/lib/utils/resourceNaming.js +0 -82
  72. package/dist/lib/utils/resourceNaming.js.map +0 -1
@@ -1,16 +1,10 @@
1
+ import { ApiObject } from 'cdk8s';
1
2
  import type { ChartProps } from 'cdk8s';
2
3
  import type { Construct } from 'constructs';
3
- import type { ApiObject } from 'cdk8s';
4
- import type { DeploymentSpec, DaemonSetSpec, StatefulSetSpec, RoleSpec, ClusterRoleSpec, RoleBindingSpec, ClusterRoleBindingSpec, JobSpec, ServiceSpec, ConfigMapSpec, SecretSpec, ServiceAccountSpec } from './resources/core/coreResources.js';
5
- import type { PersistentVolumeSpec, PersistentVolumeClaimSpec, StorageClassSpec } from './resources/core/storageResources.js';
6
- import type { AWSEBSStorageClassSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec, AWSECRServiceAccountSpec, AWSALBIngressSpec } from './resources/cloud/aws/awsResources.js';
7
- import type { AzureDiskStorageClassSpec, AzureFileStorageClassSpec, AzureAGICIngressSpec, AzureKeyVaultSecretProviderClassSpec, AzureACRServiceAccountSpec } from './resources/cloud/azure/azureResources.js';
8
- import type { GCPPersistentDiskStorageClassSpec, GCPFilestoreStorageClassSpec, GCPGCEIngressSpec, GCPWorkloadIdentityServiceAccountSpec, GCPArtifactRegistryServiceAccountSpec } from './resources/cloud/gcp/gcpResources.js';
9
- import type { HorizontalPodAutoscalerSpec, VerticalPodAutoscalerSpec, CronJobSpec } from './resources/autoscaling/autoscalingResources.js';
10
- import type { NetworkPolicySpec, IngressSpec } from './resources/network/networkResources.js';
11
- import type { KarpenterNodePoolSpec, KarpenterNodeClaimSpec, KarpenterEC2NodeClassSpec } from './resources/cloud/aws/karpenterResources.js';
4
+ import type { ServiceAccount, Ingress } from 'cdk8s-plus-33';
5
+ import type { AWSALBIngressSpec, AWSEBSStorageClassSpec, AWSECRServiceAccountSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec } from './resources/cloud/aws/awsResources.js';
6
+ import type { KarpenterEC2NodeClassSpec, KarpenterNodeClaimSpec, KarpenterNodePoolSpec } from './resources/cloud/aws/karpenterResources.js';
12
7
  import type { HelperDefinition } from './utils/helmHelpers.js';
13
- import type { NamingStrategy } from './utils/resourceNaming.js';
14
8
  /**
15
9
  * Rutter class with modular architecture
16
10
  * Provides a clean API while delegating to specialized resource providers
@@ -22,13 +16,7 @@ export declare class Rutter {
22
16
  private static readonly HELPER_NAME;
23
17
  private readonly app;
24
18
  private readonly chart;
25
- private readonly coreResources;
26
- private readonly storageResources;
27
19
  private readonly awsResources;
28
- private readonly azureResources;
29
- private readonly gcpResources;
30
- private readonly autoscalingResources;
31
- private readonly networkResources;
32
20
  private readonly karpenterResources;
33
21
  private readonly meta;
34
22
  private readonly defaultValues;
@@ -36,305 +24,6 @@ export declare class Rutter {
36
24
  private readonly props;
37
25
  private readonly assets;
38
26
  constructor(props: RutterProps);
39
- /**
40
- * Creates a Deployment resource
41
- * @param spec - Deployment specification
42
- * @returns Created Deployment ApiObject
43
- *
44
- * @example
45
- * ```typescript
46
- * rutter.addDeployment({
47
- * name: 'web-app',
48
- * image: 'nginx:1.21',
49
- * replicas: 3,
50
- * containerPort: 80
51
- * });
52
- * ```
53
- *
54
- * @since 1.0.0
55
- */
56
- addDeployment(spec: DeploymentSpec): ApiObject;
57
- /**
58
- * Creates a DaemonSet resource
59
- * @param spec - DaemonSet specification
60
- * @returns Created DaemonSet ApiObject
61
- *
62
- * @example
63
- * ```typescript
64
- * rutter.addDaemonSet({
65
- * name: 'log-collector',
66
- * image: 'fluentd:v1.14',
67
- * containerPort: 24224,
68
- * hostNetwork: true
69
- * });
70
- * ```
71
- *
72
- * @since 2.4.0
73
- */
74
- addDaemonSet(spec: DaemonSetSpec): ApiObject;
75
- /**
76
- * Creates a StatefulSet resource
77
- * @param spec - StatefulSet specification
78
- * @returns Created StatefulSet ApiObject
79
- *
80
- * @example
81
- * ```typescript
82
- * rutter.addStatefulSet({
83
- * name: 'database',
84
- * image: 'postgres:13',
85
- * replicas: 3,
86
- * serviceName: 'database-headless',
87
- * containerPort: 5432
88
- * });
89
- * ```
90
- *
91
- * @since 2.4.0
92
- */
93
- addStatefulSet(spec: StatefulSetSpec): ApiObject;
94
- /**
95
- * Creates a Role resource for RBAC
96
- * @param spec - Role specification
97
- * @returns Created Role ApiObject
98
- *
99
- * @example
100
- * ```typescript
101
- * rutter.addRole({
102
- * name: 'pod-reader',
103
- * rules: [
104
- * {
105
- * apiGroups: [''],
106
- * resources: ['pods'],
107
- * verbs: ['get', 'list', 'watch']
108
- * }
109
- * ]
110
- * });
111
- * ```
112
- *
113
- * @since 2.4.0
114
- */
115
- addRole(spec: RoleSpec): ApiObject;
116
- /**
117
- * Creates a ClusterRole resource for cluster-wide RBAC
118
- * @param spec - ClusterRole specification
119
- * @returns Created ClusterRole ApiObject
120
- *
121
- * @example
122
- * ```typescript
123
- * rutter.addClusterRole({
124
- * name: 'cluster-reader',
125
- * rules: [
126
- * {
127
- * apiGroups: [''],
128
- * resources: ['nodes', 'namespaces'],
129
- * verbs: ['get', 'list', 'watch']
130
- * }
131
- * ]
132
- * });
133
- * ```
134
- *
135
- * @since 2.4.0
136
- */
137
- addClusterRole(spec: ClusterRoleSpec): ApiObject;
138
- /**
139
- * Creates a RoleBinding resource for RBAC
140
- * @param spec - RoleBinding specification
141
- * @returns Created RoleBinding ApiObject
142
- *
143
- * @example
144
- * ```typescript
145
- * rutter.addRoleBinding({
146
- * name: 'pod-reader-binding',
147
- * roleRef: {
148
- * kind: 'Role',
149
- * name: 'pod-reader',
150
- * apiGroup: 'rbac.authorization.k8s.io'
151
- * },
152
- * subjects: [
153
- * {
154
- * kind: 'ServiceAccount',
155
- * name: 'my-service-account'
156
- * }
157
- * ]
158
- * });
159
- * ```
160
- *
161
- * @since 2.4.0
162
- */
163
- addRoleBinding(spec: RoleBindingSpec): ApiObject;
164
- /**
165
- * Creates a ClusterRoleBinding resource for cluster-wide RBAC
166
- * @param spec - ClusterRoleBinding specification
167
- * @returns Created ClusterRoleBinding ApiObject
168
- *
169
- * @example
170
- * ```typescript
171
- * rutter.addClusterRoleBinding({
172
- * name: 'cluster-reader-binding',
173
- * roleRef: {
174
- * kind: 'ClusterRole',
175
- * name: 'cluster-reader',
176
- * apiGroup: 'rbac.authorization.k8s.io'
177
- * },
178
- * subjects: [
179
- * {
180
- * kind: 'ServiceAccount',
181
- * name: 'monitoring-agent',
182
- * namespace: 'monitoring'
183
- * }
184
- * ]
185
- * });
186
- * ```
187
- *
188
- * @since 2.4.0
189
- */
190
- addClusterRoleBinding(spec: ClusterRoleBindingSpec): ApiObject;
191
- /**
192
- * Creates a Job resource for batch workloads
193
- * @param spec - Job specification
194
- * @returns Created Job ApiObject
195
- *
196
- * @example
197
- * ```typescript
198
- * rutter.addJob({
199
- * name: 'data-processor',
200
- * image: 'busybox:1.35',
201
- * command: ['sh', '-c', 'echo "Processing..." && sleep 30'],
202
- * completions: 1
203
- * });
204
- * ```
205
- *
206
- * @since 2.4.0
207
- */
208
- addJob(spec: JobSpec): ApiObject;
209
- /**
210
- * Creates a Service resource
211
- * @param spec - Service specification
212
- * @returns Created Service ApiObject
213
- *
214
- * @example
215
- * ```typescript
216
- * rutter.addService({
217
- * name: 'web-service',
218
- * port: 80,
219
- * targetPort: 8080,
220
- * type: 'ClusterIP'
221
- * });
222
- * ```
223
- *
224
- * @since 1.0.0
225
- */
226
- addService(spec: ServiceSpec): ApiObject;
227
- /**
228
- * Creates a ConfigMap resource
229
- * @param spec - ConfigMap specification
230
- * @returns Created ConfigMap ApiObject
231
- *
232
- * @example
233
- * ```typescript
234
- * rutter.addConfigMap({
235
- * name: 'app-config',
236
- * data: {
237
- * 'config.yaml': 'key: value',
238
- * 'app.properties': 'debug=true'
239
- * }
240
- * });
241
- * ```
242
- *
243
- * @since 1.0.0
244
- */
245
- addConfigMap(spec: ConfigMapSpec): ApiObject;
246
- /**
247
- * Creates a Secret resource
248
- * @param spec - Secret specification
249
- * @returns Created Secret ApiObject
250
- *
251
- * @example
252
- * ```typescript
253
- * rutter.addSecret({
254
- * name: 'app-secrets',
255
- * type: 'Opaque',
256
- * data: {
257
- * username: 'YWRtaW4=',
258
- * password: 'MWYyZDFlMmU2N2Rm'
259
- * }
260
- * });
261
- * ```
262
- *
263
- * @since 1.0.0
264
- */
265
- addSecret(spec: SecretSpec): ApiObject;
266
- /**
267
- * Creates a ServiceAccount resource
268
- * @param spec - ServiceAccount specification
269
- * @returns Created ServiceAccount ApiObject
270
- *
271
- * @example
272
- * ```typescript
273
- * rutter.addServiceAccount({
274
- * name: 'app-service-account',
275
- * automountServiceAccountToken: false
276
- * });
277
- * ```
278
- *
279
- * @since 1.0.0
280
- */
281
- addServiceAccount(spec: ServiceAccountSpec): ApiObject;
282
- /**
283
- * Creates a PersistentVolume resource
284
- * @param spec - PersistentVolume specification
285
- * @returns Created PersistentVolume ApiObject
286
- *
287
- * @example
288
- * ```typescript
289
- * rutter.addPersistentVolume({
290
- * name: 'data-pv',
291
- * capacity: '10Gi',
292
- * accessModes: ['ReadWriteOnce'],
293
- * storageClassName: 'fast-ssd'
294
- * });
295
- * ```
296
- *
297
- * @since 1.0.0
298
- */
299
- addPersistentVolume(spec: PersistentVolumeSpec): ApiObject;
300
- /**
301
- * Creates a PersistentVolumeClaim resource
302
- * @param spec - PersistentVolumeClaim specification
303
- * @returns Created PersistentVolumeClaim ApiObject
304
- *
305
- * @example
306
- * ```typescript
307
- * rutter.addPersistentVolumeClaim({
308
- * name: 'data-pvc',
309
- * size: '10Gi',
310
- * accessModes: ['ReadWriteOnce'],
311
- * storageClassName: 'fast-ssd'
312
- * });
313
- * ```
314
- *
315
- * @since 1.0.0
316
- */
317
- addPersistentVolumeClaim(spec: PersistentVolumeClaimSpec): ApiObject;
318
- /**
319
- * Creates a StorageClass resource
320
- * @param spec - StorageClass specification
321
- * @returns Created StorageClass ApiObject
322
- *
323
- * @example
324
- * ```typescript
325
- * rutter.addStorageClass({
326
- * name: 'fast-ssd',
327
- * provisioner: 'kubernetes.io/aws-ebs',
328
- * parameters: {
329
- * type: 'gp3',
330
- * encrypted: 'true'
331
- * }
332
- * });
333
- * ```
334
- *
335
- * @since 1.0.0
336
- */
337
- addStorageClass(spec: StorageClassSpec): ApiObject;
338
27
  /**
339
28
  * Creates an AWS EBS StorageClass
340
29
  * @param spec - EBS StorageClass specification
@@ -378,14 +67,14 @@ export declare class Rutter {
378
67
  * @example
379
68
  * ```typescript
380
69
  * rutter.addAWSIRSAServiceAccount({
381
- * name: 'aws-service-account',
382
- * roleArn: 'arn:aws:iam::123456789012:role/MyRole'
70
+ * name: 'my-service-account',
71
+ * roleArn: 'arn:aws:iam::ACCOUNT_ID:role/MyRole'
383
72
  * });
384
73
  * ```
385
74
  *
386
75
  * @since 1.0.0
387
76
  */
388
- addAWSIRSAServiceAccount(spec: AWSIRSAServiceAccountSpec): ApiObject;
77
+ addAWSIRSAServiceAccount(spec: AWSIRSAServiceAccountSpec): ServiceAccount;
389
78
  /**
390
79
  * Creates an AWS ALB Ingress
391
80
  * @param spec - ALB Ingress specification
@@ -408,95 +97,7 @@ export declare class Rutter {
408
97
  *
409
98
  * @since 1.0.0
410
99
  */
411
- addAWSALBIngress(spec: AWSALBIngressSpec): ApiObject;
412
- /**
413
- * Creates an Azure Disk StorageClass
414
- * @param spec - Azure Disk StorageClass specification
415
- * @returns Created StorageClass ApiObject
416
- *
417
- * @since 2.4.0
418
- */
419
- addAzureDiskStorageClass(spec: AzureDiskStorageClassSpec): ApiObject;
420
- /**
421
- * Creates an Azure File StorageClass
422
- * @param spec - Azure File StorageClass specification
423
- * @returns Created StorageClass ApiObject
424
- *
425
- * @since 2.4.0
426
- */
427
- addAzureFileStorageClass(spec: AzureFileStorageClassSpec): ApiObject;
428
- /**
429
- * Creates an Azure Application Gateway Ingress
430
- * @param spec - AGIC Ingress specification
431
- * @returns Created Ingress ApiObject
432
- *
433
- * @since 2.4.0
434
- */
435
- addAzureApplicationGatewayIngress(spec: AzureAGICIngressSpec): ApiObject;
436
- /**
437
- * Creates an Azure Key Vault SecretProviderClass
438
- * @param spec - Azure Key Vault SecretProviderClass specification
439
- * @returns Created SecretProviderClass ApiObject
440
- *
441
- * @since 2.4.0
442
- */
443
- addAzureKeyVaultSecretProviderClass(spec: AzureKeyVaultSecretProviderClassSpec): ApiObject;
444
- /**
445
- * Creates an Azure Container Registry ServiceAccount
446
- * @param spec - Azure ACR ServiceAccount specification
447
- * @returns Created ServiceAccount ApiObject
448
- *
449
- * @since 2.4.0
450
- */
451
- addAzureACRServiceAccount(spec: AzureACRServiceAccountSpec): ApiObject;
452
- /**
453
- * Creates a GCP Persistent Disk StorageClass
454
- * @param spec - GCP PD StorageClass specification
455
- * @returns Created StorageClass ApiObject
456
- *
457
- * @since 2.4.0
458
- */
459
- addGCPPersistentDiskStorageClass(spec: GCPPersistentDiskStorageClassSpec): ApiObject;
460
- /**
461
- * Creates a GCP Filestore StorageClass
462
- * @param spec - GCP Filestore StorageClass specification
463
- * @returns Created StorageClass ApiObject
464
- *
465
- * @since 2.4.0
466
- */
467
- addGCPFilestoreStorageClass(spec: GCPFilestoreStorageClassSpec): ApiObject;
468
- /**
469
- * Creates a GCE Ingress with Google Cloud Load Balancer
470
- * @param spec - GCE Ingress specification
471
- * @returns Created Ingress ApiObject
472
- *
473
- * @since 2.4.0
474
- */
475
- addGCPGCEIngress(spec: GCPGCEIngressSpec): ApiObject;
476
- /**
477
- * Creates a ServiceAccount with Workload Identity annotations
478
- * @param spec - Workload Identity ServiceAccount specification
479
- * @returns Created ServiceAccount ApiObject
480
- *
481
- * @since 2.4.0
482
- */
483
- addGCPWorkloadIdentityServiceAccount(spec: GCPWorkloadIdentityServiceAccountSpec): ApiObject;
484
- /**
485
- * Creates a ServiceAccount with GCP Artifact Registry access
486
- * @param spec - Artifact Registry ServiceAccount specification
487
- * @returns Created ServiceAccount ApiObject
488
- *
489
- * @example
490
- * ```typescript
491
- * rutter.addGCPArtifactRegistryServiceAccount({
492
- * name: 'artifact-registry-sa',
493
- * googleServiceAccount: 'my-gsa@project.iam.gserviceaccount.com'
494
- * });
495
- * ```
496
- *
497
- * @since 2.7.0
498
- */
499
- addGCPArtifactRegistryServiceAccount(spec: GCPArtifactRegistryServiceAccountSpec): ApiObject;
100
+ addAWSALBIngress(spec: AWSALBIngressSpec): Ingress;
500
101
  /**
501
102
  * Creates a Karpenter NodePool resource
502
103
  * @param spec - NodePool specification
@@ -665,204 +266,6 @@ export declare class Rutter {
665
266
  labels?: Record<string, string>;
666
267
  annotations?: Record<string, string>;
667
268
  }): ApiObject;
668
- /**
669
- * Creates a NetworkPolicy resource
670
- * @param spec - NetworkPolicy specification
671
- * @returns Created NetworkPolicy ApiObject
672
- *
673
- * @example
674
- * ```typescript
675
- * rutter.addNetworkPolicy({
676
- * name: 'deny-all',
677
- * podSelector: {},
678
- * policyTypes: ['Ingress', 'Egress']
679
- * });
680
- * ```
681
- *
682
- * @since 2.7.0
683
- */
684
- addNetworkPolicy(spec: NetworkPolicySpec): ApiObject;
685
- /**
686
- * Creates a deny-all NetworkPolicy that blocks all traffic
687
- * @param name - Policy name
688
- * @param podSelector - Pod selector to apply policy to
689
- * @param labels - Optional labels
690
- * @param annotations - Optional annotations
691
- * @returns Created NetworkPolicy ApiObject
692
- *
693
- * @example
694
- * ```typescript
695
- * rutter.addDenyAllNetworkPolicy('deny-all', { matchLabels: { app: 'web' } });
696
- * ```
697
- *
698
- * @since 2.7.0
699
- */
700
- addDenyAllNetworkPolicy(name: string, podSelector?: NetworkPolicySpec['podSelector'], labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
701
- /**
702
- * Creates a NetworkPolicy that allows traffic from specific pods
703
- * @param name - Policy name
704
- * @param podSelector - Pod selector to apply policy to
705
- * @param fromPodSelector - Pod selector for allowed source pods
706
- * @param ports - Optional ports to allow
707
- * @param labels - Optional labels
708
- * @param annotations - Optional annotations
709
- * @returns Created NetworkPolicy ApiObject
710
- *
711
- * @example
712
- * ```typescript
713
- * rutter.addAllowFromPodsNetworkPolicy(
714
- * 'allow-from-frontend',
715
- * { matchLabels: { app: 'backend' } },
716
- * { matchLabels: { app: 'frontend' } },
717
- * [{ port: 8080, protocol: 'TCP' }]
718
- * );
719
- * ```
720
- *
721
- * @since 2.7.0
722
- */
723
- addAllowFromPodsNetworkPolicy(name: string, podSelector: NetworkPolicySpec['podSelector'], fromPodSelector: NetworkPolicySpec['podSelector'], ports?: Array<{
724
- port?: number | string;
725
- protocol?: 'TCP' | 'UDP' | 'SCTP';
726
- }>, labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
727
- /**
728
- * Creates a NetworkPolicy that allows traffic from specific namespaces
729
- * @param name - Policy name
730
- * @param podSelector - Pod selector to apply policy to
731
- * @param fromNamespaceSelector - Namespace selector for allowed source namespaces
732
- * @param ports - Optional ports to allow
733
- * @param labels - Optional labels
734
- * @param annotations - Optional annotations
735
- * @returns Created NetworkPolicy ApiObject
736
- *
737
- * @example
738
- * ```typescript
739
- * rutter.addAllowFromNamespaceNetworkPolicy(
740
- * 'allow-from-monitoring',
741
- * { matchLabels: { app: 'web' } },
742
- * { matchLabels: { name: 'monitoring' } },
743
- * [{ port: 9090, protocol: 'TCP' }]
744
- * );
745
- * ```
746
- *
747
- * @since 2.7.0
748
- */
749
- addAllowFromNamespaceNetworkPolicy(name: string, podSelector: NetworkPolicySpec['podSelector'], fromNamespaceSelector: NetworkPolicySpec['podSelector'], ports?: Array<{
750
- port?: number | string;
751
- protocol?: 'TCP' | 'UDP' | 'SCTP';
752
- }>, labels?: Record<string, string>, annotations?: Record<string, string>): ApiObject;
753
- /**
754
- * Creates an Ingress resource with optional TLS validation
755
- * @param spec - Ingress specification
756
- * @returns Created Ingress ApiObject
757
- *
758
- * @example
759
- * ```typescript
760
- * rutter.addIngress({
761
- * name: 'web-ingress',
762
- * rules: [{
763
- * host: 'example.com',
764
- * http: {
765
- * paths: [{
766
- * path: '/',
767
- * pathType: 'Prefix',
768
- * backend: {
769
- * service: { name: 'web-service', port: { number: 80 } }
770
- * }
771
- * }]
772
- * }
773
- * }]
774
- * });
775
- * ```
776
- *
777
- * @deprecated Use addSecureIngress for enhanced security validation
778
- * @since 2.7.0
779
- */
780
- /**
781
- * Creates an Ingress resource for external access to services
782
- * @param spec - Ingress specification
783
- * @returns Created Ingress ApiObject
784
- * @deprecated Use addSecureIngress for enhanced security validation
785
- * @since 2.7.0
786
- */
787
- addIngress(spec: IngressSpec): ApiObject;
788
- /**
789
- * Creates a simple Ingress resource with optional TLS
790
- * @param name - Resource name
791
- * @param host - Domain host
792
- * @param serviceName - Backend service name
793
- * @param servicePort - Backend service port
794
- * @param options - Optional configuration
795
- * @returns Created Ingress ApiObject
796
- * @since 2.8.1
797
- */
798
- addIngress(name: string, host: string, serviceName: string, servicePort: number, options?: {
799
- tls?: boolean | string;
800
- className?: string;
801
- annotations?: Record<string, string>;
802
- path?: string;
803
- pathType?: 'Exact' | 'Prefix' | 'ImplementationSpecific';
804
- sslRedirect?: boolean;
805
- certManager?: string;
806
- }): ApiObject;
807
- /**
808
- * Creates a simple Ingress with enhanced options
809
- * @private
810
- */
811
- private createSimpleIngress;
812
- /**
813
- * Builds annotations for Ingress based on options
814
- * @private
815
- */
816
- private buildIngressAnnotations;
817
- /**
818
- * Adds SSL redirect annotation based on class and options
819
- * @private
820
- */
821
- private addSSLRedirectAnnotation;
822
- /**
823
- * Adds cert-manager annotation if specified
824
- * @private
825
- */
826
- private addCertManagerAnnotation;
827
- /**
828
- * Adds NGINX-specific annotations
829
- * @private
830
- */
831
- private addNginxAnnotations;
832
- /**
833
- * Creates a secure Ingress resource with TLS validation and environment-aware security defaults
834
- * @param spec - Enhanced Ingress specification with security options
835
- * @returns Created Ingress ApiObject
836
- *
837
- * @example
838
- * ```typescript
839
- * // Production Ingress with mandatory TLS
840
- * rutter.addSecureIngress({
841
- * name: 'secure-web-ingress',
842
- * environment: 'production',
843
- * tls: [{
844
- * hosts: ['secure.example.com'],
845
- * secretName: 'secure-example-tls'
846
- * }],
847
- * forceSSLRedirect: true,
848
- * rules: [{
849
- * host: 'secure.example.com',
850
- * http: {
851
- * paths: [{
852
- * path: '/',
853
- * pathType: 'Prefix',
854
- * backend: {
855
- * service: { name: 'web-service', port: { number: 80 } }
856
- * }
857
- * }]
858
- * }
859
- * }]
860
- * });
861
- * ```
862
- *
863
- * @since 2.8.0
864
- */
865
- addSecureIngress(spec: IngressSpec): ApiObject;
866
269
  /**
867
270
  * Creates a ServiceAccount with ECR access annotations
868
271
  * @param spec - ECR ServiceAccount specification
@@ -872,130 +275,90 @@ export declare class Rutter {
872
275
  * ```typescript
873
276
  * rutter.addAWSECRServiceAccount({
874
277
  * name: 'ecr-service-account',
875
- * roleArn: 'arn:aws:iam::123456789012:role/ECRAccessRole'
278
+ * roleArn: 'arn:aws:iam::ACCOUNT_ID:role/ECRAccessRole'
876
279
  * });
877
280
  * ```
878
281
  *
879
282
  * @since 2.7.0
880
283
  */
881
- addAWSECRServiceAccount(spec: AWSECRServiceAccountSpec): ApiObject;
284
+ addAWSECRServiceAccount(spec: AWSECRServiceAccountSpec): ServiceAccount;
882
285
  /**
883
- * Creates a Horizontal Pod Autoscaler (HPA) resource
884
- * @param spec - HPA specification
885
- * @returns Created HPA ApiObject
286
+ * Adds a Kubernetes manifest to the chart using CDK8S
886
287
  *
887
- * @example
888
- * ```typescript
889
- * rutter.addHorizontalPodAutoscaler({
890
- * name: 'web-hpa',
891
- * scaleTargetRef: {
892
- * apiVersion: 'apps/v1',
893
- * kind: 'Deployment',
894
- * name: 'web-app'
895
- * },
896
- * minReplicas: 2,
897
- * maxReplicas: 10,
898
- * metrics: [{
899
- * type: 'Resource',
900
- * resource: {
901
- * name: 'cpu',
902
- * target: { type: 'Utilization', averageUtilization: 70 }
903
- * }
904
- * }]
905
- * });
906
- * ```
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.
907
291
  *
908
- * @since 2.7.0
909
- */
910
- addHorizontalPodAutoscaler(spec: HorizontalPodAutoscalerSpec): ApiObject;
911
- /**
912
- * Creates a Vertical Pod Autoscaler (VPA) resource
913
- * @param spec - VPA specification
914
- * @returns Created VPA ApiObject
292
+ * @param yamlOrObject - Kubernetes manifest as YAML string or object
293
+ * @param id - Unique identifier for the manifest (required for multiple manifests)
915
294
  *
916
295
  * @example
917
296
  * ```typescript
918
- * rutter.addVerticalPodAutoscaler({
919
- * name: 'web-vpa',
920
- * targetRef: {
921
- * apiVersion: 'apps/v1',
922
- * kind: 'Deployment',
923
- * name: 'web-app'
924
- * },
925
- * updatePolicy: { updateMode: 'Auto' }
926
- * });
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');
927
315
  * ```
928
316
  *
929
- * @since 2.7.0
317
+ * @since 3.0.0
318
+ * @note Consider using cdk8s-plus constructs for better type safety when available
930
319
  */
931
- addVerticalPodAutoscaler(spec: VerticalPodAutoscalerSpec): ApiObject;
320
+ addManifest(yamlOrObject: string | Record<string, unknown>, id: string): ApiObject;
932
321
  /**
933
- * Creates a CronJob resource
934
- * @param spec - CronJob specification
935
- * @returns Created CronJob ApiObject
322
+ * Adds a Kubernetes manifest wrapped in a Helm conditional
936
323
  *
937
- * @example
938
- * ```typescript
939
- * rutter.addCronJob({
940
- * name: 'backup-job',
941
- * schedule: '0 2 * * *',
942
- * jobTemplate: {
943
- * spec: {
944
- * template: {
945
- * spec: {
946
- * containers: [{
947
- * name: 'backup',
948
- * image: 'backup:latest',
949
- * command: ['backup.sh']
950
- * }],
951
- * restartPolicy: 'OnFailure'
952
- * }
953
- * }
954
- * }
955
- * }
956
- * });
957
- * ```
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.
958
326
  *
959
- * @since 2.7.0
960
- */
961
- addCronJob(spec: CronJobSpec): ApiObject;
962
- /**
963
- * Adds a custom resource definition (CRD) YAML or object
964
- * @param yamlOrObject - CRD YAML content string or object
965
- * @param id - Unique identifier for the CRD
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
966
332
  *
967
333
  * @example
968
334
  * ```typescript
969
- * // Using YAML string
970
- * rutter.addCrd(`
971
- * apiVersion: apiextensions.k8s.io/v1
972
- * kind: CustomResourceDefinition
973
- * metadata:
974
- * name: example.com
975
- * spec:
976
- * group: example.com
977
- * versions: []
978
- * `);
979
- *
980
- * // Using object
981
- * rutter.addCrd({
982
- * apiVersion: 'apiextensions.k8s.io/v1',
983
- * kind: 'CustomResourceDefinition',
984
- * metadata: { name: 'example.com' },
985
- * spec: { group: 'example.com', versions: [] }
986
- * });
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
+ * );
987
350
  * ```
988
351
  *
989
- * @since 1.0.0
352
+ * @since 2.7.4
990
353
  */
991
- addCrd(yamlOrObject: string | Record<string, unknown>, id?: string): void;
354
+ addConditionalManifest(manifestObject: Record<string, unknown>, condition: string, id: string): ApiObject;
992
355
  /**
993
- * Validates CRD structure according to Kubernetes specification
994
- * @param crd - CRD object to validate
356
+ * Validates the structure of a Kubernetes manifest object
357
+ * @param manifest - The manifest object to validate
995
358
  * @private
996
- * @since 2.5.0
359
+ * @since 3.0.0
997
360
  */
998
- private validateCrdStructure;
361
+ private validateManifestStructure;
999
362
  /**
1000
363
  * Gets chart metadata
1001
364
  * @returns Chart metadata
@@ -1035,6 +398,12 @@ export declare class Rutter {
1035
398
  * @since 2.4.0
1036
399
  */
1037
400
  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
+ private processHelmTemplates;
1038
407
  /**
1039
408
  * Writes the Helm chart to the specified output directory
1040
409
  * @param outDir - Output directory path
@@ -1066,15 +435,11 @@ export interface RutterProps {
1066
435
  /** Custom Helm helpers content or definitions */
1067
436
  helpersTpl?: string | HelperDefinition[];
1068
437
  /** Cloud provider for default helpers */
1069
- cloudProvider?: 'aws' | 'azure' | 'gcp';
1070
- /** Manifest file naming strategy */
1071
- namingStrategy?: NamingStrategy;
438
+ cloudProvider?: 'aws';
1072
439
  /** Custom prefix for manifest files */
1073
440
  manifestPrefix?: string;
1074
441
  /** Combine all resources into single manifest file */
1075
442
  singleManifestFile?: boolean;
1076
443
  }
1077
- export type { DeploymentSpec, ServiceSpec, ConfigMapSpec, SecretSpec, ServiceAccountSpec, } from './resources/core/coreResources.js';
1078
- export type { PersistentVolumeSpec, PersistentVolumeClaimSpec, StorageClassSpec, } from './resources/core/storageResources.js';
1079
444
  export type { AWSEBSStorageClassSpec, AWSEFSStorageClassSpec, AWSIRSAServiceAccountSpec, AWSALBIngressSpec, } from './resources/cloud/aws/awsResources.js';
1080
445
  //# sourceMappingURL=rutter.d.ts.map