timonel 2.8.1 → 2.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cli.d.ts +0 -1
  3. package/dist/cli.js +290 -226
  4. package/dist/index.d.ts +0 -5
  5. package/dist/index.js +0 -6
  6. package/dist/lib/helm.d.ts +0 -472
  7. package/dist/lib/helm.js +0 -481
  8. package/dist/lib/helmChartWriter.d.ts +0 -178
  9. package/dist/lib/helmChartWriter.js +0 -180
  10. package/dist/lib/resources/baseResourceProvider.d.ts +0 -46
  11. package/dist/lib/resources/baseResourceProvider.js +1 -47
  12. package/dist/lib/resources/cloud/aws/awsResources.d.ts +0 -144
  13. package/dist/lib/resources/cloud/aws/awsResources.js +1 -163
  14. package/dist/lib/resources/cloud/aws/karpenterResources.d.ts +0 -132
  15. package/dist/lib/resources/cloud/aws/karpenterResources.js +0 -75
  16. package/dist/lib/rutter.d.ts +0 -324
  17. package/dist/lib/rutter.js +8 -352
  18. package/dist/lib/security.d.ts +0 -119
  19. package/dist/lib/security.js +4 -160
  20. package/dist/lib/umbrella.d.ts +0 -24
  21. package/dist/lib/umbrella.js +0 -24
  22. package/dist/lib/umbrellaRutter.d.ts +0 -71
  23. package/dist/lib/umbrellaRutter.js +2 -82
  24. package/dist/lib/utils/helmHelpers.d.ts +0 -39
  25. package/dist/lib/utils/helmHelpers.js +0 -32
  26. package/package.json +1 -1
  27. package/dist/cli.d.ts.map +0 -1
  28. package/dist/cli.js.map +0 -1
  29. package/dist/index.d.ts.map +0 -1
  30. package/dist/index.js.map +0 -1
  31. package/dist/lib/helm.d.ts.map +0 -1
  32. package/dist/lib/helm.js.map +0 -1
  33. package/dist/lib/helmChartWriter.d.ts.map +0 -1
  34. package/dist/lib/helmChartWriter.js.map +0 -1
  35. package/dist/lib/resources/baseResourceProvider.d.ts.map +0 -1
  36. package/dist/lib/resources/baseResourceProvider.js.map +0 -1
  37. package/dist/lib/resources/cloud/aws/awsResources.d.ts.map +0 -1
  38. package/dist/lib/resources/cloud/aws/awsResources.js.map +0 -1
  39. package/dist/lib/resources/cloud/aws/karpenterResources.d.ts.map +0 -1
  40. package/dist/lib/resources/cloud/aws/karpenterResources.js.map +0 -1
  41. package/dist/lib/rutter.d.ts.map +0 -1
  42. package/dist/lib/rutter.js.map +0 -1
  43. package/dist/lib/security.d.ts.map +0 -1
  44. package/dist/lib/security.js.map +0 -1
  45. package/dist/lib/umbrella.d.ts.map +0 -1
  46. package/dist/lib/umbrella.js.map +0 -1
  47. package/dist/lib/umbrellaRutter.d.ts.map +0 -1
  48. package/dist/lib/umbrellaRutter.js.map +0 -1
  49. package/dist/lib/utils/helmHelpers.d.ts.map +0 -1
  50. package/dist/lib/utils/helmHelpers.js.map +0 -1
@@ -1,202 +1,109 @@
1
- /**
2
- * @fileoverview Karpenter resources for AWS EKS node management
3
- * @since 2.7.0
4
- */
5
1
  import type { ApiObject } from 'cdk8s';
6
2
  import { BaseResourceProvider } from '../../baseResourceProvider.js';
