timonel 0.2.1 → 0.4.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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,85 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [0.4.0] - 2025-09-06
11
+
12
+ ### Added (0.4.0)
13
+
14
+ - **Custom Manifest Naming**: Complete implementation for customizable Kubernetes
15
+ manifest file names
16
+ - `manifestName` option in RutterProps to specify custom base names for manifest
17
+ files
18
+ - `singleManifestFile` option to combine all resources into a single manifest
19
+ file
20
+ - Enhanced file organization with descriptive names instead of generic numbered
21
+ files
22
+ - Support for both single file mode (`application.yaml`) and separate files mode
23
+ (`0000-my-app-deployment-web.yaml`)
24
+ - Backward compatibility maintained - default behavior unchanged when options not
25
+ specified
26
+
27
+ ### Enhanced (0.4.0)
28
+
29
+ - **HelmChartWriter**: Added `singleFile` property to SynthAsset interface for
30
+ improved file handling
31
+ - **Documentation**: Comprehensive Custom Manifest Naming section added to README
32
+ with examples
33
+ - **Examples**: All examples updated with custom manifest naming demonstrations
34
+ - **AWS 2048 Game**: Enhanced with production-ready AWS features
35
+ - AWS ALB Ingress with health checks and SSL support
36
+ - HorizontalPodAutoscaler (HPA) for CPU-based auto-scaling
37
+ - PodDisruptionBudget (PDB) for high availability during updates
38
+ - Custom manifest naming with `manifestName: 'game-2048'`
39
+ - Multi-environment configuration (dev/staging/prod)
40
+ - **WordPress**: Updated to showcase `manifestName: 'wordpress-app'` and `singleManifestFile: true`
41
+ - Comprehensive AWS integration examples (EBS, EFS, IRSA, Secrets Manager)
42
+ - Auto-scaling with HPA and VPA configurations
43
+ - Production-ready deployment patterns
44
+ - **WordPress Umbrella**: Subcharts updated with custom manifest naming
45
+ - MySQL subchart: `manifestName: 'mysql-database'`, `singleManifestFile: true`
46
+ - WordPress subchart: `manifestName: 'wordpress-app'`, `singleManifestFile: false`
47
+ - **Example Documentation**: All example READMEs enhanced with custom manifest naming references
48
+ and comprehensive deployment instructions
49
+ - **Auto-scaling Features**: Properly documented existing production-ready capabilities
50
+ - HorizontalPodAutoscaler (HPA) with CPU/memory metrics and custom behavior policies
51
+ - VerticalPodAutoscaler (VPA) with resource policies and update modes
52
+ - PodDisruptionBudget (PDB) for high availability during updates
53
+ - **AWS Multi-Cloud Support**: Comprehensive documentation of EKS integration features
54
+ - AWS IRSA ServiceAccount for secure IAM role assumption with regional STS endpoints
55
+ - AWS EBS StorageClass with GP3, IO1, IO2 support, encryption, and IOPS configuration
56
+ - AWS EFS StorageClass for shared storage across pods with access points
57
+ - AWS ALB Ingress with health checks, SSL certificates, and advanced routing
58
+ - AWS Secrets Manager and Parameter Store integration via SecretProviderClass
59
+ - Multi-cloud ServiceAccount with workload identity (AWS IRSA, Azure, GCP)
60
+
61
+ ## [0.3.0] - 2025-09-02
62
+
63
+ ### Added (0.3.0)
64
+
65
+ - **Umbrella Charts Support**: Complete implementation for managing multiple subcharts
66
+ - `UmbrellaRutter` class for coordinating multiple Rutter instances
67
+ - `createUmbrella()` helper function for easy umbrella chart creation
68
+ - CLI commands: `tl umbrella init`, `tl umbrella add`, `tl umbrella synth`
69
+ - Automatic Chart.yaml generation with dependencies
70
+ - Support for environment-specific values in umbrella charts
71
+ - Example templates for umbrella and subchart scaffolding
72
+ - **WordPress Umbrella Example**: Complete example separating MySQL and WordPress into subcharts
73
+ - MySQL subchart with persistent storage and secrets
74
+ - WordPress subchart with database connectivity
75
+ - Multi-environment configuration (dev/prod)
76
+ - Comprehensive documentation and deployment guide
77
+
78
+ ### Changed (0.3.0)
79
+
80
+ - Updated CLI usage to include umbrella chart commands
81
+ - Enhanced example generation with subchart support
82
+
83
+ ### Removed
84
+
85
+ - **BREAKING**: Removed unused `cdk8s-plus-28` dependency
86
+ - Project uses `ApiObject` directly for better control
87
+ - No impact on functionality, only dependency cleanup
88
+
10
89
  ## [0.2.1] - 2025-09-02
11
90
 
12
91
  ### Fixed
