timonel 2.1.1 → 2.3.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.
@@ -1,136 +1,327 @@
1
+ /**
2
+ * @fileoverview Rutter - Main class for building Kubernetes manifests and Helm charts
3
+ * @since 1.0.0
4
+ */
1
5
  import { ApiObject } from 'cdk8s';
2
6
  import type { HelmChartMeta, HelperDefinition } from './HelmChartWriter.js';
7
+ /**
8
+ * HTTP header for health probes
9
+ *
10
+ * @interface HttpHeader
11
+ * @since 0.1.0
12
+ */
3
13
  export interface HttpHeader {
14
+ /** Header name */
4
15
  name: string;
16
+ /** Header value */
5
17
  value: string;
6
18
  }
19
+ /**
20
+ * HTTP GET action for health probes
21
+ *
22
+ * @interface HttpGetAction
23
+ * @since 0.1.0
24
+ */
7
25
  export interface HttpGetAction {
26
+ /** HTTP path to probe */
8
27
  path?: string;
28
+ /** Port number or name */
9
29
  port: number | string;
30
+ /** HTTP or HTTPS scheme */
10
31
  scheme?: 'HTTP' | 'HTTPS';
32
+ /** Additional HTTP headers */
11
33
  httpHeaders?: HttpHeader[];
12
34
  }
35
+ /**
36
+ * Exec action for health probes
37
+ *
38
+ * @interface ExecAction
39
+ * @since 0.1.0
40
+ */
13
41
  export interface ExecAction {
42
+ /** Command to execute */
14
43
  command: string[];
15
44
  }
45
+ /**
46
+ * TCP socket action for health probes
47
+ *
48
+ * @interface TcpSocketAction
49
+ * @since 0.1.0
50
+ */
16
51
  export interface TcpSocketAction {
52
+ /** Port number or name */
17
53
  port: number | string;
18
54
  }
55
+ /**
56
+ * Kubernetes probe configuration
57
+ *
58
+ * @interface Probe
59
+ * @since 0.1.0
60
+ */
19
61
  export interface Probe {
62
+ /** HTTP GET probe */
20
63
  httpGet?: HttpGetAction;
64
+ /** Exec probe */
21
65
  exec?: ExecAction;
66
+ /** TCP socket probe */
22
67
  tcpSocket?: TcpSocketAction;
68
+ /** Initial delay before probing */
23
69
  initialDelaySeconds?: number;
70
+ /** Probe frequency */
24
71
  periodSeconds?: number;
72
+ /** Probe timeout */
25
73
  timeoutSeconds?: number;
74
+ /** Success threshold */
26
75
  successThreshold?: number;
76
+ /** Failure threshold */
27
77
  failureThreshold?: number;
28
78
  }
79
+ /**
80
+ * Environment variable source from ConfigMap or Secret
81
+ *
82
+ * @interface EnvFromSource
83
+ * @since 0.1.0
84
+ */
29
85
  export interface EnvFromSource {
86
+ /** ConfigMap reference */
30
87
  configMapRef?: string;
88
+ /** Secret reference */
31
89
  secretRef?: string;
32
90
  }
91
+ /**
92
+ * Volume source specification
93
+ *
94
+ * @interface VolumeSourceSpec
95
+ * @since 0.1.0
96
+ */
33
97
  export interface VolumeSourceSpec {
98
+ /** Volume name */
34
99
  name: string;
100
+ /** ConfigMap volume source */
35
101
  configMap?: string;
102
+ /** Secret volume source */
36
103
  secret?: string;
104
+ /** PersistentVolumeClaim source */
37
105
  persistentVolumeClaim?: string;
38
106
  }
107
+ /**
108
+ * Volume mount specification
109
+ *
110
+ * @interface VolumeMountSpec
111
+ * @since 0.1.0
112
+ */
39
113
  export interface VolumeMountSpec {
114
+ /** Volume name to mount */
40
115
  name: string;
116
+ /** Mount path in container */
41
117
  mountPath: string;
118
+ /** Mount as read-only */
42
119
  readOnly?: boolean;
120
+ /** Sub-path within volume */
43
121
  subPath?: string;
44
122
  }
123
+ /**
124
+ * Kubernetes resource requirements
125
+ *
126
+ * @interface ResourceRequirements
127
+ * @since 0.1.0
128
+ */
45
129
  export interface ResourceRequirements {
130
+ /** Resource limits */
46
131
  limits?: {
47
132
  cpu?: string;
48
133
  memory?: string;
49
134
  };
135
+ /** Resource requests */
50
136
  requests?: {
51
137
  cpu?: string;
52
138
  memory?: string;
53
139
  };
54
140
  }
141
+ /**
142
+ * Kubernetes PersistentVolume access modes
143
+ *
144
+ * @typedef {string} AccessMode
145
+ * @since 1.0.0
146
+ */
55
147
  export type AccessMode = 'ReadWriteOnce' | 'ReadOnlyMany' | 'ReadWriteMany' | 'ReadWriteOncePod';
148
+ /**
149
+ * Kubernetes volume modes
150
+ *
151
+ * @typedef {string} VolumeMode
152
+ * @since 1.0.0
153
+ */
56
154
  export type VolumeMode = 'Filesystem' | 'Block';
155
+ /**
156
+ * Kubernetes PersistentVolume reclaim policies
157
+ *
158
+ * @typedef {string} ReclaimPolicy
159
+ * @since 1.0.0
160
+ */
57
161
  export type ReclaimPolicy = 'Retain' | 'Recycle' | 'Delete';
162
+ /**
163
+ * CSI volume source specification
164
+ *
165
+ * @interface CsiVolumeSource
166
+ * @since 1.0.0
167
+ */
58
168
  export interface CsiVolumeSource {
169
+ /** CSI driver name */
59
170
  driver: string;
171
+ /** Volume handle */
60
172
  volumeHandle: string;
173
+ /** Filesystem type */
61
174
  fsType?: string;
175
+ /** Read-only volume */
62
176
  readOnly?: boolean;
177
+ /** Volume attributes */
63
178
  volumeAttributes?: Record<string, string>;
179
+ /** Controller publish secret reference */
64
180
  controllerPublishSecretRef?: {
65
181
  name: string;
66
182
  namespace?: string;
67
183
  };
184
+ /** Node stage secret reference */
68
185
  nodeStageSecretRef?: {
69
186
  name: string;
70
187
  namespace?: string;
71
188
  };
189
+ /** Node publish secret reference */
72
190
  nodePublishSecretRef?: {
73
191
  name: string;
74
192
  namespace?: string;
75
193
  };
194
+ /** Controller expand secret reference */
76
195
  controllerExpandSecretRef?: {
77
196
  name: string;
78
197
  namespace?: string;
79
198
  };
80
199
  }
200
+ /**
201
+ * NFS volume source specification
202
+ *
203
+ * @interface NfsVolumeSource
204
+ * @since 1.0.0
205
+ */
81
206
  export interface NfsVolumeSource {
207
+ /** NFS server */
82
208
  server: string;
209
+ /** NFS path */
83
210
  path: string;
211
+ /** Read-only mount */
84
212
  readOnly?: boolean;
85
213
  }
214
+ /**
215
+ * AWS Elastic Block Store volume source
216
+ *
217
+ * @interface AwsElasticBlockStoreSource
218
+ * @since 1.0.0
219
+ */
86
220
  export interface AwsElasticBlockStoreSource {
221
+ /** EBS volume ID */
87
222
  volumeID: string;
223
+ /** Filesystem type */
88
224
  fsType?: string;
225
+ /** Partition number */
89
226
  partition?: number;
227
+ /** Read-only volume */
90
228
  readOnly?: boolean;
91
229
  }
230
+ /**
231
+ * Host path volume source
232
+ *
233
+ * @interface HostPathSource
234
+ * @since 1.0.0
235
+ */
92
236
  export interface HostPathSource {
237
+ /** Host path */
93
238
  path: string;
239
+ /** Path type */
94
240
  type?: string;
95
241
  }
242
+ /**
243
+ * PersistentVolume source specification
244
+ *
245
+ * @interface PersistentVolumeSourceSpec
246
+ * @since 1.0.0
247
+ */
96
248
  export interface PersistentVolumeSourceSpec {
249
+ /** CSI volume source */
97
250
  csi?: CsiVolumeSource;
251
+ /** NFS volume source */
98
252
  nfs?: NfsVolumeSource;
253
+ /** AWS EBS volume source */
99
254
  awsElasticBlockStore?: AwsElasticBlockStoreSource;
255
+ /** Host path volume source */
100
256
  hostPath?: HostPathSource;
257
+ /** Azure Disk volume source */
101
258
  azureDisk?: {
259
+ /** Disk name */
102
260
  diskName: string;
261
+ /** Disk URI */
103
262
  diskURI: string;
263
+ /** Caching mode */
104
264
  cachingMode?: 'None' | 'ReadOnly' | 'ReadWrite';
265
+ /** Filesystem type */
105
266
  fsType?: string;
267
+ /** Read-only disk */
106
268
  readOnly?: boolean;
269
+ /** Disk kind */
107
270
  kind?: 'Shared' | 'Dedicated' | 'Managed';
108
271
  };
272
+ /** Azure File volume source */
109
273
  azureFile?: {
274
+ /** Secret name */
110
275
  secretName: string;
276
+ /** Share name */
111
277
  shareName: string;
278
+ /** Read-only file */
112
279
  readOnly?: boolean;
280
+ /** Secret namespace */
113
281
  secretNamespace?: string;
114
282
  };
283
+ /** GCE Persistent Disk volume source */
115
284
  gcePersistentDisk?: {
285
+ /** Persistent disk name */
116
286
  pdName: string;
287
+ /** Filesystem type */
117
288
  fsType?: string;
289
+ /** Partition number */
118
290
  partition?: number;
291
+ /** Read-only disk */
119
292
  readOnly?: boolean;
120
293
  };
294
+ /** Custom volume sources */
121
295
  [key: string]: unknown;
122
296
  }