7
- /**
8
- * Karpenter version compatibility utilities
9
- * @since 2.7.1
10
- */
11
3
  export declare class KarpenterVersionUtils {
12
- /**
13
- * Checks if the current Karpenter version supports v1 API
14
- * @returns true if v1 API is supported, false otherwise
15
- */
16
4
  static isKarpenterV1Compatible(): boolean;
17
- /**
18
- * Gets the appropriate API version for NodePool resources
19
- * @returns API version string
20
- */
21
5
  static getNodePoolApiVersion(): string;
22
- /**
23
- * Gets the appropriate API version for NodeClaim resources
24
- * @returns API version string
25
- */
26
6
  static getNodeClaimApiVersion(): string;
27
7
  }
28
- /**
29
- * Karpenter Disruption Budget specification
30
- * @since 2.7.1
31
- */
32
8
  export interface KarpenterDisruptionBudget {
33
- /** Number or percentage of nodes that can be disrupted */
34
9
  nodes: string;
35
- /** Cron schedule for when budget applies (optional) */
36
10
  schedule?: string;
37
- /** Duration the budget is active (optional) */
38
11
  duration?: string;
39
12
  }
40
- /**
41
- * Validates a KarpenterDisruptionBudget configuration
42
- * @param budget - The budget to validate
43
- * @returns true if valid, false otherwise
44
- * @since 2.7.1
45
- */
46
13
  export declare function isValidDisruptionBudget(budget: KarpenterDisruptionBudget): boolean;
47
- /**
48
- * Validates Kubernetes duration format
49
- * @param duration - Duration string to validate
50
- * @returns true if valid, false otherwise
51
- * @since 2.7.1
52
- */
53
14
  export declare function isValidKubernetesDuration(duration: string): boolean;
54
- /**
55
- * Default termination grace period for Karpenter nodes
56
- * @since 2.7.1
57
- */
58
15
  export declare const DEFAULT_TERMINATION_GRACE_PERIOD = "30s";
59
- /**
60
- * Karpenter Disruption specification
61
- * @since 2.7.1
62
- */
63
16
  export interface KarpenterDisruption {
64
- /** Consolidation policy */
65
17
  consolidationPolicy?: 'WhenEmpty' | 'WhenEmptyOrUnderutilized';
66
- /** Time to wait before consolidating */
67
18
  consolidateAfter?: string;
68
- /** Node expiration time */
69
19
  expireAfter?: string;
70
- /** Disruption budgets for rate limiting */
71
20
  budgets?: KarpenterDisruptionBudget[];
72
21
  }
73
- /**
74
- * Karpenter NodePool specification
75
- * @since 2.7.0
76
- */
77
22
  export interface KarpenterNodePoolSpec {
78
- /** Resource name */
79
23
  name: string;
80
- /** Template for nodes */
81
24
  template: {
82
25
  metadata?: {
83
26
  labels?: Record<string, string>;
84
27
  annotations?: Record<string, string>;
85
28
  };
86
29
  spec: {
87
- /** Node class reference */
88
30
  nodeClassRef: {
89
31
  apiVersion: string;
90
32
  kind: string;
91
33
  name: string;
92
34
  };
93
- /** Node requirements */
94
35
  requirements?: Array<{
95
36
  key: string;
96
37
  operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
97
38
  values?: string[];
98
39
  }>;
99
- /** Taints to apply to nodes */
100
40
  taints?: Array<{
101
41
  key: string;
102
42
  value?: string;
103
43
  effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
104
44
  }>;
105
- /** Startup taints */
106
45
  startupTaints?: Array<{
107
46
  key: string;
108
47
  value?: string;
109
48
  effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
110
49
  }>;
111
- /** Termination grace period */
112
50
  terminationGracePeriod?: string;
113
51
  };
114
52
  };
115
- /** Disruption settings */
116
53
  disruption?: KarpenterDisruption;
117
- /** Resource limits */
118
54
  limits?: Record<string, string>;
119
- /** Resource weight for scheduling priority */
120
55
  weight?: number;
121
- /** Resource labels */
122
56
  labels?: Record<string, string>;
123
- /** Resource annotations */
124
57
  annotations?: Record<string, string>;
125
58
  }