@@ -156,5 +235,16 @@ const rutter = new Rutter({ meta: { name: 'my-app' } });
156
235
  - Security audit in CI/CD pipeline
157
236
  - Provenance-enabled npm publishing
158
237
 
159
- [Unreleased]: https://github.com/KenkoGeek/timonel/compare/v0.1.0...HEAD
238
+ [Unreleased]: https://github.com/KenkoGeek/timonel/compare/v0.4.0...HEAD
239
+ [0.4.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.4.0
240
+ [0.3.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.3.0
241
+ [0.2.1]: https://github.com/KenkoGeek/timonel/releases/tag/v0.2.1
242
+ [0.2.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.2.0
243
+ [0.1.7]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.7
244
+ [0.1.6]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.6
245
+ [0.1.5]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.5
246
+ [0.1.4]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.4
247
+ [0.1.3]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.3
248
+ [0.1.2]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.2
249
+ [0.1.1]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.1
160
250
  [0.1.0]: https://github.com/KenkoGeek/timonel/releases/tag/v0.1.0
package/README.md CHANGED
@@ -20,11 +20,13 @@ Key features:
20
20
  - Type-safe API (strict TypeScript) with cdk8s constructs.
21
21
  - Helm templating helpers to embed `{{ .Values.* }}` where needed.
22
22
  - Simple multi-environment setup: `values.yaml`, `values-dev.yaml`, `values-prod.yaml`, etc.
23
+ - **Umbrella Charts**: Manage multiple subcharts as a single deployable unit.
23
24
  - Minimal CLI (`tl`) to scaffold an example and synthesize the chart.
24
25
 
25
26
  Advanced templating:
26
27
 
27
28
  - Programmatic Helm helpers: generate `templates/_helpers.tpl` and call helpers using `template()`/`include()`.
29
+ - Umbrella chart support with automatic dependency management.
28
30
 
29
31
  ## Installation
30
32
 
@@ -137,6 +139,9 @@ const rutter = new Rutter({
137
139
  body: `{{- printf "%s-%s" .Chart.Name .Release.Name | trunc 63 | trimSuffix "-" -}}`,
138
140
  },
139
141
  ],
142
+ // Custom manifest naming options
143
+ manifestName: 'my-app-resources', // Custom name for manifest files
144
+ singleManifestFile: true, // Combine all resources into one file
140
145
  });
141
146
 
142
147
  rutter.addDeployment({
@@ -148,28 +153,159 @@ rutter.addDeployment({
148
153
 
149
154
  rutter.addService({ name: 'my-app', port: 80 });
150
155
 
151
- // Use a named helper in annotations (example)
152
- rutter.addDeployment({
153
- name: 'annotated',
154
- image: 'nginx',
155
- containerPort: 80,
156
- env: {
157
- FULLNAME: include('timonel.fullname'),
158
- },
156
+ // Add auto-scaling with HPA and VPA
157
+ rutter.addHorizontalPodAutoscaler({
158
+ name: 'my-app-hpa',
159
+ scaleTargetRef: { apiVersion: 'apps/v1', kind: 'Deployment', name: 'my-app' },
160
+ minReplicas: 1,
161
+ maxReplicas: 10,
162
+ });
163
+
164
+ rutter.addVerticalPodAutoscaler({
165
+ name: 'my-app-vpa',
166
+ targetRef: { apiVersion: 'apps/v1', kind: 'Deployment', name: 'my-app' },
167
+ updatePolicy: { updateMode: 'Auto' },
168
+ });
169
+
170
+ rutter.addPodDisruptionBudget({
171
+ name: 'my-app-pdb',
172
+ minAvailable: 1,
173
+ selector: { matchLabels: { app: 'my-app' } },
174
+ });
175
+
176
+ // Add IRSA ServiceAccount for AWS access
177
+ rutter.addAWSIRSAServiceAccount({
178
+ name: 'my-app-irsa',
179
+ roleArn: 'arn:aws:iam::123456789012:role/MyAppRole',
180
+ stsEndpointType: 'regional',
181
+ tokenExpiration: 3600,
159
182
  });
160
183
 
161
184
  rutter.write('dist/charts/my-app');
162
185
  ```
163
186
 
187
+ ### Custom Manifest Naming
188
+
189
+ Timonel provides flexible options for naming your Kubernetes manifest files:
190
+
191
+ #### Single Manifest File
192
+
193
+ ```typescript
194
+ const rutter = new Rutter({
195
+ meta: { name: 'my-app', version: '0.1.0' },
196
+ manifestName: 'application',
197
+ singleManifestFile: true, // All resources in one file
198
+ });
199
+
200
+ // Generates: templates/application.yaml
201
+ ```
202
+
203
+ #### Separate Files with Custom Names
204
+
205
+ ```typescript
206
+ const rutter = new Rutter({
207
+ meta: { name: 'my-app', version: '0.1.0' },
208
+ manifestName: 'my-app',
209
+ singleManifestFile: false, // Each resource in its own file (default)
210
+ });
211
+
212
+ // Generates:
213
+ // templates/0000-my-app-deployment-web.yaml
214
+ // templates/0001-my-app-service-web.yaml
215
+ // templates/0002-my-app-configmap-config.yaml
216
+ ```
217
+
218
+ #### Default Behavior
219
+
220
+ ```typescript
221
+ const rutter = new Rutter({
222
+ meta: { name: 'my-app', version: '0.1.0' },
223
+ // No manifestName specified
224
+ });
225
+
226
+ // Generates:
227
+ // templates/0000-deployment-web.yaml
228
+ // templates/0001-service-web.yaml
229
+ // templates/0002-configmap-config.yaml
230
+ ```
231
+
232
+ ## Umbrella Charts
233
+
234
+ Create umbrella charts that combine multiple subcharts into a single deployable unit:
235
+
236
+ ```typescript
237
+ import { createUmbrella, Rutter } from 'timonel';
238
+
239
+ // Create individual subcharts
240
+ const mysql = new Rutter({
241
+ meta: { name: 'mysql', version: '0.1.0' },
242
+ // MySQL configuration...
243
+ });
244
+
245
+ const wordpress = new Rutter({
246
+ meta: { name: 'wordpress', version: '0.1.0' },
247
+ // WordPress configuration...
248
+ });
249
+
250
+ // Combine into umbrella chart
251
+ const umbrella = createUmbrella({
252
+ meta: {
253
+ name: 'wordpress-stack',
254
+ version: '1.0.0',
255
+ description: 'Complete WordPress stack with MySQL database',
256
+ },
257
+ subcharts: [
258
+ { name: 'mysql', rutter: mysql },
259
+ { name: 'wordpress', rutter: wordpress },
260
+ ],
261
+ defaultValues: {
262
+ global: { storageClass: 'gp2' },
263
+ mysql: { persistence: { size: '8Gi' } },
264
+ wordpress: { service: { type: 'LoadBalancer' } },
265
+ },
266
+ envValues: {
267
+ dev: { mysql: { persistence: { size: '5Gi' } } },
268
+ prod: { mysql: { persistence: { size: '20Gi' } } },
269
+ },
270
+ });
271
+
272
+ umbrella.write('dist/wordpress-stack');
273
+ ```
274
+
275
+ ### CLI for Umbrella Charts
276
+
277
+ ```bash
278
+ # Create umbrella structure
279
+ tl umbrella init my-stack
280
+
281
+ # Add subcharts
282
+ tl umbrella add database
283
+ tl umbrella add frontend
284
+
285
+ # Generate umbrella chart
286
+ tl umbrella synth ./dist
287
+ ```
288
+
164
289
  ## Examples
165
290
 
166
291
  The `examples/` directory contains complete working examples:
167
292
 
168
- - **aws-game-2048**: AWS 2048 game deployment with Service and Ingress
169
- - **wordpress**: WordPress with MySQL database setup
293
+ - **aws-game-2048**: Production-ready AWS 2048 game deployment showcasing AWS-specific features
294
+ - AWS ALB Ingress with health checks and SSL support
295
+ - HorizontalPodAutoscaler (HPA) for automatic scaling based on CPU utilization
296
+ - PodDisruptionBudget (PDB) for high availability during updates
297
+ - Multi-environment configuration (dev/staging/prod)
298
+ - **wordpress**: WordPress with MySQL database setup (single chart)
299
+ - **wordpress-umbrella**: WordPress stack using umbrella charts (MySQL + WordPress subcharts)
170
300
 
171
301
  Each example includes its own README with deployment instructions.
172
302
 
303
+ ### Umbrella Chart Example
304
+
305
+ See `examples/wordpress-umbrella/` for a complete umbrella chart implementation that
306
+ separates MySQL and WordPress into individual subcharts with proper dependencies,
307
+ shared values, and multi-environment support.
308
+
173
309
  - `valuesRef(path)`: returns a Helm placeholder string for `.Values.*`.
174
310
  - You can pass these strings directly into cdk8s constructs; they are preserved in the YAML.
175
311
  - `template(name, ctx='.')` and `include(name, ctx='.')`: inject calls to helpers defined in `_helpers.tpl`.
@@ -179,6 +315,120 @@ Each example includes its own README with deployment instructions.
179
315
  (`toString`, `float64`).
180
316
  - For numeric fields (ports, replicas), use literal values or template strings with proper casting.
181
317
 
318
+ ## AWS Multi-Cloud Support
319
+
320
+ Timonel provides comprehensive AWS-specific helpers for EKS deployments:
321
+
322
+ ### IRSA (IAM Roles for Service Accounts)
323
+
324
+ Securely access AWS services from Kubernetes pods using IAM roles:
325
+
326
+ ```typescript
327
+ // Dedicated IRSA ServiceAccount
328
+ rutter.addAWSIRSAServiceAccount({
329
+ name: 'app-s3-access',
330
+ roleArn: 'arn:aws:iam::123456789012:role/AppS3Role',
331
+ audience: 'sts.amazonaws.com', // optional, defaults to sts.amazonaws.com
332
+ stsEndpointType: 'regional', // recommended for better performance
333
+ tokenExpiration: 3600, // optional, token lifetime in seconds
334
+ });
335
+
336
+ // General ServiceAccount with IRSA support
337
+ rutter.addServiceAccount({
338
+ name: 'my-app-sa',
339
+ awsRoleArn: 'arn:aws:iam::123456789012:role/MyAppRole',
340
+ awsStsEndpointType: 'regional',
341
+ awsTokenExpiration: 7200,
342
+ automountServiceAccountToken: true,
343
+ });
344
+ ```
345
+
346
+ ### AWS Storage Classes
347
+
348
+ ```typescript
349
+ // EBS GP3 StorageClass
350
+ rutter.addAWSEBSStorageClass({
351
+ name: 'fast-ssd',
352
+ volumeType: 'gp3',
353
+ encrypted: true,
354
+ iops: 3000,
355
+ throughput: 125,
356
+ });
357
+
358
+ // EFS StorageClass for shared storage
359
+ rutter.addAWSEFSStorageClass({
360
+ name: 'shared-storage',
361
+ reclaimPolicy: 'Retain',
362
+ });
363
+ ```
364
+
365
+ ### AWS Load Balancer Controller
366
+
367
+ ```typescript
368
+ // ALB Ingress with health checks
369
+ rutter.addAWSALBIngress({
370
+ name: 'app-ingress',
371
+ scheme: 'internet-facing',
372
+ targetType: 'ip',
373
+ healthCheckPath: '/health',
374
+ certificateArn:
375
+ 'arn:aws:acm:us-west-2:123456789012:certificate/12345678-1234-1234-1234-123456789012',
376
+ rules: [
377
+ {
378
+ paths: [
379
+ {
380
+ path: '/',
381
+ pathType: 'Prefix',
382
+ backend: { service: { name: 'my-app', port: { number: 80 } } },
383
+ },
384
+ ],
385
+ },
386
+ ],
387
+ });
388
+ ```
389
+
390
+ ### AWS Secrets Manager and Parameter Store
391
+
392
+ Integrate with AWS Secrets Manager and Parameter Store using the Secrets Store CSI Driver:
393
+
394
+ ```typescript
395
+ // Secrets Manager integration
396
+ rutter.addAWSSecretProviderClass({
397
+ name: 'app-secrets',
398
+ region: 'us-west-2',
399
+ objects: [
400
+ {
401
+ objectName: 'prod/myapp/database',
402
+ objectType: 'secretsmanager',
403
+ objectAlias: 'db-credentials',
404
+ },
405
+ {
406
+ objectName: 'prod/myapp/api-keys',
407
+ objectType: 'secretsmanager',
408
+ jmesPath: '["api_key", "secret_key"]', // Extract specific keys from JSON
409
+ },
410
+ ],
411
+ });
412
+
413
+ // Parameter Store integration
414
+ rutter.addAWSSecretProviderClass({
415
+ name: 'app-config',
416
+ region: 'us-west-2',
417
+ objects: [
418
+ {
419
+ objectName: '/myapp/config/debug-mode',
420
+ objectType: 'ssmparameter',
421
+ objectAlias: 'debug-flag',
422
+ },
423
+ {
424
+ objectName: '/myapp/config/cache-ttl',
425
+ objectType: 'ssmparameter',
426
+ objectAlias: 'cache-timeout',
427
+ },
428
+ ],
429
+ });
430
+ ```
431
+
182
432
  ## Multi-environment values
183
433
 
184
434
  Provide `envValues` in the `Rutter` constructor to automatically create
@@ -204,9 +454,12 @@ Provide `envValues` in the `Rutter` constructor to automatically create
204
454
 
205
455
  ## Roadmap
206
456
 
207
- - Helpers for common patterns (HPA, auto-scaling)
457
+ - Auto-scaling helpers (HPA, VPA, PodDisruptionBudget)
458
+ - ✅ AWS multi-cloud support (EBS, EFS, ALB, IRSA, Secrets Manager, Parameter Store)
459
+ - ✅ Custom manifest naming and file organization
460
+ - Azure multi-cloud support (AKS-specific helpers)
461
+ - GCP multi-cloud support (GKE-specific helpers)
208
462
  - Richer CLI (resource generators, diff)
209
- - Enhanced multi-cloud support
210
463
  - Template validation and testing utilities
211
464
 
212
465
  ## Contributing