297
+ /**
298
+ * Kubernetes PersistentVolume specification
299
+ *
300
+ * @interface PersistentVolumeSpec
301
+ * @since 1.0.0
302
+ */
123
303
  export interface PersistentVolumeSpec {
304
+ /** PersistentVolume name */
124
305
  name: string;
306
+ /** Storage capacity (e.g., '10Gi') */
125
307
  capacity: string;
308
+ /** Access modes */
126
309
  accessModes: AccessMode[];
310
+ /** Storage class name */
127
311
  storageClassName?: string;
312
+ /** Volume mode */
128
313
  volumeMode?: VolumeMode;
314
+ /** Reclaim policy */
129
315
  reclaimPolicy?: ReclaimPolicy;
316
+ /** Mount options */
130
317
  mountOptions?: string[];
318
+ /** Node affinity */
131
319
  nodeAffinity?: Record<string, unknown>;
320
+ /** PersistentVolume labels */
132
321
  labels?: Record<string, string>;
322
+ /** PersistentVolume annotations */
133
323
  annotations?: Record<string, string>;
324
+ /** Volume source */
134
325
  source: PersistentVolumeSourceSpec;
135
326
  /** Reference to related PVC for binding */
136
327
  claimRef?: {
@@ -140,147 +331,301 @@ export interface PersistentVolumeSpec {
140
331
  /** Cloud provider for optimized defaults */
141
332
  cloudProvider?: 'aws' | 'azure' | 'gcp';
142
333
  }
334
+ /**
335
+ * Kubernetes Deployment specification
336
+ *
337
+ * @interface DeploymentSpec
338
+ * @since 0.1.0
339
+ *
340
+ * @example
341
+ * ```typescript
342
+ * const deployment: DeploymentSpec = {
343
+ * name: 'web-app',
344
+ * image: 'nginx:1.21',
345
+ * replicas: 3,
346
+ * containerPort: 80,
347
+ * env: { NODE_ENV: 'production' }
348
+ * };
349
+ * ```
350
+ */
143
351
  export interface DeploymentSpec {
352
+ /** Deployment name */
144
353
  name: string;
354
+ /** Container image */
145
355
  image: string;
356
+ /** Number of replicas */
146
357
  replicas?: number;
358
+ /** Container port */
147
359
  containerPort?: number;
360
+ /** Environment variables */
148
361
  env?: Record<string, string>;
362
+ /** Environment from ConfigMap/Secret */
149
363
  envFrom?: EnvFromSource[];
364
+ /** Volume sources */
150
365
  volumes?: VolumeSourceSpec[];
366
+ /** Volume mounts */
151
367
  volumeMounts?: VolumeMountSpec[];
368
+ /** Resource requirements */
152
369
  resources?: ResourceRequirements;
370
+ /** Liveness probe */
153
371
  livenessProbe?: Probe;
372
+ /** Readiness probe */
154
373
  readinessProbe?: Probe;
374
+ /** Image pull policy */
155
375
  imagePullPolicy?: 'Always' | 'IfNotPresent' | 'Never';
376
+ /** Service account name */
156
377
  serviceAccountName?: string;
378
+ /** Pod selector labels */
157
379
  matchLabels?: Record<string, string>;
158
- /** Optional extra labels on the Deployment metadata */
380
+ /** Deployment metadata labels */
159
381
  labels?: Record<string, string>;
160
- /** Optional annotations on the Deployment metadata */
382
+ /** Deployment metadata annotations */
161
383
  annotations?: Record<string, string>;
162
- /** Optional extra labels on the pod template (merged with matchLabels) */
384
+ /** Pod template labels */
163
385
  podLabels?: Record<string, string>;
164
- /** Optional annotations on the pod template (useful for reloaders, etc.) */
386
+ /** Pod template annotations */
165
387
  podAnnotations?: Record<string, string>;
166
388
  }
389
+ /**
390
+ * Kubernetes ReplicaSet specification
391
+ *
392
+ * @interface ReplicaSetSpec
393
+ * @since 1.0.0
394
+ */
167
395
  export interface ReplicaSetSpec {
396
+ /** ReplicaSet name */
168
397
  name: string;
398
+ /** Container image */
169
399
  image: string;
400
+ /** Number of replicas */
170
401
  replicas?: number;
402
+ /** Container port */
171
403
  containerPort?: number;
404
+ /** Environment variables */
172
405
  env?: Record<string, string>;
406
+ /** Environment from ConfigMap/Secret */
173
407
  envFrom?: EnvFromSource[];
408
+ /** Volume sources */
174
409
  volumes?: VolumeSourceSpec[];
410
+ /** Volume mounts */
175
411
  volumeMounts?: VolumeMountSpec[];
412
+ /** Resource requirements */
176
413
  resources?: ResourceRequirements;
414
+ /** Liveness probe */
177
415
  livenessProbe?: Probe;
416
+ /** Readiness probe */
178
417
  readinessProbe?: Probe;
418
+ /** Image pull policy */
179
419
  imagePullPolicy?: 'Always' | 'IfNotPresent' | 'Never';
420
+ /** Service account name */
180
421
  serviceAccountName?: string;
422
+ /** Pod selector labels */
181
423
  matchLabels?: Record<string, string>;
182
- /** Optional extra labels on the ReplicaSet metadata */
424
+ /** ReplicaSet metadata labels */
183
425
  labels?: Record<string, string>;
184
- /** Optional annotations on the ReplicaSet metadata */
426
+ /** ReplicaSet metadata annotations */
185
427
  annotations?: Record<string, string>;
186
- /** Optional extra labels on the pod template (merged with matchLabels) */
428
+ /** Pod template labels */
187
429
  podLabels?: Record<string, string>;
188
- /** Optional annotations on the pod template (useful for reloaders, etc.) */
430
+ /** Pod template annotations */
189
431
  podAnnotations?: Record<string, string>;
190
432
  }
433
+ /**
434
+ * Kubernetes Job specification
435
+ *
436
+ * @interface JobSpec
437
+ * @since 2.1.0
438
+ */
191
439
  export interface JobSpec {
440
+ /** Job name */
192
441
  name: string;
442
+ /** Container image */
193
443
  image: string;
444
+ /** Command to run */
194
445
  command?: string[];
446
+ /** Arguments to command */
195
447
  args?: string[];
448
+ /** Environment variables */
196
449
  env?: Record<string, string>;
450
+ /** Environment from ConfigMap/Secret */
197
451
  envFrom?: EnvFromSource[];
452
+ /** Volume sources */
198
453
  volumes?: VolumeSourceSpec[];
454
+ /** Volume mounts */
199
455
  volumeMounts?: VolumeMountSpec[];
456
+ /** Resource requirements */
200
457
  resources?: ResourceRequirements;
458
+ /** Restart policy */
201
459
  restartPolicy?: 'Never' | 'OnFailure';
460
+ /** Backoff limit for retries */
202
461
  backoffLimit?: number;
462
+ /** Active deadline in seconds */
203
463
  activeDeadlineSeconds?: number;
464
+ /** TTL after finished in seconds */
204
465
  ttlSecondsAfterFinished?: number;
466
+ /** Number of completions */
205
467
  completions?: number;
468
+ /** Parallelism level */
206
469
  parallelism?: number;
470
+ /** Completion mode */
207
471
  completionMode?: 'NonIndexed' | 'Indexed';
472
+ /** Suspend job execution */
208
473
  suspend?: boolean;
474
+ /** Image pull policy */
209
475
  imagePullPolicy?: 'Always' | 'IfNotPresent' | 'Never';
476
+ /** Service account name */
210
477
  serviceAccountName?: string;
211
- /** Optional extra labels on the Job metadata */
478
+ /** Job metadata labels */
212
479
  labels?: Record<string, string>;
213
- /** Optional annotations on the Job metadata */
480
+ /** Job metadata annotations */
214
481
  annotations?: Record<string, string>;
215
- /** Optional extra labels on the pod template */
482
+ /** Pod template labels */
216
483
  podLabels?: Record<string, string>;
217
- /** Optional annotations on the pod template */
484
+ /** Pod template annotations */
218
485
  podAnnotations?: Record<string, string>;
219
486
  }
487
+ /**
488
+ * Kubernetes CronJob specification
489
+ *
490
+ * @interface CronJobSpec
491
+ * @since 2.1.0
492
+ */
220
493
  export interface CronJobSpec {
494
+ /** CronJob name */
221
495
  name: string;
496
+ /** Cron schedule expression */
222
497
  schedule: string;
498
+ /** Container image */
223
499
  image: string;
500
+ /** Command to run */
224
501
  command?: string[];
502
+ /** Arguments to command */
225
503
  args?: string[];
504
+ /** Environment variables */
226
505
  env?: Record<string, string>;
506
+ /** Environment from ConfigMap/Secret */
227
507
  envFrom?: EnvFromSource[];
508
+ /** Volume sources */
228
509
  volumes?: VolumeSourceSpec[];
510
+ /** Volume mounts */
229
511
  volumeMounts?: VolumeMountSpec[];
512
+ /** Resource requirements */
230
513
  resources?: ResourceRequirements;
514
+ /** Restart policy */
231
515
  restartPolicy?: 'Never' | 'OnFailure';
516
+ /** Backoff limit for retries */
232
517
  backoffLimit?: number;
518
+ /** Active deadline in seconds */
233
519
  activeDeadlineSeconds?: number;
520
+ /** TTL after finished in seconds */
234
521
  ttlSecondsAfterFinished?: number;
522
+ /** Number of completions */
235
523
  completions?: number;
524
+ /** Parallelism level */
236
525
  parallelism?: number;
526
+ /** Completion mode */
237
527
  completionMode?: 'NonIndexed' | 'Indexed';
528
+ /** Suspend job execution */
238
529
  suspend?: boolean;
530
+ /** Starting deadline in seconds */
239
531
  startingDeadlineSeconds?: number;
532
+ /** Concurrency policy */
240
533
  concurrencyPolicy?: 'Allow' | 'Forbid' | 'Replace';
534
+ /** Successful jobs history limit */
241
535
  successfulJobsHistoryLimit?: number;
536
+ /** Failed jobs history limit */
242
537
  failedJobsHistoryLimit?: number;
538
+ /** Time zone */
243
539
  timeZone?: string;
540
+ /** Image pull policy */
244
541
  imagePullPolicy?: 'Always' | 'IfNotPresent' | 'Never';
542
+ /** Service account name */
245
543
  serviceAccountName?: string;
246
- /** Optional extra labels on the CronJob metadata */
544
+ /** CronJob metadata labels */
247
545
  labels?: Record<string, string>;
248
- /** Optional annotations on the CronJob metadata */
546
+ /** CronJob metadata annotations */
249
547
  annotations?: Record<string, string>;
250
- /** Optional extra labels on the pod template */
548
+ /** Pod template labels */
251
549
  podLabels?: Record<string, string>;
252
- /** Optional annotations on the pod template */
550
+ /** Pod template annotations */
253
551
  podAnnotations?: Record<string, string>;
254
552
  }
553
+ /**
554
+ * Kubernetes Service specification
555
+ *
556
+ * @interface ServiceSpec
557
+ * @since 1.0.0
558
+ *
559
+ * @example
560
+ * ```typescript
561
+ * const service: ServiceSpec = {
562
+ * name: 'web-service',
563
+ * ports: [{ port: 80, targetPort: 8080 }],
564
+ * type: 'LoadBalancer'
565
+ * };
566
+ * ```
567
+ */
255
568
  export interface ServiceSpec {
569
+ /** Service name */
256
570
  name: string;
571
+ /** Service ports */
257
572
  ports: Array<{
573
+ /** Service port */
258
574
  port: number;
575
+ /** Target port on pods */
259
576
  targetPort?: number;
577
+ /** Protocol */
260
578
  protocol?: 'TCP' | 'UDP' | 'SCTP';
579
+ /** Port name */
261
580
  name?: string;
581
+ /** NodePort (for NodePort/LoadBalancer) */
262
582
  nodePort?: number;
263
583
  }>;
584
+ /** Service type */
264
585
  type?: 'ClusterIP' | 'NodePort' | 'LoadBalancer' | 'ExternalName';
586
+ /** Pod selector */
265
587
  selector?: Record<string, string>;
588
+ /** Cluster IP */
266
589
  clusterIP?: string;
590
+ /** External name (for ExternalName type) */
267
591
  externalName?: string;
592
+ /** Session affinity */
268
593
  sessionAffinity?: 'None' | 'ClientIP';
594
+ /** Load balancer IP */
269
595
  loadBalancerIP?: string;
596
+ /** Load balancer source ranges */
270
597
  loadBalancerSourceRanges?: string[];
598
+ /** Load balancer class */
271
599
  loadBalancerClass?: string;
600
+ /** External traffic policy */
272
601
  externalTrafficPolicy?: 'Cluster' | 'Local';
602
+ /** Internal traffic policy */
273
603
  internalTrafficPolicy?: 'Cluster' | 'Local';
604
+ /** IP family policy */
274
605
  ipFamilyPolicy?: 'SingleStack' | 'PreferDualStack' | 'RequireDualStack';
606
+ /** IP families */
275
607
  ipFamilies?: Array<'IPv4' | 'IPv6'>;
608
+ /** Service labels */
276
609
  labels?: Record<string, string>;
610
+ /** Service annotations */
277
611
  annotations?: Record<string, string>;
278
612
  }
613
+ /**
614
+ * Kubernetes Ingress rule specification
615
+ *
616
+ * @interface IngressRule
617
+ * @since 1.0.0
618
+ */
279
619
  export interface IngressRule {
620
+ /** Host name */
280
621
  host?: string;
622
+ /** Path rules */
281
623
  paths: Array<{
624
+ /** URL path */
282
625
  path: string;
626
+ /** Path matching type */
283
627
  pathType: 'Exact' | 'Prefix' | 'ImplementationSpecific';
628
+ /** Backend service */
284
629
  backend: {
285
630
  service: {
286
631
  name: string;
@@ -292,15 +637,34 @@ export interface IngressRule {
292
637
  };
293
638
  }>;
294
639
  }
640
+ /**
641
+ * Kubernetes Ingress TLS specification
642
+ *
643
+ * @interface IngressTLS
644
+ * @since 1.0.0
645
+ */
295
646
  export interface IngressTLS {
647
+ /** TLS hosts */
296
648
  hosts?: string[];
649
+ /** Secret name containing TLS certificate */
297
650
  secretName?: string;
298
651
  }
652
+ /**
653
+ * Kubernetes Ingress specification
654
+ *
655
+ * @interface IngressSpec
656
+ * @since 1.0.0
657
+ */
299
658
  export interface IngressSpec {
659
+ /** Ingress name */
300
660
  name: string;
661
+ /** Ingress rules */
301
662
  rules: IngressRule[];
663
+ /** TLS configuration */
302
664
  tls?: IngressTLS[];
665
+ /** Ingress class name */
303
666
  ingressClassName?: string;
667
+ /** Default backend */
304
668
  defaultBackend?: {
305
669
  service: {
306
670
  name: string;
@@ -310,29 +674,65 @@ export interface IngressSpec {
310
674
  };
311
675
  };
312
676
  };
677
+ /** Ingress labels */
313
678
  labels?: Record<string, string>;
679
+ /** Ingress annotations */
314
680
  annotations?: Record<string, string>;
315
681
  }
682
+ /**
683
+ * Kubernetes ConfigMap specification
684
+ *
685
+ * @interface ConfigMapSpec
686
+ * @since 1.0.0
687
+ */
316
688
  export interface ConfigMapSpec {
689
+ /** ConfigMap name */
317
690
  name: string;
691
+ /** String data */
318
692
  data?: Record<string, string>;
693
+ /** Binary data */
319
694
  binaryData?: Record<string, string>;
695
+ /** Immutable ConfigMap */
320
696
  immutable?: boolean;
697
+ /** ConfigMap labels */
321
698
  labels?: Record<string, string>;
699
+ /** ConfigMap annotations */
322
700
  annotations?: Record<string, string>;
323
701
  }
702
+ /**
703
+ * Kubernetes Secret specification
704
+ *
705
+ * @interface SecretSpec
706
+ * @since 1.0.0
707
+ */
324
708
  export interface SecretSpec {
709
+ /** Secret name */
325
710
  name: string;
711
+ /** Secret type */
326
712
  type?: string;
713
+ /** String data (unencoded) */
327
714
  stringData?: Record<string, string>;
715
+ /** Base64-encoded data */
328
716
  data?: Record<string, string>;
717
+ /** Immutable Secret */
329
718
  immutable?: boolean;
719
+ /** Secret labels */
330
720
  labels?: Record<string, string>;
721
+ /** Secret annotations */
331
722
  annotations?: Record<string, string>;
332
723
  }
724
+ /**
725
+ * Kubernetes PersistentVolumeClaim specification
726
+ *
727
+ * @interface PersistentVolumeClaimSpec
728
+ * @since 1.0.0
729
+ */
333
730
  export interface PersistentVolumeClaimSpec {
731
+ /** PersistentVolumeClaim name */
334
732
  name: string;
733
+ /** Access modes */
335
734
  accessModes: AccessMode[];
735
+ /** Resource requirements */
336
736
  resources: {
337
737
  requests: {
338
738
  storage: string;
@@ -341,116 +741,126 @@ export interface PersistentVolumeClaimSpec {
341
741
  storage: string;
342
742
  };
343
743
  };
744
+ /** Storage class name */
344
745
  storageClassName?: string;
746
+ /** Volume mode */
345
747
  volumeMode?: VolumeMode;
748
+ /** Volume selector */
346
749
  selector?: {
347
750
  matchLabels?: Record<string, string>;
348
751
  matchExpressions?: unknown[];
349
752
  };
753
+ /** PersistentVolumeClaim labels */
350
754
  labels?: Record<string, string>;
755
+ /** PersistentVolumeClaim annotations */
351
756
  annotations?: Record<string, string>;
352
757
  /** Reference to specific PV for static binding */
353
758
  volumeName?: string;
354
759
  /** Cloud provider for optimized defaults */
355
760
  cloudProvider?: 'aws' | 'azure' | 'gcp';
356
761
  }
762
+ /**
763
+ * Kubernetes ServiceAccount specification with multi-cloud workload identity support
764
+ *
765
+ * @interface ServiceAccountSpec
766
+ * @since 1.0.0
767
+ */
357
768
  export interface ServiceAccountSpec {
769
+ /** ServiceAccount name */
358
770
  name: string;
771
+ /** ServiceAccount annotations */
359
772
  annotations?: Record<string, string>;
773
+ /** ServiceAccount labels */
360
774
  labels?: Record<string, string>;
775
+ /** Automount service account token */
361
776
  automountServiceAccountToken?: boolean;
777
+ /** Image pull secrets */
362
778
  imagePullSecrets?: string[];
779
+ /** Secrets to mount */
363
780
  secrets?: string[];
364
- /**
365
- * EKS IRSA support: IAM role ARN for service account to assume
366
- * Example: arn:aws:iam::<account-id>:role/<role-name>
367
- * Adds annotation eks.amazonaws.com/role-arn
368
- */
781
+ /** EKS IRSA: IAM role ARN */
369
782
  awsRoleArn?: string;
370
- /**
371
- * IRSA audience for token validation (default: sts.amazonaws.com)
372
- * Adds annotation eks.amazonaws.com/audience when provided
373
- */
783
+ /** IRSA audience for token validation */
374
784
  awsAudience?: string;
375
- /**
376
- * AWS STS endpoint type for IRSA (regional recommended for better performance)
377
- * Adds annotation eks.amazonaws.com/sts-regional-endpoints when provided
378
- * @default 'regional'
379
- */
785
+ /** AWS STS endpoint type */
380
786
  awsStsEndpointType?: 'regional' | 'legacy';
381
- /**
382
- * AWS region for regional STS endpoint (auto-detected if not provided)
383
- * Used with awsStsEndpointType: 'regional'
384
- */
787
+ /** AWS region for regional STS endpoint */
385
788
  awsRegion?: string;
386
- /**
387
- * Token expiration time in seconds for IRSA tokens (3600-43200)
388
- * Adds annotation eks.amazonaws.com/token-expiration when provided
389
- * @default 3600
390
- */
789
+ /** Token expiration time in seconds */
391
790
  awsTokenExpiration?: number;
392
- /**
393
- * AKS Workload Identity: Azure application client ID
394
- * Adds annotation azure.workload.identity/client-id when provided
395
- */
791
+ /** AKS Workload Identity: Azure client ID */
396
792
  azureClientId?: string;
397
- /**
398
- * AKS Workload Identity: Azure tenant ID
399
- * Adds annotation azure.workload.identity/tenant-id when provided
400
- */
793
+ /** AKS Workload Identity: Azure tenant ID */
401
794
  azureTenantId?: string;
402
- /**
403
- * AKS Workload Identity: projected SA token expiration (seconds)
404
- * Adds annotation azure.workload.identity/service-account-token-expiration
405
- */
795
+ /** AKS Workload Identity: token expiration */
406
796
  azureServiceAccountTokenExpiration?: number;
407
- /**
408
- * GKE Workload Identity: Google service account email
409
- * Adds annotation iam.gke.io/gcp-service-account when provided
410
- */
797
+ /** GKE Workload Identity: service account email */
411
798
  gcpServiceAccountEmail?: string;
412
799
  }
800
+ /**
801
+ * HorizontalPodAutoscaler metric specification
802
+ *
803
+ * @interface HorizontalPodAutoscalerMetric
804
+ * @since 1.0.0
805
+ */
413
806
  export interface HorizontalPodAutoscalerMetric {
807
+ /** Metric type */
414
808
  type: 'Resource' | 'Pods' | 'Object' | 'External';
809
+ /** Resource metric */
415
810
  resource?: {
811
+ /** Resource name */
416
812
  name: 'cpu' | 'memory';
813
+ /** Target specification */
417
814
  target: {
815
+ /** Target type */
418
816
  type: 'Utilization' | 'AverageValue';
817
+ /** Average utilization percentage */
419
818
  averageUtilization?: number;
819
+ /** Average value */
420
820
  averageValue?: string;
421
821
  };
422
822
  };
823
+ /** Pods metric */
423
824
  pods?: {
825
+ /** Metric specification */
424
826
  metric: {
425
827
  name: string;
426
828
  selector?: Record<string, unknown>;
427
829
  };
830
+ /** Target specification */
428
831
  target: {
429
832
  type: 'AverageValue';
430
833
  averageValue: string;
431
834
  };
432
835
  };
836
+ /** Object metric */
433
837
  object?: {
838
+ /** Metric specification */
434
839
  metric: {
435
840
  name: string;
436
841
  selector?: Record<string, unknown>;
437
842
  };
843
+ /** Described object */
438
844
  describedObject: {
439
845
  apiVersion: string;
440
846
  kind: string;
441
847
  name: string;
442
848
  };
849
+ /** Target specification */
443
850
  target: {
444
851
  type: 'Value' | 'AverageValue';
445
852
  value?: string;
446
853
  averageValue?: string;
447
854
  };
448
855
  };
856
+ /** External metric */
449
857
  external?: {
858
+ /** Metric specification */
450
859
  metric: {
451
860
  name: string;
452
861
  selector?: Record<string, unknown>;
453
862
  };
863
+ /** Target specification */
454
864
  target: {
455
865
  type: 'Value' | 'AverageValue';
456
866
  value?: string;
@@ -458,38 +868,75 @@ export interface HorizontalPodAutoscalerMetric {
458
868
  };
459
869
  };
460
870
  }
871
+ /**
872
+ * HorizontalPodAutoscaler behavior specification
873
+ *
874
+ * @interface HorizontalPodAutoscalerBehavior
875
+ * @since 1.0.0
876
+ */
461
877
  export interface HorizontalPodAutoscalerBehavior {
878
+ /** Scale up behavior */
462
879
  scaleUp?: {
880
+ /** Stabilization window in seconds */
463
881
  stabilizationWindowSeconds?: number;
882
+ /** Policy selection */
464
883
  selectPolicy?: 'Max' | 'Min' | 'Disabled';
884
+ /** Scaling policies */
465
885
  policies?: Array<{
886
+ /** Policy type */
466
887
  type: 'Pods' | 'Percent';
888
+ /** Policy value */
467
889
  value: number;
890
+ /** Period in seconds */
468
891
  periodSeconds: number;
469
892
  }>;
470
893
  };
894
+ /** Scale down behavior */
471
895
  scaleDown?: {
896
+ /** Stabilization window in seconds */
472
897
  stabilizationWindowSeconds?: number;
898
+ /** Policy selection */
473
899
  selectPolicy?: 'Max' | 'Min' | 'Disabled';
900
+ /** Scaling policies */
474
901
  policies?: Array<{
902
+ /** Policy type */
475
903
  type: 'Pods' | 'Percent';
904
+ /** Policy value */
476
905
  value: number;
906
+ /** Period in seconds */
477
907
  periodSeconds: number;
478
908
  }>;
479
909
  };
480
910
  }
911
+ /**
912
+ * Kubernetes HorizontalPodAutoscaler specification
913
+ *
914
+ * @interface HorizontalPodAutoscalerSpec
915
+ * @since 1.0.0
916
+ */
481
917
  export interface HorizontalPodAutoscalerSpec {
918
+ /** HPA name */
482
919
  name: string;
920
+ /** Scale target reference */
483
921
  scaleTargetRef: {
922
+ /** API version */
484
923
  apiVersion: string;
924
+ /** Resource kind */
485
925
  kind: 'Deployment' | 'StatefulSet' | 'ReplicaSet';
926
+ /** Resource name */
486
927
  name: string;
487
928
  };
929
+ /** Minimum replicas */
488
930
  minReplicas?: number;
931
+ /** Maximum replicas */
489
932
  maxReplicas: number;
933
+ /** Scaling metrics */
490
934
  metrics?: HorizontalPodAutoscalerMetric[];
935
+ /** Scaling behavior */
491
936
  behavior?: HorizontalPodAutoscalerBehavior;
937
+ /** HPA labels */
492
938
  labels?: Record<string, string>;
939
+ /** HPA annotations */
493
940
  annotations?: Record<string, string>;
494
941
  }
495
942
  export interface VerticalPodAutoscalerResourcePolicy {
@@ -525,18 +972,37 @@ export interface PodDisruptionBudgetSpec {
525
972
  labels?: Record<string, string>;
526
973
  annotations?: Record<string, string>;
527
974
  }
975
+ /**
976
+ * AWS EBS StorageClass specification
977
+ *
978
+ * @interface AWSEBSStorageClassSpec
979
+ * @extends CloudResourceTags
980
+ * @since 1.0.0
981
+ */
528
982
  export interface AWSEBSStorageClassSpec extends CloudResourceTags {
983
+ /** StorageClass name */
529
984
  name: string;
985
+ /** EBS volume type */
530
986
  volumeType?: 'gp2' | 'gp3' | 'io1' | 'io2' | 'sc1' | 'st1';
987
+ /** Filesystem type */
531
988
  fsType?: 'ext4' | 'xfs';
989
+ /** Enable encryption */
532
990
  encrypted?: boolean;
991
+ /** KMS key ID for encryption */
533
992
  kmsKeyId?: string;
993
+ /** IOPS for io1/io2 volumes */
534
994
  iops?: number;
995
+ /** Throughput for gp3 volumes */
535
996
  throughput?: number;
997
+ /** Volume reclaim policy */
536
998
  reclaimPolicy?: 'Delete' | 'Retain';
999
+ /** Allow volume expansion */
537
1000
  allowVolumeExpansion?: boolean;
1001
+ /** Volume binding mode */
538
1002
  volumeBindingMode?: 'Immediate' | 'WaitForFirstConsumer';
1003
+ /** StorageClass labels */
539
1004
  labels?: Record<string, string>;
1005
+ /** StorageClass annotations */
540
1006
  annotations?: Record<string, string>;
541
1007
  }
542
1008
  export interface AWSEBSPersistentVolumeClaimSpec {
@@ -609,19 +1075,209 @@ export interface AWSSecretProviderClassSpec {
609
1075
  annotations?: Record<string, string>;
610
1076
  }
611
1077
  /**
612
- * Configuration interface for Azure Disk StorageClass.
613
- * Defines the parameters for creating an Azure Disk StorageClass in AKS.
1078
+ * Configuration interface for Azure Workload Identity ServiceAccount.
1079
+ * Enables secure authentication to Azure services without storing credentials.
1080
+ *
1081
+ * @see https://learn.microsoft.com/en-us/azure/aks/workload-identity-overview
1082
+ */
1083
+ export interface AzureWorkloadIdentityServiceAccountSpec {
1084
+ /** Name of the ServiceAccount */
1085
+ name: string;
1086
+ /** Azure application client ID for workload identity */
1087
+ clientId: string;
1088
+ /** Azure tenant ID where the application is registered */
1089
+ tenantId: string;
1090
+ /** Service account token expiration in seconds (3600-86400) */
1091
+ tokenExpiration?: number;
1092
+ /** Labels to apply to the ServiceAccount */
1093
+ labels?: Record<string, string>;
1094
+ /** Additional annotations to apply to the ServiceAccount */
1095
+ annotations?: Record<string, string>;
1096
+ /** Whether to automount service account token */
1097
+ automountServiceAccountToken?: boolean;
1098
+ /** Names of image pull secrets */
1099
+ imagePullSecrets?: string[];
1100
+ /** Names of secrets to mount */
1101
+ secrets?: string[];
1102
+ }
1103
+ /**
1104
+ * Azure Key Vault object configuration for SecretProviderClass.
1105
+ */
1106
+ export interface AzureKeyVaultObject {
1107
+ /** Name of the object in Azure Key Vault */
1108
+ objectName: string;
1109
+ /** Type of object to retrieve */
1110
+ objectType: 'secret' | 'key' | 'cert';
1111
+ /** Optional alias for the object when mounted */
1112
+ objectAlias?: string;
1113
+ /** Optional version of the object */
1114
+ objectVersion?: string;
1115
+ }
1116
+ /**
1117
+ * Configuration interface for Azure Key Vault SecretProviderClass.
1118
+ * Enables mounting secrets from Azure Key Vault using CSI driver.
1119
+ *
1120
+ * @see https://learn.microsoft.com/en-us/azure/aks/csi-secrets-store-driver
1121
+ */
1122
+ export interface AzureKeyVaultSecretProviderClassSpec {
1123
+ /** Name of the SecretProviderClass */
1124
+ name: string;
1125
+ /** Name of the Azure Key Vault */
1126
+ keyVaultName: string;
1127
+ /** Azure tenant ID */
1128
+ tenantId: string;
1129
+ /** Objects to retrieve from Key Vault */
1130
+ objects: AzureKeyVaultObject[];
1131
+ /** User-assigned managed identity client ID for authentication */
1132
+ userAssignedIdentityID?: string;
1133
+ /** Azure cloud environment */
1134
+ cloudName?: 'AzurePublicCloud' | 'AzureUSGovernmentCloud' | 'AzureChinaCloud';
1135
+ /** Labels to apply to the SecretProviderClass */
1136
+ labels?: Record<string, string>;
1137
+ /** Additional annotations to apply to the SecretProviderClass */
1138
+ annotations?: Record<string, string>;
1139
+ }
1140
+ /**
1141
+ * Configuration interface for Azure Files StorageClass.
1142
+ * Defines parameters for creating Azure Files StorageClass in AKS.
614
1143
  *
615
- * @see https://learn.microsoft.com/en-us/azure/aks/azure-csi-disk-storage-provision
1144
+ * @see https://learn.microsoft.com/en-us/azure/aks/azure-csi-files-storage-provision
1145
+ */
1146
+ export interface AzureFilesStorageClassSpec {
1147
+ /** Name of the StorageClass */
1148
+ name: string;
1149
+ /** Azure Files SKU */
1150
+ skuName?: 'Standard_LRS' | 'Standard_GRS' | 'Standard_RAGRS' | 'Standard_ZRS' | 'Premium_LRS' | 'Premium_ZRS';
1151
+ /** File share protocol */
1152
+ protocol?: 'smb' | 'nfs';
1153
+ /** Allow shared access across multiple pods */
1154
+ allowSharedAccess?: boolean;
1155
+ /** Resource group for storage account */
1156
+ resourceGroup?: string;
1157
+ /** Storage account name */
1158
+ storageAccount?: string;
1159
+ /** Location for storage account */
1160
+ location?: string;
1161
+ /** Network endpoints for storage account */
1162
+ networkEndpointType?: 'publicEndpoint' | 'privateEndpoint';
1163
+ /** Mount permissions for NFS (e.g., '0777') */
1164
+ mountPermissions?: string;
1165
+ /** Root squash type for NFS */
1166
+ rootSquashType?: 'NoRootSquash' | 'RootSquash' | 'AllSquash';
1167
+ /** Volume reclaim policy */
1168
+ reclaimPolicy?: 'Delete' | 'Retain';
1169
+ /** Allow volume expansion */
1170
+ allowVolumeExpansion?: boolean;
1171
+ /** Volume binding mode */
1172
+ volumeBindingMode?: 'Immediate' | 'WaitForFirstConsumer';
1173
+ /** Mount options for the storage class */
1174
+ mountOptions?: string[];
1175
+ /** Labels to apply to the StorageClass */
1176
+ labels?: Record<string, string>;
1177
+ /** Annotations to apply to the StorageClass */
1178
+ annotations?: Record<string, string>;
1179
+ }
1180
+ /**
1181
+ * Configuration interface for Azure Files PersistentVolume.
1182
+ * Defines parameters for static Azure Files volume provisioning.
1183
+ */
1184
+ export interface AzureFilesPersistentVolumeSpec {
1185
+ /** Name of the PersistentVolume */
1186
+ name: string;
1187
+ /** Storage capacity */
1188
+ capacity: string;
1189
+ /** Access modes */
1190
+ accessModes?: AccessMode[];
1191
+ /** Storage account name */
1192
+ storageAccount: string;
1193
+ /** File share name */
1194
+ shareName: string;
1195
+ /** Resource group name */
1196
+ resourceGroup?: string;
1197
+ /** File share protocol */
1198
+ protocol?: 'smb' | 'nfs';
1199
+ /** Secret name containing storage account key (SMB only) */
1200
+ secretName?: string;
1201
+ /** Secret namespace (SMB only) */
1202
+ secretNamespace?: string;
1203
+ /** Server address override */
1204
+ server?: string;
1205
+ /** Folder name within share */
1206
+ folderName?: string;
1207
+ /** Mount permissions for NFS */
1208
+ mountPermissions?: string;
1209
+ /** Volume reclaim policy */
1210
+ reclaimPolicy?: ReclaimPolicy;
1211
+ /** Storage class name */
1212
+ storageClassName?: string;
1213
+ /** Mount options */
1214
+ mountOptions?: string[];
1215
+ /** Labels to apply to the PersistentVolume */
1216
+ labels?: Record<string, string>;
1217
+ /** Annotations to apply to the PersistentVolume */
1218
+ annotations?: Record<string, string>;
1219
+ }
1220
+ /**
1221
+ * Configuration interface for Azure Files PersistentVolumeClaim.
1222
+ * Simplifies creation of PVCs for Azure Files.
1223
+ */
1224
+ export interface AzureFilesPersistentVolumeClaimSpec {
1225
+ /** Name of the PersistentVolumeClaim */
1226
+ name: string;
1227
+ /** Storage class name */
1228
+ storageClassName: string;
1229
+ /** Storage size request */
1230
+ size: string;
1231
+ /** Access modes */
1232
+ accessModes?: AccessMode[];
1233
+ /** Labels to apply to the PersistentVolumeClaim */
1234
+ labels?: Record<string, string>;
1235
+ /** Annotations to apply to the PersistentVolumeClaim */
1236
+ annotations?: Record<string, string>;
1237
+ }
1238
+ /**
1239
+ * Configuration interface for Azure Container Registry ServiceAccount.
1240
+ * Simplifies ACR integration with AKS using managed identity.
616
1241
  */
1242
+ export interface AzureACRServiceAccountSpec {
1243
+ /** Name of the ServiceAccount */
1244
+ name: string;
1245
+ /** Azure Container Registry name */
1246
+ acrName: string;
1247
+ /** Resource group containing the ACR */
1248
+ resourceGroup: string;
1249
+ /** Client ID for Workload Identity (optional) */
1250
+ clientId?: string;
1251
+ /** Tenant ID for Workload Identity (optional) */
1252
+ tenantId?: string;
1253
+ /** Labels to apply to the ServiceAccount */
1254
+ labels?: Record<string, string>;
1255
+ /** Additional annotations to apply to the ServiceAccount */
1256
+ annotations?: Record<string, string>;
1257
+ /** Whether to automount service account token */
1258
+ automountServiceAccountToken?: boolean;
1259
+ /** Names of additional image pull secrets */
1260
+ imagePullSecrets?: string[];
1261
+ /** Names of secrets to mount */
1262
+ secrets?: string[];
1263
+ }
617
1264
  /**
618
- * Cloud resource tags with basic validation.
619
- * Provides a consistent interface for tagging resources across cloud providers.
1265
+ * Cloud resource tags with basic validation
1266
+ *
1267
+ * @interface CloudResourceTags
1268
+ * @since 1.0.0
620
1269
  */
621
1270
  export interface CloudResourceTags {
622
1271
  /** Resource tags as key-value pairs */
623
1272
  tags?: Record<string, string>;
624
1273
  }
1274
+ /**
1275
+ * Azure Disk StorageClass specification
1276
+ *
1277
+ * @interface AzureDiskStorageClassSpec
1278
+ * @extends CloudResourceTags
1279
+ * @since 1.0.0
1280
+ */
625
1281
  export interface AzureDiskStorageClassSpec extends CloudResourceTags {
626
1282
  /** Name of the StorageClass */
627
1283
  name: string;
@@ -664,32 +1320,58 @@ export interface AzureDiskStorageClassSpec extends CloudResourceTags {
664
1320
  /** Annotations to apply to the StorageClass */
665
1321
  annotations?: Record<string, string>;
666
1322
  }
1323
+ /**
1324
+ * AWS Application Load Balancer Ingress specification
1325
+ *
1326
+ * @interface AWSALBIngressSpec
1327
+ * @extends CloudResourceTags
1328
+ * @since 1.0.0
1329
+ */
667
1330
  export interface AWSALBIngressSpec extends CloudResourceTags {
1331
+ /** Ingress name */
668
1332
  name: string;
1333
+ /** Ingress rules */
669
1334
  rules: IngressRule[];
1335
+ /** TLS configuration */
670
1336
  tls?: IngressTLS[];
1337
+ /** Load balancer scheme */
671
1338
  scheme?: 'internet-facing' | 'internal';
1339
+ /** Target type */
672
1340
  targetType?: 'instance' | 'ip';
1341
+ /** IP address type */
673
1342
  ipAddressType?: 'ipv4' | 'dualstack';
1343
+ /** ALB group name */
674
1344
  groupName?: string;
1345
+ /** ALB group order */
675
1346
  groupOrder?: number;
1347
+ /** Subnet IDs */
676
1348
  subnets?: string[];
1349
+ /** Security group IDs */
677
1350
  securityGroups?: string[];
1351
+ /** SSL certificate ARN */
678
1352
  certificateArn?: string;
1353
+ /** Enable SSL redirect */
679
1354
  sslRedirect?: boolean;
1355
+ /** Health check path */
680
1356
  healthCheckPath?: string;
1357
+ /** Health check interval */
681
1358
  healthCheckIntervalSeconds?: number;
1359
+ /** Health check timeout */
682
1360
  healthCheckTimeoutSeconds?: number;
1361
+ /** Healthy threshold count */
683
1362
  healthyThresholdCount?: number;
1363
+ /** Unhealthy threshold count */
684
1364
  unhealthyThresholdCount?: number;
1365
+ /** Ingress labels */
685
1366
  labels?: Record<string, string>;
1367
+ /** Ingress annotations */
686
1368
  annotations?: Record<string, string>;
687
1369
  }
688
1370
  /**
689
- * Configuration interface for Azure Application Gateway Ingress Controller (AGIC).
690
- * Provides comprehensive support for AGIC annotations and features for AKS deployments.
1371
+ * Azure Application Gateway Ingress Controller specification
691
1372
  *
692
- * @see https://learn.microsoft.com/en-us/azure/application-gateway/ingress-controller-annotations
1373
+ * @interface AzureAGICIngressSpec
1374
+ * @since 1.0.0
693
1375
  */
694
1376
  export interface AzureAGICIngressSpec {
695
1377
  /** Name of the Ingress resource */
@@ -777,6 +1459,12 @@ export interface VerticalPodAutoscalerSpec {
777
1459
  labels?: Record<string, string>;
778
1460
  annotations?: Record<string, string>;
779
1461
  }
1462
+ /**
1463
+ * NetworkPolicy peer specification
1464
+ *
1465
+ * @interface NetworkPolicyPeer
1466
+ * @since 1.0.0
1467
+ */
780
1468
  export interface NetworkPolicyPeer {
781
1469
  podSelector?: {
782
1470
  matchLabels?: Record<string, string>;
@@ -799,19 +1487,43 @@ export interface NetworkPolicyPeer {
799
1487
  except?: string[];
800
1488
  };
801
1489
  }
1490
+ /**
1491
+ * NetworkPolicy port specification
1492
+ *
1493
+ * @interface NetworkPolicyPort
1494
+ * @since 1.0.0
1495
+ */
802
1496
  export interface NetworkPolicyPort {
803
1497
  protocol?: 'TCP' | 'UDP' | 'SCTP';
804
1498
  port?: number | string;
805
1499
  endPort?: number;
806
1500
  }
1501
+ /**
1502
+ * NetworkPolicy ingress rule specification
1503
+ *
1504
+ * @interface NetworkPolicyIngressRule
1505
+ * @since 1.0.0
1506
+ */
807
1507
  export interface NetworkPolicyIngressRule {
808
1508
  from?: NetworkPolicyPeer[];
809
1509
  ports?: NetworkPolicyPort[];
810
1510
  }
1511
+ /**
1512
+ * NetworkPolicy egress rule specification
1513
+ *
1514
+ * @interface NetworkPolicyEgressRule
1515
+ * @since 1.0.0
1516
+ */
811
1517
  export interface NetworkPolicyEgressRule {
812
1518
  to?: NetworkPolicyPeer[];
813
1519
  ports?: NetworkPolicyPort[];
814
1520
  }
1521
+ /**
1522
+ * NetworkPolicy specification
1523
+ *
1524
+ * @interface NetworkPolicySpec
1525
+ * @since 1.0.0
1526
+ */
815
1527
  export interface NetworkPolicySpec {
816
1528
  name: string;
817
1529
  podSelector?: {
@@ -828,69 +1540,680 @@ export interface NetworkPolicySpec {
828
1540
  labels?: Record<string, string>;
829
1541
  annotations?: Record<string, string>;
830
1542
  }
831
- export interface RutterProps {
832
- meta: HelmChartMeta;
833
- defaultValues?: Record<string, unknown>;
834
- envValues?: Record<string, Record<string, unknown>>;
835
- /** Optional Helm helpers content for templates/_helpers.tpl */
836
- helpersTpl?: string | HelperDefinition[];
837
- /** Optional NOTES.txt content */
838
- notesTpl?: string;
839
- /** Optional values.schema.json object */
840
- valuesSchema?: Record<string, unknown>;
841
- /** Optional custom name for the generated manifest file (without extension) */
842
- manifestName?: string;
843
- /**
844
- * If true, all Kubernetes resources will be combined into a single manifest file.
845
- * If false (default), each resource will be in its own numbered file.
846
- * @default false
847
- */
848
- singleManifestFile?: boolean;
1543
+ /**
1544
+ * Karpenter NodePool requirement for node selection
1545
+ *
1546
+ * @interface KarpenterNodeRequirement
1547
+ * @since 1.0.0
1548
+ */
1549
+ /**
1550
+ * Karpenter node requirement specification
1551
+ *
1552
+ * @interface KarpenterNodeRequirement
1553
+ * @since 2.3.0
1554
+ */
1555
+ export interface KarpenterNodeRequirement {
1556
+ /** Label key to match against */
1557
+ key: string;
1558
+ /** Operator for matching */
1559
+ operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
1560
+ /** Values to match */
1561
+ values?: string[];
849
1562
  }
850
1563
  /**
851
- * Rutter builds Kubernetes manifests using cdk8s and writes a Helm chart.
1564
+ * Karpenter NodePool disruption configuration
1565
+ *
1566
+ * @interface KarpenterNodeDisruption
1567
+ * @since 1.0.0
852
1568
  */
853
- export declare class Rutter {
854
- private readonly props;
855
- private readonly app;
856
- private readonly chart;
857
- private readonly assets;
858
- private valueOverrides;
859
- constructor(props: RutterProps);
860
- /**
861
- * Set dynamic value overrides (from --set flags)
862
- */
863
- setValues(overrides: Record<string, string>): void;
864
- /**
865
- * Apply value overrides to nested object using dot notation
866
- */
867
- private applyOverrides;
868
- private setNestedValue;
869
- private parseValue;
870
- private static readonly LABEL_NAME;
871
- private static readonly LABEL_INSTANCE;
872
- private static readonly HELPER_NAME;
1569
+ /**
1570
+ * Karpenter node disruption configuration
1571
+ *
1572
+ * @interface KarpenterNodeDisruption
1573
+ * @since 2.3.0
1574
+ */
1575
+ export interface KarpenterNodeDisruption {
1576
+ /** Policy for node consolidation */
1577
+ consolidationPolicy?: 'WhenEmpty' | 'WhenUnderutilized';
1578
+ /** Time to wait before consolidating empty nodes */
1579
+ consolidateAfter?: string;
1580
+ /** Maximum node lifetime before replacement */
1581
+ expireAfter?: string;
1582
+ }
1583
+ /**
1584
+ * Karpenter NodePool specification
1585
+ *
1586
+ * @interface KarpenterNodePoolSpec
1587
+ * @since 1.0.0
1588
+ */
1589
+ /**
1590
+ * Karpenter NodePool specification
1591
+ *
1592
+ * @interface KarpenterNodePoolSpec
1593
+ * @since 2.3.0
1594
+ */
1595
+ export interface KarpenterNodePoolSpec {
1596
+ /** Name of the NodePool */
1597
+ name: string;
1598
+ /** Node requirements for instance selection */
1599
+ requirements?: KarpenterNodeRequirement[];
1600
+ /** Resource limits for the NodePool */
1601
+ limits?: {
1602
+ cpu?: string;
1603
+ memory?: string;
1604
+ };
1605
+ /** Node disruption configuration */
1606
+ disruption?: KarpenterNodeDisruption;
1607
+ /** Reference to NodeClass for AWS-specific configuration */
1608
+ nodeClassRef: {
1609
+ /** API group (default: eks.amazonaws.com) */
1610
+ group?: string;
1611
+ /** Resource kind (default: NodeClass) */
1612
+ kind?: string;
1613
+ /** NodeClass name */
1614
+ name: string;
1615
+ };
1616
+ /** Taints to apply to provisioned nodes */
1617
+ taints?: Array<{
1618
+ key: string;
1619
+ value?: string;
1620
+ effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
1621
+ }>;
1622
+ /** Labels to apply to the NodePool */
1623
+ labels?: Record<string, string>;
1624
+ /** Annotations to apply to the NodePool */
1625
+ annotations?: Record<string, string>;
1626
+ }
1627
+ /**
1628
+ * Karpenter block device mapping for EC2 instances
1629
+ *
1630
+ * @interface KarpenterBlockDeviceMapping
1631
+ * @since 1.0.0
1632
+ */
1633
+ /**
1634
+ * Karpenter block device mapping specification
1635
+ *
1636
+ * @interface KarpenterBlockDeviceMapping
1637
+ * @since 2.3.0
1638
+ */
1639
+ export interface KarpenterBlockDeviceMapping {
1640
+ /** Device name (e.g., /dev/xvda) */
1641
+ deviceName: string;
1642
+ /** EBS configuration */
1643
+ ebs?: {
1644
+ /** Volume size in GB */
1645
+ volumeSize?: string;
1646
+ /** Volume type */
1647
+ volumeType?: 'gp2' | 'gp3' | 'io1' | 'io2' | 'sc1' | 'st1';
1648
+ /** Enable encryption */
1649
+ encrypted?: boolean;
1650
+ /** Delete on termination */
1651
+ deleteOnTermination?: boolean;
1652
+ /** IOPS for io1/io2 volumes */
1653
+ iops?: number;
1654
+ /** Throughput for gp3 volumes */
1655
+ throughput?: number;
1656
+ };
1657
+ }
1658
+ /**
1659
+ * Karpenter subnet selector term
1660
+ *
1661
+ * @interface KarpenterSubnetSelectorTerm
1662
+ * @since 1.0.0
1663
+ */
1664
+ /**
1665
+ * Karpenter subnet selector term specification
1666
+ *
1667
+ * @interface KarpenterSubnetSelectorTerm
1668
+ * @since 2.3.0
1669
+ */
1670
+ export interface KarpenterSubnetSelectorTerm {
1671
+ /** Subnet tags for selection */
1672
+ tags?: Record<string, string>;
1673
+ /** Specific subnet ID */
1674
+ id?: string;
1675
+ }
1676
+ /**
1677
+ * Karpenter security group selector term
1678
+ *
1679
+ * @interface KarpenterSecurityGroupSelectorTerm
1680
+ * @since 1.0.0
1681
+ */
1682
+ /**
1683
+ * Karpenter security group selector term specification
1684
+ *
1685
+ * @interface KarpenterSecurityGroupSelectorTerm
1686
+ * @since 2.3.0
1687
+ */
1688
+ export interface KarpenterSecurityGroupSelectorTerm {
1689
+ /** Security group tags for selection */
1690
+ tags?: Record<string, string>;
1691
+ /** Specific security group ID */
1692
+ id?: string;
1693
+ }
1694
+ /**
1695
+ * Karpenter EC2 NodeClass specification
1696
+ *
1697
+ * @interface KarpenterEC2NodeClassSpec
1698
+ * @since 1.0.0
1699
+ */
1700
+ /**
1701
+ * Karpenter EC2 NodeClass specification
1702
+ *
1703
+ * @interface KarpenterEC2NodeClassSpec
1704
+ * @since 2.3.0
1705
+ */
1706
+ export interface KarpenterEC2NodeClassSpec {
1707
+ /** Name of the EC2 NodeClass */
1708
+ name: string;
1709
+ /** AMI family for node instances */
1710
+ amiFamily?: 'AL2' | 'AL2023' | 'Bottlerocket' | 'Ubuntu' | 'Windows2019' | 'Windows2022' | 'Custom';
1711
+ /** Instance store policy */
1712
+ instanceStorePolicy?: 'NVME' | 'RAID0';
1713
+ /** User data script for instance initialization */
1714
+ userData?: string;
1715
+ /** Subnet selection terms */
1716
+ subnetSelectorTerms?: KarpenterSubnetSelectorTerm[];
1717
+ /** Security group selection terms */
1718
+ securityGroupSelectorTerms?: KarpenterSecurityGroupSelectorTerm[];
1719
+ /** IAM role for instances */
1720
+ role?: string;
1721
+ /** Instance profile name */
1722
+ instanceProfile?: string;
1723
+ /** EC2 metadata options */
1724
+ metadataOptions?: {
1725
+ /** HTTP endpoint state */
1726
+ httpEndpoint?: 'enabled' | 'disabled';
1727
+ /** IPv6 endpoint state */
1728
+ httpProtocolIPv6?: 'enabled' | 'disabled';
1729
+ /** Hop limit for metadata requests */
1730
+ httpPutResponseHopLimit?: number;
1731
+ /** Token requirement */
1732
+ httpTokens?: 'required' | 'optional';
1733
+ };
1734
+ /** Block device mappings */
1735
+ blockDeviceMappings?: KarpenterBlockDeviceMapping[];
1736
+ /** Resource tags */
1737
+ tags?: Record<string, string>;
1738
+ /** Labels to apply to the NodeClass */
1739
+ labels?: Record<string, string>;
1740
+ /** Annotations to apply to the NodeClass */
1741
+ annotations?: Record<string, string>;
1742
+ }
1743
+ /**
1744
+ * Karpenter disruption budget for controlling disruption rate.
1745
+ */
1746
+ /**
1747
+ * Karpenter disruption budget specification
1748
+ *
1749
+ * @interface KarpenterDisruptionBudget
1750
+ * @since 2.3.0
1751
+ */
1752
+ export interface KarpenterDisruptionBudget {
1753
+ /** Schedule in cron format for when budget applies */
1754
+ schedule?: string;
1755
+ /** Duration the budget is active */
1756
+ duration?: string;
1757
+ /** Number or percentage of nodes that can be disrupted */
1758
+ nodes?: string | number;
1759
+ /** Reasons this budget applies to */
1760
+ reasons?: Array<'Underutilized' | 'Empty' | 'Drifted' | 'Expired'>;
1761
+ }
1762
+ /**
1763
+ * Advanced disruption configuration for Karpenter NodePools.
1764
+ */
1765
+ /**
1766
+ * Karpenter advanced disruption configuration
1767
+ *
1768
+ * @interface KarpenterAdvancedDisruption
1769
+ * @since 2.3.0
1770
+ */
1771
+ export interface KarpenterAdvancedDisruption {
1772
+ /** Consolidation policy */
1773
+ consolidationPolicy?: 'WhenEmpty' | 'WhenEmptyOrUnderutilized';
1774
+ /** Time to wait before consolidating */
1775
+ consolidateAfter?: string;
1776
+ /** Node expiration time */
1777
+ expireAfter?: string;
1778
+ /** Disruption budgets for rate limiting */
1779
+ budgets?: KarpenterDisruptionBudget[];
1780
+ }
1781
+ /**
1782
+ * Configuration interface for Karpenter NodeClaim.
1783
+ * Represents an individual node request that Karpenter will fulfill.
1784
+ *
1785
+ * @see https://karpenter.sh/docs/concepts/nodeclaims/
1786
+ */
1787
+ /**
1788
+ * Karpenter NodeClaim specification
1789
+ *
1790
+ * @interface KarpenterNodeClaimSpec
1791
+ * @since 2.3.0
1792
+ */
1793
+ export interface KarpenterNodeClaimSpec {
1794
+ /** Name of the NodeClaim */
1795
+ name: string;
1796
+ /** Node requirements for instance selection */
1797
+ requirements?: KarpenterNodeRequirement[];
1798
+ /** Reference to NodeClass for AWS-specific configuration */
1799
+ nodeClassRef: {
1800
+ /** API group (default: eks.amazonaws.com) */
1801
+ group?: string;
1802
+ /** Resource kind (default: NodeClass) */
1803
+ kind?: string;
1804
+ /** NodeClass name */
1805
+ name: string;
1806
+ };
1807
+ /** Taints to apply to the node */
1808
+ taints?: Array<{
1809
+ key: string;
1810
+ value?: string;
1811
+ effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
1812
+ }>;
1813
+ /** Startup taints that will be removed after node initialization */
1814
+ startupTaints?: Array<{
1815
+ key: string;
1816
+ value?: string;
1817
+ effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
1818
+ }>;
1819
+ /** Node expiration time */
1820
+ expireAfter?: string;
1821
+ /** Termination grace period */
1822
+ terminationGracePeriod?: string;
1823
+ /** Labels to apply to the NodeClaim */
1824
+ labels?: Record<string, string>;
1825
+ /** Annotations to apply to the NodeClaim */
1826
+ annotations?: Record<string, string>;
1827
+ }
1828
+ /**
1829
+ * Topology spread constraint for advanced scheduling.
1830
+ */
1831
+ /**
1832
+ * Karpenter topology spread constraint specification
1833
+ *
1834
+ * @interface KarpenterTopologySpreadConstraint
1835
+ * @since 2.3.0
1836
+ */
1837
+ export interface KarpenterTopologySpreadConstraint {
1838
+ /** Maximum skew between zones/domains */
1839
+ maxSkew: number;
1840
+ /** Topology key (e.g., topology.kubernetes.io/zone) */
1841
+ topologyKey: string;
1842
+ /** What to do when constraint cannot be satisfied */
1843
+ whenUnsatisfiable: 'DoNotSchedule' | 'ScheduleAnyway';
1844
+ /** Label selector for pods to consider */
1845
+ labelSelector?: {
1846
+ matchLabels?: Record<string, string>;
1847
+ matchExpressions?: Array<{
1848
+ key: string;
1849
+ operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist';
1850
+ values?: string[];
1851
+ }>;
1852
+ };
1853
+ /** Minimum domains required */
1854
+ minDomains?: number;
1855
+ }
1856
+ /**
1857
+ * Node affinity for advanced scheduling constraints.
1858
+ */
1859
+ /**
1860
+ * Karpenter node affinity specification
1861
+ *
1862
+ * @interface KarpenterNodeAffinity
1863
+ * @since 2.3.0
1864
+ */
1865
+ export interface KarpenterNodeAffinity {
1866
+ /** Required node affinity */
1867
+ requiredDuringSchedulingIgnoredDuringExecution?: {
1868
+ nodeSelectorTerms: Array<{
1869
+ matchExpressions?: Array<{
1870
+ key: string;
1871
+ operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
1872
+ values?: string[];
1873
+ }>;
1874
+ matchFields?: Array<{
1875
+ key: string;
1876
+ operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
1877
+ values?: string[];
1878
+ }>;
1879
+ }>;
1880
+ };
1881
+ /** Preferred node affinity */
1882
+ preferredDuringSchedulingIgnoredDuringExecution?: Array<{
1883
+ weight: number;
1884
+ preference: {
1885
+ matchExpressions?: Array<{
1886
+ key: string;
1887
+ operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
1888
+ values?: string[];
1889
+ }>;
1890
+ matchFields?: Array<{
1891
+ key: string;
1892
+ operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
1893
+ values?: string[];
1894
+ }>;
1895
+ };
1896
+ }>;
1897
+ }
1898
+ /**
1899
+ * Configuration interface for advanced Karpenter scheduling.
1900
+ * Provides fine-grained control over pod placement and node selection.
1901
+ */
1902
+ /**
1903
+ * Karpenter scheduling specification
1904
+ *
1905
+ * @interface KarpenterSchedulingSpec
1906
+ * @since 2.3.0
1907
+ */
1908
+ export interface KarpenterSchedulingSpec {
1909
+ /** Name of the scheduling configuration */
1910
+ name: string;
1911
+ /** Node selector for basic node selection */
1912
+ nodeSelector?: Record<string, string>;
1913
+ /** Node affinity for advanced node selection */
1914
+ nodeAffinity?: KarpenterNodeAffinity;
1915
+ /** Topology spread constraints */
1916
+ topologySpreadConstraints?: KarpenterTopologySpreadConstraint[];
1917
+ /** Tolerations for taints */
1918
+ tolerations?: Array<{
1919
+ key?: string;
1920
+ operator?: 'Exists' | 'Equal';
1921
+ value?: string;
1922
+ effect?: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
1923
+ tolerationSeconds?: number;
1924
+ }>;
1925
+ /** Priority class for pod scheduling */
1926
+ priorityClassName?: string;
1927
+ /** Scheduler name */
1928
+ schedulerName?: string;
1929
+ /** Labels to apply to the scheduling configuration */
1930
+ labels?: Record<string, string>;
1931
+ /** Annotations to apply to the scheduling configuration */
1932
+ annotations?: Record<string, string>;
1933
+ }
1934
+ /**
1935
+ * Configuration properties for Rutter
1936
+ *
1937
+ * @interface RutterProps
1938
+ * @since 1.0.0
1939
+ */
1940
+ export interface RutterProps {
1941
+ /** Helm chart metadata */
1942
+ meta: HelmChartMeta;
1943
+ /** Default values for values.yaml */
1944
+ defaultValues?: Record<string, unknown>;
1945
+ /** Environment-specific values */
1946
+ envValues?: Record<string, Record<string, unknown>>;
1947
+ /** Helm helpers content for templates/_helpers.tpl */
1948
+ helpersTpl?: string | HelperDefinition[];
1949
+ /** NOTES.txt content */
1950
+ notesTpl?: string;
1951
+ /** JSON schema for values validation */
1952
+ valuesSchema?: Record<string, unknown>;
1953
+ /** Custom name for generated manifest file */
1954
+ manifestName?: string;
1955
+ /** Combine all resources into single manifest file */
1956
+ singleManifestFile?: boolean;
1957
+ }
1958
+ /**
1959
+ * Rutter - Main class for building Kubernetes manifests and Helm charts
1960
+ *
1961
+ * Rutter (maritime pilot) guides the generation of Kubernetes resources
1962
+ * using cdk8s and outputs complete Helm charts with proper templating.
1963
+ *
1964
+ * @class Rutter
1965
+ * @since 1.0.0
1966
+ *
1967
+ * @example
1968
+ * ```typescript
1969
+ * const rutter = new Rutter({
1970
+ * meta: { name: 'my-app', version: '1.0.0' },
1971
+ * defaultValues: { replicas: 3 }
1972
+ * });
1973
+ *
1974
+ * rutter.addDeployment({
1975
+ * name: 'web',
1976
+ * image: 'nginx:1.21',
1977
+ * replicas: 3
1978
+ * });
1979
+ *
1980
+ * rutter.write('./charts/my-app');
1981
+ * ```
1982
+ */
1983
+ export declare class Rutter {
1984
+ private readonly props;
1985
+ private readonly app;
1986
+ private readonly chart;
1987
+ private readonly assets;
1988
+ private valueOverrides;
1989
+ /**
1990
+ * Creates a new Rutter instance
1991
+ *
1992
+ * @param {RutterProps} props - Configuration properties
1993
+ * @since 1.0.0
1994
+ */
1995
+ constructor(props: RutterProps);
1996
+ /**
1997
+ * Sets dynamic value overrides for Helm values
1998
+ *
1999
+ * Used by CLI --set flags to override default values at runtime.
2000
+ *
2001
+ * @param {Record<string, string>} overrides - Key-value pairs to override
2002
+ *
2003
+ * @example
2004
+ * ```typescript
2005
+ * rutter.setValues({
2006
+ * 'image.tag': 'v2.0.0',
2007
+ * 'replicas': '5'
2008
+ * });
2009
+ * ```
2010
+ *
2011
+ * @since 1.0.0
2012
+ */
2013
+ setValues(overrides: Record<string, string>): void;
2014
+ /**
2015
+ * Apply value overrides to nested object using dot notation
2016
+ */
2017
+ private applyOverrides;
2018
+ private setNestedValue;
2019
+ private parseValue;
2020
+ private static readonly LABEL_NAME;
2021
+ private static readonly LABEL_INSTANCE;
2022
+ private static readonly HELPER_NAME;
873
2023
  private static readonly NETWORKING_API_VERSION;
874
2024
  private static readonly STORAGE_API_VERSION;
875
2025
  private static readonly AZURE_DISK_CSI_DRIVER;
876
2026
  private static readonly AZURE_DISK_PROVISIONER_ANNOTATION;
2027
+ private static readonly AZURE_FILES_CSI_DRIVER;
2028
+ /**
2029
+ * Adds a Kubernetes Deployment to the chart
2030
+ *
2031
+ * @param {DeploymentSpec} spec - Deployment specification
2032
+ * @returns {ApiObject} The created Deployment object
2033
+ *
2034
+ * @example
2035
+ * ```typescript
2036
+ * rutter.addDeployment({
2037
+ * name: 'web-app',
2038
+ * image: 'nginx:1.21',
2039
+ * replicas: 3,
2040
+ * containerPort: 80,
2041
+ * env: { NODE_ENV: 'production' }
2042
+ * });
2043
+ * ```
2044
+ *
2045
+ * @since 1.0.0
2046
+ */
877
2047
  addDeployment(spec: DeploymentSpec): ApiObject;
2048
+ /**
2049
+ * Adds a Kubernetes Service to the chart
2050
+ *
2051
+ * @param {ServiceSpec} spec - Service specification
2052
+ * @returns {ApiObject} The created Service object
2053
+ *
2054
+ * @example
2055
+ * ```typescript
2056
+ * rutter.addService({
2057
+ * name: 'web-service',
2058
+ * ports: [{ port: 80, targetPort: 8080 }],
2059
+ * type: 'LoadBalancer'
2060
+ * });
2061
+ * ```
2062
+ *
2063
+ * @since 1.0.0
2064
+ */
878
2065
  addService(spec: ServiceSpec): ApiObject;
879
2066
  addReplicaSet(spec: ReplicaSetSpec): ApiObject;
2067
+ /**
2068
+ * Adds a Kubernetes Job to the chart
2069
+ *
2070
+ * @param {JobSpec} spec - Job specification
2071
+ * @returns {ApiObject} The created Job object
2072
+ *
2073
+ * @example
2074
+ * ```typescript
2075
+ * rutter.addJob({
2076
+ * name: 'data-migration',
2077
+ * image: 'migrate:latest',
2078
+ * command: ['./migrate.sh'],
2079
+ * backoffLimit: 3
2080
+ * });
2081
+ * ```
2082
+ *
2083
+ * @since 2.1.0
2084
+ */
880
2085
  addJob(spec: JobSpec): ApiObject;
2086
+ /**
2087
+ * Adds a Kubernetes CronJob to the chart
2088
+ *
2089
+ * @param {CronJobSpec} spec - CronJob specification
2090
+ * @returns {ApiObject} The created CronJob object
2091
+ *
2092
+ * @example
2093
+ * ```typescript
2094
+ * rutter.addCronJob({
2095
+ * name: 'backup-job',
2096
+ * schedule: '0 2 * * *',
2097
+ * image: 'backup:latest',
2098
+ * command: ['./backup.sh']
2099
+ * });
2100
+ * ```
2101
+ *
2102
+ * @since 2.1.0
2103
+ */
881
2104
  addCronJob(spec: CronJobSpec): ApiObject;
2105
+ /**
2106
+ * Adds a Kubernetes Ingress to the chart
2107
+ *
2108
+ * @param {IngressSpec} spec - Ingress specification
2109
+ * @returns {ApiObject} The created Ingress object
2110
+ *
2111
+ * @example
2112
+ * ```typescript
2113
+ * rutter.addIngress({
2114
+ * name: 'web-ingress',
2115
+ * rules: [{
2116
+ * host: 'example.com',
2117
+ * paths: [{
2118
+ * path: '/',
2119
+ * pathType: 'Prefix',
2120
+ * backend: { service: { name: 'web-service', port: { number: 80 } } }
2121
+ * }]
2122
+ * }]
2123
+ * });
2124
+ * ```
2125
+ *
2126
+ * @since 1.0.0
2127
+ */
882
2128
  addIngress(spec: IngressSpec): ApiObject;
883
2129
  addPersistentVolume(spec: PersistentVolumeSpec): ApiObject;
884
2130
  private optimizePVForCloud;
885
2131
  addPersistentVolumeClaim(spec: PersistentVolumeClaimSpec): ApiObject;
886
2132
  private validatePVCAccessModes;
2133
+ /**
2134
+ * Adds a Kubernetes ConfigMap to the chart
2135
+ *
2136
+ * @param {ConfigMapSpec} spec - ConfigMap specification
2137
+ * @returns {ApiObject} The created ConfigMap object
2138
+ *
2139
+ * @example
2140
+ * ```typescript
2141
+ * rutter.addConfigMap({
2142
+ * name: 'app-config',
2143
+ * data: {
2144
+ * 'config.yaml': 'key: value',
2145
+ * 'app.properties': 'debug=true'
2146
+ * }
2147
+ * });
2148
+ * ```
2149
+ *
2150
+ * @since 1.0.0
2151
+ */
887
2152
  addConfigMap(spec: ConfigMapSpec): ApiObject;
2153
+ /**
2154
+ * Adds a Kubernetes Secret to the chart
2155
+ *
2156
+ * @param {SecretSpec} spec - Secret specification
2157
+ * @returns {ApiObject} The created Secret object
2158
+ *
2159
+ * @example
2160
+ * ```typescript
2161
+ * rutter.addSecret({
2162
+ * name: 'app-secrets',
2163
+ * stringData: {
2164
+ * 'username': 'admin',
2165
+ * 'password': 'secret123'
2166
+ * }
2167
+ * });
2168
+ * ```
2169
+ *
2170
+ * @since 1.0.0
2171
+ */
888
2172
  addSecret(spec: SecretSpec): ApiObject;
2173
+ /**
2174
+ * Adds a Kubernetes ServiceAccount to the chart
2175
+ *
2176
+ * @param {ServiceAccountSpec} spec - ServiceAccount specification
2177
+ * @returns {ApiObject} The created ServiceAccount object
2178
+ *
2179
+ * @example
2180
+ * ```typescript
2181
+ * rutter.addServiceAccount({
2182
+ * name: 'app-sa',
2183
+ * awsRoleArn: 'arn:aws:iam::123456789012:role/MyRole',
2184
+ * automountServiceAccountToken: true
2185
+ * });
2186
+ * ```
2187
+ *
2188
+ * @since 1.0.0
2189
+ */
889
2190
  addServiceAccount(spec: ServiceAccountSpec): ApiObject;
890
2191
  private buildServiceAccountAnnotations;
891
2192
  private addAWSIRSAAnnotations;
892
2193
  private addAzureWorkloadIdentityAnnotations;
893
2194
  private addGCPWorkloadIdentityAnnotations;
2195
+ /**
2196
+ * Adds a Kubernetes HorizontalPodAutoscaler to the chart
2197
+ *
2198
+ * @param {HorizontalPodAutoscalerSpec} spec - HPA specification
2199
+ * @returns {ApiObject} The created HPA object
2200
+ *
2201
+ * @example
2202
+ * ```typescript
2203
+ * rutter.addHorizontalPodAutoscaler({
2204
+ * name: 'web-hpa',
2205
+ * scaleTargetRef: {
2206
+ * apiVersion: 'apps/v1',
2207
+ * kind: 'Deployment',
2208
+ * name: 'web-app'
2209
+ * },
2210
+ * minReplicas: 2,
2211
+ * maxReplicas: 10
2212
+ * });
2213
+ * ```
2214
+ *
2215
+ * @since 1.0.0
2216
+ */
894
2217
  addHorizontalPodAutoscaler(spec: HorizontalPodAutoscalerSpec): ApiObject;
895
2218
  addVerticalPodAutoscaler(spec: VerticalPodAutoscalerSpec): ApiObject;
896
2219
  addPodDisruptionBudget(spec: PodDisruptionBudgetSpec): ApiObject;
@@ -939,6 +2262,88 @@ export declare class Rutter {
939
2262
  private addAGICAdvancedAnnotations;
940
2263
  addAWSIRSAServiceAccount(spec: AWSIRSAServiceAccountSpec): ApiObject;
941
2264
  addAWSSecretProviderClass(spec: AWSSecretProviderClassSpec): ApiObject;
2265
+ /**
2266
+ * Add Azure Workload Identity ServiceAccount.
2267
+ * Creates a ServiceAccount with Azure Workload Identity annotations for secure authentication.
2268
+ *
2269
+ * @param spec - Azure Workload Identity ServiceAccount specification
2270
+ * @returns The created ServiceAccount ApiObject
2271
+ *
2272
+ * @example
2273
+ * ```typescript
2274
+ * rutter.addAzureWorkloadIdentityServiceAccount({
2275
+ * name: 'workload-identity-sa',
2276
+ * clientId: '12345678-1234-1234-1234-123456789012',
2277
+ * tenantId: '87654321-4321-4321-4321-210987654321',
2278
+ * tokenExpiration: 3600
2279
+ * });
2280
+ * ```
2281
+ */
2282
+ addAzureWorkloadIdentityServiceAccount(spec: AzureWorkloadIdentityServiceAccountSpec): ApiObject;
2283
+ /**
2284
+ * Add Azure Key Vault SecretProviderClass.
2285
+ * Creates a SecretProviderClass for mounting secrets from Azure Key Vault using CSI driver.
2286
+ *
2287
+ * @param spec - Azure Key Vault SecretProviderClass specification
2288
+ * @returns The created SecretProviderClass ApiObject
2289
+ *
2290
+ * @example
2291
+ * ```typescript
2292
+ * rutter.addAzureKeyVaultSecretProviderClass({
2293
+ * name: 'app-secrets',
2294
+ * keyVaultName: 'my-keyvault',
2295
+ * tenantId: '87654321-4321-4321-4321-210987654321',
2296
+ * objects: [
2297
+ * { objectName: 'database-password', objectType: 'secret' },
2298
+ * { objectName: 'api-key', objectType: 'secret', objectAlias: 'API_KEY' }
2299
+ * ],
2300
+ * userAssignedIdentityID: '12345678-1234-1234-1234-123456789012'
2301
+ * });
2302
+ * ```
2303
+ */
2304
+ addAzureKeyVaultSecretProviderClass(spec: AzureKeyVaultSecretProviderClassSpec): ApiObject;
2305
+ /**
2306
+ * Add Azure Files StorageClass.
2307
+ * Creates a StorageClass for dynamic provisioning of Azure Files volumes.
2308
+ *
2309
+ * @param spec - Azure Files StorageClass specification
2310
+ * @returns The created StorageClass ApiObject
2311
+ *
2312
+ * @example
2313
+ * ```typescript
2314
+ * rutter.addAzureFilesStorageClass({
2315
+ * name: 'azure-files-premium',
2316
+ * skuName: 'Premium_LRS',
2317
+ * protocol: 'smb',
2318
+ * allowSharedAccess: true
2319
+ * });
2320
+ * ```
2321
+ */
2322
+ addAzureFilesStorageClass(spec: AzureFilesStorageClassSpec): ApiObject;
2323
+ /**
2324
+ * Add Azure Files PersistentVolume.
2325
+ * Creates a PersistentVolume for static Azure Files volume provisioning.
2326
+ *
2327
+ * @param spec - Azure Files PersistentVolume specification
2328
+ * @returns The created PersistentVolume ApiObject
2329
+ */
2330
+ addAzureFilesPersistentVolume(spec: AzureFilesPersistentVolumeSpec): ApiObject;
2331
+ /**
2332
+ * Add Azure Files PersistentVolumeClaim.
2333
+ * Creates a PersistentVolumeClaim for Azure Files storage.
2334
+ *
2335
+ * @param spec - Azure Files PersistentVolumeClaim specification
2336
+ * @returns The created PersistentVolumeClaim ApiObject
2337
+ */
2338
+ addAzureFilesPersistentVolumeClaim(spec: AzureFilesPersistentVolumeClaimSpec): ApiObject;
2339
+ /**
2340
+ * Add Azure Container Registry ServiceAccount.
2341
+ * Creates a ServiceAccount configured for ACR access.
2342
+ *
2343
+ * @param spec - Azure ACR ServiceAccount specification
2344
+ * @returns The created ServiceAccount ApiObject
2345
+ */
2346
+ addAzureACRServiceAccount(spec: AzureACRServiceAccountSpec): ApiObject;
942
2347
  addAzureDiskStorageClass(spec: AzureDiskStorageClassSpec): ApiObject;
943
2348
  private buildAzureDiskParameters;
944
2349
  private addOptionalAzureDiskParameters;
@@ -1009,6 +2414,8 @@ export declare class Rutter {
1009
2414
  private validateAGICSecurityParams;
1010
2415
  private isValidHostname;
1011
2416
  private validateAGICAnnotationConsistency;
2417
+ private buildAzureFilesParameters;
2418
+ private buildAzureFilesPVCSISpec;
1012
2419
  private buildPodEnvironment;
1013
2420
  private buildJobSpec;
1014
2421
  private buildJobPodTemplate;
@@ -1034,6 +2441,14 @@ export declare class Rutter {
1034
2441
  * Get default resource limits for Jobs and CronJobs
1035
2442
  */
1036
2443
  private getDefaultResources;
2444
+ /**
2445
+ * Validate Azure Files parameters for security and compliance
2446
+ */
2447
+ private validateAzureFilesParameters;
2448
+ /**
2449
+ * Sanitize volume handle to ensure valid format for CSI driver
2450
+ */
2451
+ private sanitizeVolumeHandle;
1037
2452
  /**
1038
2453
  * Capture the YAML of an ApiObject or Construct into assets.
1039
2454
  */
@@ -1043,11 +2458,230 @@ export declare class Rutter {
1043
2458
  */
1044
2459
  private getResourceName;
1045
2460
  /**
1046
- * Add a raw CRD manifest to the chart (written under crds/).
2461
+ * Adds a raw CRD manifest to the chart
2462
+ *
2463
+ * @param {string} yaml - YAML content of the CRD
2464
+ * @param {string} [id='crd'] - Asset identifier
2465
+ *
2466
+ * @example
2467
+ * ```typescript
2468
+ * const crdYaml = `
2469
+ * apiVersion: apiextensions.k8s.io/v1
2470
+ * kind: CustomResourceDefinition
2471
+ * metadata:
2472
+ * name: myresources.example.com
2473
+ * `;
2474
+ * rutter.addCrd(crdYaml, 'myresource-crd');
2475
+ * ```
2476
+ *
2477
+ * @since 1.0.0
1047
2478
  */
1048
2479
  addCrd(yaml: string, id?: string): void;
1049
2480
  /**
1050
- * Synthesize the cdk8s app and write a Helm chart to outDir.
2481
+ * Add Karpenter NodePool for intelligent node provisioning.
2482
+ * Creates a NodePool resource that defines compute requirements and lifecycle policies.
2483
+ *
2484
+ * @param spec - Karpenter NodePool specification
2485
+ * @returns The created NodePool ApiObject
2486
+ *
2487
+ * @example
2488
+ * ```typescript
2489
+ * rutter.addKarpenterNodePool({
2490
+ * name: 'general-purpose',
2491
+ * requirements: [
2492
+ * { key: 'eks.amazonaws.com/instance-category', operator: 'In', values: ['c', 'm', 'r'] },
2493
+ * { key: 'kubernetes.io/arch', operator: 'In', values: ['amd64'] }
2494
+ * ],
2495
+ * limits: { cpu: '1000', memory: '1000Gi' },
2496
+ * nodeClassRef: { name: 'default' }
2497
+ * });
2498
+ * ```
2499
+ *
2500
+ * @since 2.3.0
2501
+ */
2502
+ addKarpenterNodePool(spec: KarpenterNodePoolSpec): ApiObject;
2503
+ /**
2504
+ * Add Karpenter EC2 NodeClass for AWS-specific node configuration.
2505
+ * Creates a NodeClass resource that defines EC2 instance settings and networking.
2506
+ *
2507
+ * @param spec - Karpenter EC2 NodeClass specification
2508
+ * @returns The created NodeClass ApiObject
2509
+ *
2510
+ * @example
2511
+ * ```typescript
2512
+ * rutter.addKarpenterEC2NodeClass({
2513
+ * name: 'default',
2514
+ * amiFamily: 'AL2023',
2515
+ * subnetSelectorTerms: [{ tags: { 'karpenter.sh/discovery': 'my-cluster' } }],
2516
+ * securityGroupSelectorTerms: [{ tags: { 'karpenter.sh/discovery': 'my-cluster' } }],
2517
+ * role: 'KarpenterNodeInstanceProfile'
2518
+ * });
2519
+ * ```
2520
+ *
2521
+ * @since 2.3.0
2522
+ */
2523
+ addKarpenterEC2NodeClass(spec: KarpenterEC2NodeClassSpec): ApiObject;
2524
+ /**
2525
+ * Validate Karpenter NodePool specification
2526
+ */
2527
+ private validateKarpenterNodePoolSpec;
2528
+ private validateNodeClassRef;
2529
+ private validateNodePoolRequirements;
2530
+ private validateNodePoolLimits;
2531
+ private validateNodePoolDisruption;
2532
+ /**
2533
+ * Validate Karpenter EC2 NodeClass specification
2534
+ */
2535
+ private validateKarpenterEC2NodeClassSpec;
2536
+ private validateNodeClassSelectors;
2537
+ private validateNodeClassBlockDevices;
2538
+ private validateNodeClassMetadataOptions;
2539
+ /**
2540
+ * Validate Kubernetes resource quantity format (e.g., "100m", "1Gi")
2541
+ */
2542
+ private isValidResourceQuantity;
2543
+ /**
2544
+ * Validate duration format (e.g., "30s", "5m", "1h")
2545
+ */
2546
+ private isValidDuration;
2547
+ /**
2548
+ * Validate storage size format (e.g., "20", "100Gi")
2549
+ */
2550
+ private isValidStorageSize;
2551
+ /**
2552
+ * Add Karpenter NodeClaim for individual node provisioning.
2553
+ * Creates a NodeClaim resource that represents a request for a single node.
2554
+ *
2555
+ * @param spec - Karpenter NodeClaim specification
2556
+ * @returns The created NodeClaim ApiObject
2557
+ *
2558
+ * @example
2559
+ * ```typescript
2560
+ * rutter.addKarpenterNodeClaim({
2561
+ * name: 'high-memory-node',
2562
+ * requirements: [
2563
+ * { key: 'eks.amazonaws.com/instance-category', operator: 'In', values: ['r'] },
2564
+ * { key: 'eks.amazonaws.com/instance-cpu', operator: 'In', values: ['16', '32'] }
2565
+ * ],
2566
+ * nodeClassRef: { name: 'memory-optimized' },
2567
+ * expireAfter: '24h'
2568
+ * });
2569
+ * ```
2570
+ *
2571
+ * @since 2.3.0
2572
+ */
2573
+ addKarpenterNodeClaim(spec: KarpenterNodeClaimSpec): ApiObject;
2574
+ /**
2575
+ * Add advanced Karpenter scheduling configuration.
2576
+ * Creates scheduling constraints for fine-grained pod placement control.
2577
+ *
2578
+ * @param spec - Karpenter scheduling specification
2579
+ * @returns Configuration object for use in pod specs
2580
+ *
2581
+ * @example
2582
+ * ```typescript
2583
+ * const schedulingConfig = rutter.addKarpenterScheduling({
2584
+ * name: 'zone-spread-scheduling',
2585
+ * topologySpreadConstraints: [{
2586
+ * maxSkew: 1,
2587
+ * topologyKey: 'topology.kubernetes.io/zone',
2588
+ * whenUnsatisfiable: 'DoNotSchedule',
2589
+ * labelSelector: { matchLabels: { app: 'web' } }
2590
+ * }],
2591
+ * nodeAffinity: {
2592
+ * requiredDuringSchedulingIgnoredDuringExecution: {
2593
+ * nodeSelectorTerms: [{
2594
+ * matchExpressions: [{
2595
+ * key: 'eks.amazonaws.com/instance-category',
2596
+ * operator: 'In',
2597
+ * values: ['c', 'm']
2598
+ * }]
2599
+ * }]
2600
+ * }
2601
+ * }
2602
+ * });
2603
+ * ```
2604
+ *
2605
+ * @since 2.3.0
2606
+ */
2607
+ addKarpenterScheduling(spec: KarpenterSchedulingSpec): {
2608
+ schedulerName?: string;
2609
+ priorityClassName?: string;
2610
+ tolerations?: {
2611
+ key?: string;
2612
+ operator?: "Exists" | "Equal";
2613
+ value?: string;
2614
+ effect?: "NoSchedule" | "PreferNoSchedule" | "NoExecute";
2615
+ tolerationSeconds?: number;
2616
+ }[];
2617
+ topologySpreadConstraints?: KarpenterTopologySpreadConstraint[];
2618
+ affinity?: {
2619
+ nodeAffinity: KarpenterNodeAffinity;
2620
+ };
2621
+ nodeSelector?: Record<string, string>;
2622
+ };
2623
+ /**
2624
+ * Create advanced disruption configuration for NodePools.
2625
+ * Provides fine-grained control over when and how nodes are disrupted.
2626
+ *
2627
+ * @param spec - Advanced disruption specification
2628
+ * @returns Disruption configuration object
2629
+ *
2630
+ * @example
2631
+ * ```typescript
2632
+ * const disruptionConfig = rutter.createKarpenterDisruption({
2633
+ * consolidationPolicy: 'WhenEmptyOrUnderutilized',
2634
+ * consolidateAfter: '30s',
2635
+ * expireAfter: '2160h', // 90 days
2636
+ * budgets: [{
2637
+ * schedule: '0 9 * * mon-fri', // Business hours
2638
+ * duration: '8h',
2639
+ * nodes: '0', // No disruption during business hours
2640
+ * reasons: ['Underutilized', 'Empty']
2641
+ * }]
2642
+ * });
2643
+ * ```
2644
+ *
2645
+ * @since 2.3.0
2646
+ */
2647
+ createKarpenterDisruption(spec: KarpenterAdvancedDisruption): {
2648
+ budgets?: KarpenterDisruptionBudget[];
2649
+ expireAfter?: string;
2650
+ consolidateAfter?: string;
2651
+ consolidationPolicy?: "WhenEmpty" | "WhenEmptyOrUnderutilized";
2652
+ };
2653
+ /**
2654
+ * Validate Karpenter NodeClaim specification
2655
+ */
2656
+ private validateKarpenterNodeClaimSpec;
2657
+ /**
2658
+ * Validate Karpenter scheduling specification
2659
+ */
2660
+ private validateKarpenterSchedulingSpec;
2661
+ private validateTopologySpreadConstraints;
2662
+ private validateSchedulingTolerations;
2663
+ /**
2664
+ * Validate Karpenter disruption specification
2665
+ */
2666
+ private validateKarpenterDisruptionSpec;
2667
+ private validateDisruptionDurations;
2668
+ private validateDisruptionBudgets;
2669
+ /**
2670
+ * Synthesizes the cdk8s app and writes a complete Helm chart
2671
+ *
2672
+ * Generates all Kubernetes manifests, applies Helm templating,
2673
+ * and writes the complete chart structure to the output directory.
2674
+ *
2675
+ * @param {string} outDir - Output directory for the Helm chart
2676
+ * @throws {Error} If synthesis or writing fails
2677
+ *
2678
+ * @example
2679
+ * ```typescript
2680
+ * rutter.write('./charts/my-app');
2681
+ * // Creates: ./charts/my-app/Chart.yaml, values.yaml, templates/, etc.
2682
+ * ```
2683
+ *
2684
+ * @since 1.0.0
1051
2685
  */
1052
2686
  write(outDir: string): void;
1053
2687
  }