126
- /**
127
- * Karpenter NodeClaim specification
128
- * @since 2.7.0
129
- */
130
59
  export interface KarpenterNodeClaimSpec {
131
- /** Resource name */
132
60
  name: string;
133
- /** Node class reference */
134
61
  nodeClassRef: {
135
62
  apiVersion: string;
136
63
  kind: string;
137
64
  name: string;
138
65
  };
139
- /** Node requirements */
140
66
  requirements?: Array<{
141
67
  key: string;
142
68
  operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist' | 'Gt' | 'Lt';
143
69
  values?: string[];
144
70
  }>;
145
- /** Taints to apply to node */
146
71
  taints?: Array<{
147
72
  key: string;
148
73
  value?: string;
149
74
  effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
150
75
  }>;
151
- /** Startup taints */
152
76
  startupTaints?: Array<{
153
77
  key: string;
154
78
  value?: string;
155
79
  effect: 'NoSchedule' | 'PreferNoSchedule' | 'NoExecute';
156
80
  }>;
157
- /** Resource labels */
158
81
  labels?: Record<string, string>;
159
- /** Resource annotations */
160
82
  annotations?: Record<string, string>;
161
83
  }
162
- /**
163
- * Karpenter EC2NodeClass specification
164
- * @since 2.7.0
165
- */
166
84
  export interface KarpenterEC2NodeClassSpec {
167
- /** Resource name */
168
85
  name: string;
169
- /** AMI family */
170
86
  amiFamily?: 'AL2' | 'AL2023' | 'Bottlerocket' | 'Ubuntu' | 'Windows2019' | 'Windows2022' | 'Custom';
171
- /** AMI selector */
172
87
  amiSelectorTerms?: Array<{
173
88
  tags?: Record<string, string>;
174
89
  id?: string;
175
90
  name?: string;
176
91
  owner?: string;
177
92
  }>;
178
- /** Instance store policy */
179
93
  instanceStorePolicy?: 'RAID0' | 'NVME';
180
- /** Instance profile */
181
94
  instanceProfile?: string;
182
- /** Security group selector */
183
95
  securityGroupSelectorTerms?: Array<{
184
96
  tags?: Record<string, string>;
185
97
  id?: string;
186
98
  name?: string;
187
99
  }>;
188
- /** Subnet selector */
189
100
  subnetSelectorTerms?: Array<{
190
101
  tags?: Record<string, string>;
191
102
  id?: string;
192
103
  }>;
193
- /** User data */
194
104
  userData?: string;
195
- /** Role */
196
105
  role?: string;
197
- /** Tags to apply to instances */
198
106
  tags?: Record<string, string>;
199
- /** Block device mappings */
200
107
  blockDeviceMappings?: Array<{
201
108
  deviceName: string;
202
109
  ebs?: {
@@ -209,51 +116,19 @@ export interface KarpenterEC2NodeClassSpec {
209
116
  deleteOnTermination?: boolean;
210
117
  };
211
118
  }>;
212
- /** Metadata options */
213
119
  metadataOptions?: {
214
120
  httpEndpoint?: 'enabled' | 'disabled';
215
121
  httpProtocolIPv6?: 'enabled' | 'disabled';
216
122
  httpPutResponseHopLimit?: number;
217
123
  httpTokens?: 'required' | 'optional';
218
124
  };
219
- /** Resource labels */
220
125
  labels?: Record<string, string>;
221
- /** Resource annotations */
222
126
  annotations?: Record<string, string>;
223
127
  }
224
- /**
225
- * Karpenter resources provider for AWS EKS node management
226
- * @extends BaseResourceProvider
227
- * @since 2.7.0
228
- */
229
128
  export declare class KarpenterResources extends BaseResourceProvider {
230
- /**
231
- * Creates a Karpenter NodePool resource
232
- * @param spec - NodePool specification
233
- * @returns Created NodePool ApiObject
234
- * @since 2.7.0
235
- */
236
129
  addKarpenterNodePool(spec: KarpenterNodePoolSpec): ApiObject;
237
- /**
238
- * Creates a Karpenter NodeClaim resource
239
- * @param spec - NodeClaim specification
240
- * @returns Created NodeClaim ApiObject
241
- * @since 2.7.0
242
- */
243
130
  addKarpenterNodeClaim(spec: KarpenterNodeClaimSpec): ApiObject;
244
- /**
245
- * Creates a Karpenter EC2NodeClass resource
246
- * @param spec - EC2NodeClass specification
247
- * @returns Created EC2NodeClass ApiObject
248
- * @since 2.7.0
249
- */
250
131
  addKarpenterEC2NodeClass(spec: KarpenterEC2NodeClassSpec): ApiObject;
251
- /**
252
- * Creates a Karpenter NodePool with optimized disruption settings for cost efficiency
253
- * @param spec - NodePool specification with disruption optimization
254
- * @returns Created NodePool ApiObject
255
- * @since 2.7.1
256
- */
257
132
  addKarpenterNodePoolWithDisruption(spec: {
258
133
  name: string;
259
134
  nodeClassRef: {
@@ -275,12 +150,6 @@ export declare class KarpenterResources extends BaseResourceProvider {
275
150
  labels?: Record<string, string>;
276
151
  annotations?: Record<string, string>;
277
152
  }): ApiObject;
278
- /**
279
- * Creates a Karpenter NodePool with scheduling constraints and priorities
280
- * @param spec - NodePool specification with scheduling optimization
281
- * @returns Created NodePool ApiObject
282
- * @since 2.7.1
283
- */
284
153
  addKarpenterNodePoolWithScheduling(spec: {
285
154
  name: string;
286
155
  nodeClassRef: {
@@ -310,4 +179,3 @@ export declare class KarpenterResources extends BaseResourceProvider {
310
179
  annotations?: Record<string, string>;
311
180
  }): ApiObject;
312
181
  }
313
- //# sourceMappingURL=karpenterResources.d.ts.map
@@ -1,75 +1,25 @@
1
- /**
2
- * @fileoverview Karpenter resources for AWS EKS node management
3
- * @since 2.7.0
4
- */
5
1
  import { BaseResourceProvider } from '../../baseResourceProvider.js';
6
- /**
7
- * Karpenter version compatibility utilities
8
- * @since 2.7.1
9
- */
10
2
  export class KarpenterVersionUtils {
11
- /**
12
- * Checks if the current Karpenter version supports v1 API
13
- * @returns true if v1 API is supported, false otherwise
14
- */
15
3
  static isKarpenterV1Compatible() {
16
- // For now, we assume v1 compatibility since we're targeting Karpenter v1.6+
17
- // In the future, this could check actual cluster version
18
4
  return true;
19
5
  }
20
- /**
21
- * Gets the appropriate API version for NodePool resources
22
- * @returns API version string
23
- */
24
6
  static getNodePoolApiVersion() {
25
7
  return this.isKarpenterV1Compatible() ? 'karpenter.sh/v1' : 'karpenter.sh/v1beta1';
26
8
  }
27
- /**
28
- * Gets the appropriate API version for NodeClaim resources
29
- * @returns API version string
30
- */
31
9
  static getNodeClaimApiVersion() {
32
10
  return this.isKarpenterV1Compatible() ? 'karpenter.sh/v1' : 'karpenter.sh/v1beta1';
33
11
  }
34
12
  }
35
- /**
36
- * Validates a KarpenterDisruptionBudget configuration
37
- * @param budget - The budget to validate
38
- * @returns true if valid, false otherwise
39
- * @since 2.7.1
40
- */
41
13
  export function isValidDisruptionBudget(budget) {
42
14
  const nodePattern = /^(\d+%|\d+)$/;
43
15
  return nodePattern.test(budget.nodes);
44
16
  }
45
- /**
46
- * Validates Kubernetes duration format
47
- * @param duration - Duration string to validate
48
- * @returns true if valid, false otherwise
49
- * @since 2.7.1
50
- */
51
17
  export function isValidKubernetesDuration(duration) {
52
- // eslint-disable-next-line security/detect-unsafe-regex
53
18
  const durationPattern = /^(\d+h)?(\d+m)?(\d+s)?$/;
54
19
  return durationPattern.test(duration) && duration.length > 0;
55
20
  }
56
- /**
57
- * Default termination grace period for Karpenter nodes
58
- * @since 2.7.1
59
- */
60
21
  export const DEFAULT_TERMINATION_GRACE_PERIOD = '30s';
61
- /**
62
- * Karpenter resources provider for AWS EKS node management
63
- * @extends BaseResourceProvider
64
- * @since 2.7.0
65
- */
66
22
  export class KarpenterResources extends BaseResourceProvider {
67
- /**
68
- * Creates a Karpenter NodePool resource
69
- * @param spec - NodePool specification
70
- * @returns Created NodePool ApiObject
71
- * @since 2.7.0
72
- */
73
23
  addKarpenterNodePool(spec) {
74
24
  const nodePoolSpec = {
75
25
  template: spec.template,
@@ -85,12 +35,6 @@ export class KarpenterResources extends BaseResourceProvider {
85
35
  }
86
36
  return this.createApiObject(spec.name, KarpenterVersionUtils.getNodePoolApiVersion(), 'NodePool', nodePoolSpec, spec.labels, spec.annotations);
87
37
  }
88
- /**
89
- * Creates a Karpenter NodeClaim resource
90
- * @param spec - NodeClaim specification
91
- * @returns Created NodeClaim ApiObject
92
- * @since 2.7.0
93
- */
94
38
  addKarpenterNodeClaim(spec) {
95
39
  const nodeClaimSpec = {
96
40
  nodeClassRef: spec.nodeClassRef,
@@ -106,12 +50,6 @@ export class KarpenterResources extends BaseResourceProvider {
106
50
  }
107
51
  return this.createApiObject(spec.name, KarpenterVersionUtils.getNodeClaimApiVersion(), 'NodeClaim', nodeClaimSpec, spec.labels, spec.annotations);
108
52
  }
109
- /**
110
- * Creates a Karpenter EC2NodeClass resource
111
- * @param spec - EC2NodeClass specification
112
- * @returns Created EC2NodeClass ApiObject
113
- * @since 2.7.0
114
- */
115
53
  addKarpenterEC2NodeClass(spec) {
116
54
  const nodeClassSpec = {};
117
55
  if (spec.amiFamily) {
@@ -149,12 +87,6 @@ export class KarpenterResources extends BaseResourceProvider {
149
87
  }
150
88
  return this.createApiObject(spec.name, 'karpenter.k8s.aws/v1beta1', 'EC2NodeClass', nodeClassSpec, spec.labels, spec.annotations);
151
89
  }
152
- /**
153
- * Creates a Karpenter NodePool with optimized disruption settings for cost efficiency
154
- * @param spec - NodePool specification with disruption optimization
155
- * @returns Created NodePool ApiObject
156
- * @since 2.7.1
157
- */
158
90
  addKarpenterNodePoolWithDisruption(spec) {
159
91
  const disruption = {};
160
92
  if (spec.consolidationPolicy) {
@@ -196,12 +128,6 @@ export class KarpenterResources extends BaseResourceProvider {
196
128
  }
197
129
  return this.addKarpenterNodePool(nodePoolConfig);
198
130
  }
199
- /**
200
- * Creates a Karpenter NodePool with scheduling constraints and priorities
201
- * @param spec - NodePool specification with scheduling optimization
202
- * @returns Created NodePool ApiObject
203
- * @since 2.7.1
204
- */
205
131
  addKarpenterNodePoolWithScheduling(spec) {
206
132
  const templateSpec = {
207
133
  nodeClassRef: spec.nodeClassRef,
@@ -245,4 +171,3 @@ export class KarpenterResources extends BaseResourceProvider {
245
171
  return this.addKarpenterNodePool(nodePoolConfig);
246
172
  }
247
173
  }
248
- //# sourceMappingURL=karpenterResources.js.map