@jttc/projen-project-types 1.0.0-beta.1 → 1.0.0-beta.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.cz-config.js +8 -1
- package/.jsii +440 -5
- package/API.md +9621 -252
- package/README.md +186 -29
- package/docs/components/cdk8s.md +724 -0
- package/docs/index.md +74 -13
- package/docs/project-types/cdk-app.md +481 -0
- package/docs/project-types/cdk-library.md +16 -108
- package/docs/project-types/cdk8s-library.md +442 -0
- package/lib/cdk/cdk-app-project.d.ts +9 -0
- package/lib/cdk/cdk-app-project.js +27 -0
- package/lib/cdk/cdk-library-project.js +1 -1
- package/lib/cdk/cdk8s-library-project.d.ts +12 -0
- package/lib/cdk/cdk8s-library-project.js +37 -0
- package/lib/common/common-options.d.ts +1 -0
- package/lib/common/common-options.js +10 -3
- package/lib/components/cdk8s/cdk8s.d.ts +11 -0
- package/lib/components/cdk8s/cdk8s.js +98 -0
- package/lib/components/cdk8s/index.d.ts +2 -0
- package/lib/components/cdk8s/index.js +19 -0
- package/lib/components/cdk8s/interfaces/Cdk8s.d.ts +39 -0
- package/lib/components/cdk8s/interfaces/Cdk8s.js +12 -0
- package/lib/components/index.d.ts +1 -0
- package/lib/components/index.js +18 -0
- package/lib/index.d.ts +3 -0
- package/lib/index.js +4 -1
- package/mkdocs.yml +4 -0
- package/package.json +6 -6
|
@@ -57,31 +57,22 @@ project.synth();
|
|
|
57
57
|
|
|
58
58
|
## Features
|
|
59
59
|
|
|
60
|
-
###
|
|
60
|
+
### Common Configurations
|
|
61
61
|
|
|
62
|
-
|
|
62
|
+
This project type includes the same common configurations as other project types:
|
|
63
63
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
-
|
|
68
|
-
-
|
|
69
|
-
- **Semicolons** required
|
|
70
|
-
|
|
71
|
-
!!! tip "View Complete Configuration"
|
|
72
|
-
See the [Default Configurations](../default-configurations.md#prettier-configuration) page for the complete prettier setup and customization options.
|
|
73
|
-
|
|
74
|
-
### VSCode Integration
|
|
75
|
-
|
|
76
|
-
When enabled, the project automatically sets up VSCode configuration with settings and recommended extensions optimized for CDK development. For complete details about VSCode configuration, see [Default Configurations](../default-configurations.md#vscode-configuration).
|
|
64
|
+
!!! info "Default Configurations"
|
|
65
|
+
For complete details about Prettier and VSCode configurations, see [Default Configurations](../default-configurations.md). This includes:
|
|
66
|
+
|
|
67
|
+
- [Prettier Configuration](../default-configurations.md#prettier-configuration) - Code formatting rules and customization
|
|
68
|
+
- [VSCode Configuration](../default-configurations.md#vscode-configuration) - Editor settings and recommended extensions
|
|
77
69
|
|
|
78
|
-
|
|
70
|
+
### CDK-Specific Features
|
|
79
71
|
|
|
80
|
-
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
84
|
-
- Proper indentation and editor settings
|
|
72
|
+
- **AWS CDK Integration** with construct library setup
|
|
73
|
+
- **TypeScript configuration** optimized for CDK development
|
|
74
|
+
- **Publishing pipeline** ready for npm/JSR distribution
|
|
75
|
+
- **Testing setup** with Jest and CDK assertions
|
|
85
76
|
|
|
86
77
|
## Configuration Options
|
|
87
78
|
|
|
@@ -103,95 +94,12 @@ const project = new CdkLibrary({
|
|
|
103
94
|
});
|
|
104
95
|
```
|
|
105
96
|
|
|
106
|
-
###
|
|
107
|
-
|
|
108
|
-
#### Enable/Disable Prettier
|
|
109
|
-
|
|
110
|
-
```typescript linenums="1" title="Disable Prettier" hl_lines="3"
|
|
111
|
-
const project = new CdkLibrary({
|
|
112
|
-
// ... other options
|
|
113
|
-
prettier: false,
|
|
114
|
-
});
|
|
115
|
-
```
|
|
116
|
-
|
|
117
|
-
**Highlighted line explanation:**
|
|
118
|
-
|
|
119
|
-
- **Line 3**: Disables prettier entirely - no `.prettierrc.json` file will be created
|
|
120
|
-
|
|
121
|
-
#### Custom Prettier Options
|
|
122
|
-
|
|
123
|
-
```typescript linenums="1" title="Custom Prettier Configuration" hl_lines="5 6 7 8 9"
|
|
124
|
-
const project = new CdkLibrary({
|
|
125
|
-
// ... other options
|
|
126
|
-
prettier: true,
|
|
127
|
-
prettierOptions: {
|
|
128
|
-
settings: {
|
|
129
|
-
singleQuote: false,
|
|
130
|
-
semi: false,
|
|
131
|
-
tabWidth: 4,
|
|
132
|
-
trailingComma: 'none',
|
|
133
|
-
printWidth: 120,
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
});
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
**Highlighted lines explanation:**
|
|
140
|
-
|
|
141
|
-
- **Line 6**: Use double quotes instead of single quotes
|
|
142
|
-
- **Line 7**: Omit semicolons
|
|
143
|
-
- **Line 8**: Use 4 spaces for indentation instead of 2
|
|
144
|
-
- **Line 9**: No trailing commas
|
|
145
|
-
- **Line 10**: Allow longer lines (120 characters instead of 80)
|
|
146
|
-
|
|
147
|
-
### VSCode Configuration
|
|
148
|
-
|
|
149
|
-
#### Enable/Disable VSCode Setup
|
|
150
|
-
|
|
151
|
-
=== "Default Behavior (Recommended)"
|
|
152
|
-
|
|
153
|
-
```typescript linenums="1" title="VSCode Enabled by Default"
|
|
154
|
-
const project = new CdkLibrary({
|
|
155
|
-
// ... other options
|
|
156
|
-
// vscode: undefined (defaults to enabled)
|
|
157
|
-
});
|
|
158
|
-
```
|
|
159
|
-
|
|
160
|
-
=== "Explicitly Enable"
|
|
161
|
-
|
|
162
|
-
```typescript linenums="1" title="Explicitly Enable VSCode" hl_lines="3"
|
|
163
|
-
const project = new CdkLibrary({
|
|
164
|
-
// ... other options
|
|
165
|
-
vscode: true,
|
|
166
|
-
});
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
**Highlighted line explanation:**
|
|
170
|
-
|
|
171
|
-
- **Line 3**: Same as default behavior, but explicit
|
|
172
|
-
|
|
173
|
-
=== "Disable VSCode"
|
|
174
|
-
|
|
175
|
-
```typescript linenums="1" title="Disable VSCode Configuration" hl_lines="3"
|
|
176
|
-
const project = new CdkLibrary({
|
|
177
|
-
// ... other options
|
|
178
|
-
vscode: false,
|
|
179
|
-
});
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
**Highlighted line explanation:**
|
|
183
|
-
|
|
184
|
-
- **Line 3**: No `.vscode/` folder will be created
|
|
97
|
+
### Common Configuration Options
|
|
185
98
|
|
|
186
|
-
|
|
99
|
+
For Prettier and VSCode configuration options, refer to [Default Configurations](../default-configurations.md):
|
|
187
100
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
| `undefined` | `undefined` | ✅ Created | ✅ Created | Default behavior - both enabled |
|
|
191
|
-
| `true` | `true` | ✅ Created | ✅ Created | Explicitly enabled |
|
|
192
|
-
| `false` | `true` | ❌ Not created | ✅ Created | Only VSCode enabled |
|
|
193
|
-
| `true` | `false` | ✅ Created | ❌ Not created | Only Prettier enabled |
|
|
194
|
-
| `false` | `false` | ❌ Not created | ❌ Not created | Both disabled |
|
|
101
|
+
- **Prettier**: [Customization Guide](../default-configurations.md#customization)
|
|
102
|
+
- **VSCode**: [Configuration Options](../default-configurations.md#customization)
|
|
195
103
|
|
|
196
104
|
## Examples
|
|
197
105
|
|
|
@@ -0,0 +1,442 @@
|
|
|
1
|
+
# CDK8s Library Project
|
|
2
|
+
|
|
3
|
+
The CDK8s Library Project type provides an opinionated setup for creating AWS CDK construct libraries with CDK8s integration for Kubernetes deployment, combining best practices and common configurations.
|
|
4
|
+
|
|
5
|
+
## Overview
|
|
6
|
+
|
|
7
|
+
This project type extends the standard `AwsCdkConstructLibrary` from projen with additional CDK8s features:
|
|
8
|
+
|
|
9
|
+
- **CDK8s integration** for Kubernetes manifest generation
|
|
10
|
+
- **Multi-version Kubernetes support** (v1.29 to v1.33)
|
|
11
|
+
- **Prettier configuration** and **VSCode settings** - see [Default Configurations](../default-configurations.md)
|
|
12
|
+
- **Common project structure** and tooling setup
|
|
13
|
+
- **Configurable CDK8s options** for custom workflows
|
|
14
|
+
|
|
15
|
+
## Quick Start
|
|
16
|
+
|
|
17
|
+
To create a new CDK8s Library project, use the projen CLI:
|
|
18
|
+
|
|
19
|
+
```bash linenums="1"
|
|
20
|
+
npx projen new --from @jttc/projen-project-types cdk8s-library
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
This command will create a new project with the CDK8s Library template and prompt you for the required configuration options such as:
|
|
24
|
+
|
|
25
|
+
- Project name
|
|
26
|
+
- Author information
|
|
27
|
+
- Repository URL
|
|
28
|
+
- CDK version
|
|
29
|
+
- Kubernetes version
|
|
30
|
+
- Default branch
|
|
31
|
+
|
|
32
|
+
After the project is created, you can customize it further by editing the `.projenrc.ts` file:
|
|
33
|
+
|
|
34
|
+
```typescript linenums="1" title=".projenrc.ts" hl_lines="4 8 12 13 14 15"
|
|
35
|
+
import { Cdk8sLibrary } from '@jttc/projen-project-types';
|
|
36
|
+
import { K8sVersion } from '@jttc/projen-project-types';
|
|
37
|
+
|
|
38
|
+
const project = new Cdk8sLibrary({
|
|
39
|
+
name: 'my-awesome-cdk8s-library',
|
|
40
|
+
author: 'Your Name',
|
|
41
|
+
authorAddress: 'your.email@example.com',
|
|
42
|
+
repositoryUrl: 'https://github.com/yourusername/my-awesome-cdk8s-library.git',
|
|
43
|
+
cdkVersion: '2.1.0',
|
|
44
|
+
defaultReleaseBranch: 'main',
|
|
45
|
+
|
|
46
|
+
// CDK8s specific configuration
|
|
47
|
+
k8sVersion: K8sVersion.V1_31,
|
|
48
|
+
appPath: 'src/k8s',
|
|
49
|
+
outputPath: 'manifests',
|
|
50
|
+
imports: ['custom-k8s-constructs@1.0.0'],
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
project.synth();
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
**Highlighted lines explanation:**
|
|
57
|
+
|
|
58
|
+
- **Line 4**: Choose a descriptive name for your CDK8s construct library
|
|
59
|
+
- **Line 8**: Pin to a specific CDK version for consistency
|
|
60
|
+
- **Line 13**: Set the Kubernetes version for CDK8s imports
|
|
61
|
+
- **Line 14**: Configure custom path for Kubernetes source code
|
|
62
|
+
- **Line 15**: Set output directory for generated manifests
|
|
63
|
+
- **Line 16**: Add custom Kubernetes imports
|
|
64
|
+
|
|
65
|
+
## Features
|
|
66
|
+
|
|
67
|
+
### CDK8s Integration
|
|
68
|
+
|
|
69
|
+
The CDK8s Library project includes full CDK8s integration with:
|
|
70
|
+
|
|
71
|
+
- **Automatic CDK8s setup** with configurable Kubernetes versions
|
|
72
|
+
- **Import generation** from Kubernetes APIs and custom resources
|
|
73
|
+
- **TypeScript-first** Kubernetes manifest authoring
|
|
74
|
+
- **CDK8s tasks** for building and synthesizing manifests
|
|
75
|
+
|
|
76
|
+
### Kubernetes Version Support
|
|
77
|
+
|
|
78
|
+
Choose from multiple supported Kubernetes versions:
|
|
79
|
+
|
|
80
|
+
| Version | CDK8s Plus Package | Description |
|
|
81
|
+
|---------|-------------------|-------------|
|
|
82
|
+
| v1.29 | `cdk8s-plus-29` | Kubernetes 1.29 API support |
|
|
83
|
+
| v1.30 | `cdk8s-plus-30` | Kubernetes 1.30 API support (default) |
|
|
84
|
+
| v1.31 | `cdk8s-plus-31` | Kubernetes 1.31 API support |
|
|
85
|
+
| v1.32 | `cdk8s-plus-32` | Kubernetes 1.32 API support |
|
|
86
|
+
| v1.33 | `cdk8s-plus-33` | Kubernetes 1.33 API support |
|
|
87
|
+
|
|
88
|
+
### Common Configurations
|
|
89
|
+
|
|
90
|
+
This project type includes the same common configurations as other project types:
|
|
91
|
+
|
|
92
|
+
!!! info "Default Configurations"
|
|
93
|
+
For complete details about Prettier and VSCode configurations, see [Default Configurations](../default-configurations.md). This includes:
|
|
94
|
+
|
|
95
|
+
- [Prettier Configuration](../default-configurations.md#prettier-configuration) - Code formatting rules and customization
|
|
96
|
+
- [VSCode Configuration](../default-configurations.md#vscode-configuration) - Editor settings and recommended extensions
|
|
97
|
+
|
|
98
|
+
## Configuration Options
|
|
99
|
+
|
|
100
|
+
### Basic Configuration
|
|
101
|
+
|
|
102
|
+
All standard `AwsCdkConstructLibraryOptions` are supported, plus CDK8s-specific options:
|
|
103
|
+
|
|
104
|
+
```typescript linenums="1" title="Basic CDK8s Library Configuration"
|
|
105
|
+
const project = new Cdk8sLibrary({
|
|
106
|
+
// Required CDK options
|
|
107
|
+
name: 'my-cdk8s-library',
|
|
108
|
+
author: 'Your Name',
|
|
109
|
+
authorAddress: 'your.email@example.com',
|
|
110
|
+
repositoryUrl: 'https://github.com/yourusername/my-cdk8s-library.git',
|
|
111
|
+
cdkVersion: '2.1.0',
|
|
112
|
+
defaultReleaseBranch: 'main',
|
|
113
|
+
|
|
114
|
+
// Optional CDK8s configurations (see sections below)
|
|
115
|
+
});
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
### CDK8s-Specific Options
|
|
119
|
+
|
|
120
|
+
#### Kubernetes Version
|
|
121
|
+
|
|
122
|
+
```typescript linenums="1" title="Kubernetes Version Configuration" hl_lines="3"
|
|
123
|
+
import { K8sVersion } from '@jttc/projen-project-types';
|
|
124
|
+
|
|
125
|
+
const project = new Cdk8sLibrary({
|
|
126
|
+
// ... other options
|
|
127
|
+
k8sVersion: K8sVersion.V1_31, // Default: V1_30
|
|
128
|
+
});
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
#### Custom Paths
|
|
132
|
+
|
|
133
|
+
Configure where CDK8s files are located:
|
|
134
|
+
|
|
135
|
+
```typescript linenums="1" title="Custom Path Configuration" hl_lines="3 4 5"
|
|
136
|
+
const project = new Cdk8sLibrary({
|
|
137
|
+
// ... other options
|
|
138
|
+
appPath: 'src/k8s', // Default: 'src'
|
|
139
|
+
appFile: 'app.ts', // Default: 'main.ts'
|
|
140
|
+
outputPath: 'manifests', // Default: 'kubernetes'
|
|
141
|
+
});
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
#### Custom Imports
|
|
145
|
+
|
|
146
|
+
Add additional Kubernetes resource imports:
|
|
147
|
+
|
|
148
|
+
```typescript linenums="1" title="Custom Imports Configuration" hl_lines="3 4 5 6"
|
|
149
|
+
const project = new Cdk8sLibrary({
|
|
150
|
+
// ... other options
|
|
151
|
+
imports: [
|
|
152
|
+
'cert-manager@v1.8.0',
|
|
153
|
+
'prometheus-operator@v0.60.0',
|
|
154
|
+
'custom-crds@latest',
|
|
155
|
+
],
|
|
156
|
+
});
|
|
157
|
+
```
|
|
158
|
+
|
|
159
|
+
### Common Configuration Options
|
|
160
|
+
|
|
161
|
+
For Prettier and VSCode configuration options, refer to [Default Configurations](../default-configurations.md):
|
|
162
|
+
|
|
163
|
+
- **Prettier**: [Customization Guide](../default-configurations.md#customization)
|
|
164
|
+
- **VSCode**: [Configuration Options](../default-configurations.md#customization)
|
|
165
|
+
|
|
166
|
+
## Examples
|
|
167
|
+
|
|
168
|
+
### Basic CDK8s Library
|
|
169
|
+
|
|
170
|
+
Simple setup with default configurations:
|
|
171
|
+
|
|
172
|
+
```typescript linenums="1" title=".projenrc.ts - Basic Setup"
|
|
173
|
+
import { Cdk8sLibrary } from '@jttc/projen-project-types';
|
|
174
|
+
|
|
175
|
+
const project = new Cdk8sLibrary({
|
|
176
|
+
name: 'basic-cdk8s-library',
|
|
177
|
+
author: 'Jane Smith',
|
|
178
|
+
authorAddress: 'jane@company.com',
|
|
179
|
+
repositoryUrl: 'https://github.com/company/basic-cdk8s-library.git',
|
|
180
|
+
cdkVersion: '2.1.0',
|
|
181
|
+
defaultReleaseBranch: 'main',
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
project.synth();
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
### Advanced CDK8s Library
|
|
188
|
+
|
|
189
|
+
Customized setup with specific Kubernetes version and custom paths:
|
|
190
|
+
|
|
191
|
+
```typescript linenums="1" title=".projenrc.ts - Advanced Setup" hl_lines="10 11 12 13 14 15 16 17 18 19"
|
|
192
|
+
import { Cdk8sLibrary, K8sVersion } from '@jttc/projen-project-types';
|
|
193
|
+
|
|
194
|
+
const project = new Cdk8sLibrary({
|
|
195
|
+
name: 'advanced-cdk8s-library',
|
|
196
|
+
author: 'John Developer',
|
|
197
|
+
authorAddress: 'john@company.com',
|
|
198
|
+
repositoryUrl: 'https://github.com/company/advanced-cdk8s-library.git',
|
|
199
|
+
cdkVersion: '2.1.0',
|
|
200
|
+
defaultReleaseBranch: 'main',
|
|
201
|
+
|
|
202
|
+
// CDK8s customization
|
|
203
|
+
k8sVersion: K8sVersion.V1_31,
|
|
204
|
+
appPath: 'src/kubernetes',
|
|
205
|
+
appFile: 'main.ts',
|
|
206
|
+
outputPath: 'dist/manifests',
|
|
207
|
+
imports: [
|
|
208
|
+
'cert-manager@v1.13.0',
|
|
209
|
+
'prometheus-operator@v0.70.0',
|
|
210
|
+
],
|
|
211
|
+
|
|
212
|
+
// Standard configurations (see Default Configurations for options)
|
|
213
|
+
prettier: true,
|
|
214
|
+
vscode: true,
|
|
215
|
+
});
|
|
216
|
+
|
|
217
|
+
project.synth();
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
**Highlighted lines explanation:**
|
|
221
|
+
|
|
222
|
+
- **Line 12**: Use Kubernetes v1.31 APIs
|
|
223
|
+
- **Line 13**: Place CDK8s source files in `src/kubernetes/`
|
|
224
|
+
- **Line 14**: Main entry file for CDK8s application
|
|
225
|
+
- **Line 15**: Output generated manifests to `dist/manifests/`
|
|
226
|
+
- **Lines 16-19**: Import cert-manager and Prometheus operator CRDs
|
|
227
|
+
|
|
228
|
+
### Enterprise Setup
|
|
229
|
+
|
|
230
|
+
Example with minimal prettier configuration and disabled VSCode:
|
|
231
|
+
|
|
232
|
+
```typescript linenums="1" title=".projenrc.ts - Enterprise Setup" hl_lines="11 15 16 17 18 19 20 21"
|
|
233
|
+
import { Cdk8sLibrary, K8sVersion } from '@jttc/projen-project-types';
|
|
234
|
+
|
|
235
|
+
const project = new Cdk8sLibrary({
|
|
236
|
+
name: 'enterprise-cdk8s-library',
|
|
237
|
+
author: 'Enterprise Team',
|
|
238
|
+
authorAddress: 'team@enterprise.com',
|
|
239
|
+
repositoryUrl: 'https://github.com/enterprise/cdk8s-library.git',
|
|
240
|
+
cdkVersion: '2.1.0',
|
|
241
|
+
defaultReleaseBranch: 'main',
|
|
242
|
+
|
|
243
|
+
k8sVersion: K8sVersion.V1_32,
|
|
244
|
+
|
|
245
|
+
// Custom configurations (see Default Configurations for more options)
|
|
246
|
+
vscode: false,
|
|
247
|
+
prettierOptions: {
|
|
248
|
+
settings: {
|
|
249
|
+
printWidth: 120,
|
|
250
|
+
tabWidth: 4,
|
|
251
|
+
singleQuote: false,
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
});
|
|
255
|
+
|
|
256
|
+
project.synth();
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
**Highlighted lines explanation:**
|
|
260
|
+
|
|
261
|
+
- **Line 11**: Use latest supported Kubernetes version
|
|
262
|
+
- **Line 15**: Disable VSCode configuration for enterprise environment
|
|
263
|
+
- **Lines 16-21**: Custom prettier settings with longer lines and double quotes
|
|
264
|
+
|
|
265
|
+
## Project Structure
|
|
266
|
+
|
|
267
|
+
After running `projen synth`, your CDK8s library project will have the following structure:
|
|
268
|
+
|
|
269
|
+
```
|
|
270
|
+
my-cdk8s-library/
|
|
271
|
+
├── src/
|
|
272
|
+
│ ├── main.ts # Main CDK8s application entry point
|
|
273
|
+
│ └── index.ts # Library exports
|
|
274
|
+
├── test/ # Test files
|
|
275
|
+
├── kubernetes/ # Generated Kubernetes manifests (after synth)
|
|
276
|
+
├── cdk8s.yaml # CDK8s configuration
|
|
277
|
+
├── package.json # Dependencies including CDK8s packages
|
|
278
|
+
├── .prettierrc.json # Code formatting configuration
|
|
279
|
+
├── .vscode/ # VSCode workspace settings
|
|
280
|
+
│ ├── settings.json
|
|
281
|
+
│ └── extensions.json
|
|
282
|
+
└── .projenrc.ts # Projen configuration
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
### Generated CDK8s Files
|
|
286
|
+
|
|
287
|
+
- **`src/main.ts`**: Sample CDK8s application with basic Kubernetes resources
|
|
288
|
+
- **`cdk8s.yaml`**: CDK8s configuration specifying app entry point and output location
|
|
289
|
+
- **`kubernetes/`**: Directory where synthesized YAML manifests are generated
|
|
290
|
+
|
|
291
|
+
### CDK8s Tasks
|
|
292
|
+
|
|
293
|
+
The project includes these npm scripts for CDK8s workflows:
|
|
294
|
+
|
|
295
|
+
| Script | Command | Description |
|
|
296
|
+
|--------|---------|-------------|
|
|
297
|
+
| `cdk8s` | `cdk8s synth` | Generate Kubernetes manifests |
|
|
298
|
+
| `cdk8s:import` | `cdk8s import` | Import Kubernetes APIs and CRDs |
|
|
299
|
+
| `cdk8s:synth` | `cdk8s synth` | Alias for `cdk8s` command |
|
|
300
|
+
|
|
301
|
+
## Best Practices
|
|
302
|
+
|
|
303
|
+
### Development Workflow
|
|
304
|
+
|
|
305
|
+
1. **Define your constructs** in TypeScript using CDK8s APIs
|
|
306
|
+
2. **Import CRDs** for custom resources: `npm run cdk8s:import`
|
|
307
|
+
3. **Generate manifests** regularly: `npm run cdk8s`
|
|
308
|
+
4. **Test generated YAML** with your Kubernetes cluster
|
|
309
|
+
5. **Version your library** using standard npm/projen publishing
|
|
310
|
+
|
|
311
|
+
### Resource Organization
|
|
312
|
+
|
|
313
|
+
```typescript linenums="1" title="src/main.ts - Recommended Structure"
|
|
314
|
+
import { App, Chart } from 'cdk8s';
|
|
315
|
+
import { Deployment, Service } from 'cdk8s-plus-31';
|
|
316
|
+
|
|
317
|
+
export class MyConstruct extends Chart {
|
|
318
|
+
constructor(scope: App, id: string) {
|
|
319
|
+
super(scope, id);
|
|
320
|
+
|
|
321
|
+
// Define your Kubernetes resources here
|
|
322
|
+
const deployment = new Deployment(this, 'app-deployment', {
|
|
323
|
+
// ... configuration
|
|
324
|
+
});
|
|
325
|
+
|
|
326
|
+
const service = new Service(this, 'app-service', {
|
|
327
|
+
// ... configuration
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
// For library usage
|
|
333
|
+
const app = new App();
|
|
334
|
+
new MyConstruct(app, 'my-construct');
|
|
335
|
+
app.synth();
|
|
336
|
+
```
|
|
337
|
+
|
|
338
|
+
### Testing Strategy
|
|
339
|
+
|
|
340
|
+
- **Unit test** your CDK8s constructs with Jest
|
|
341
|
+
- **Snapshot test** generated manifests
|
|
342
|
+
- **Integration test** with real Kubernetes clusters
|
|
343
|
+
- **Validate** YAML output with kubeval or similar tools
|
|
344
|
+
|
|
345
|
+
## Troubleshooting
|
|
346
|
+
|
|
347
|
+
### Common Issues
|
|
348
|
+
|
|
349
|
+
#### Import Errors
|
|
350
|
+
|
|
351
|
+
If you encounter CDK8s import errors:
|
|
352
|
+
|
|
353
|
+
```bash
|
|
354
|
+
# Reimport Kubernetes APIs
|
|
355
|
+
npm run cdk8s:import
|
|
356
|
+
|
|
357
|
+
# Check your cdk8s.yaml configuration
|
|
358
|
+
cat cdk8s.yaml
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
#### Version Mismatches
|
|
362
|
+
|
|
363
|
+
Ensure your Kubernetes version matches your cluster:
|
|
364
|
+
|
|
365
|
+
```typescript
|
|
366
|
+
// Update in .projenrc.ts
|
|
367
|
+
k8sVersion: K8sVersion.V1_31, // Match your cluster version
|
|
368
|
+
```
|
|
369
|
+
|
|
370
|
+
#### Path Issues
|
|
371
|
+
|
|
372
|
+
Verify your CDK8s paths are correctly configured:
|
|
373
|
+
|
|
374
|
+
```yaml title="cdk8s.yaml"
|
|
375
|
+
language: typescript
|
|
376
|
+
app: npx ts-node src/main.ts
|
|
377
|
+
output: kubernetes
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
### Getting Help
|
|
381
|
+
|
|
382
|
+
- **CDK8s Documentation**: [https://cdk8s.io/](https://cdk8s.io/)
|
|
383
|
+
- **Project Issues**: [GitHub Issues](https://github.com/JumpToTheCloud/projen-project-types/issues)
|
|
384
|
+
- **AWS CDK**: [https://docs.aws.amazon.com/cdk/](https://docs.aws.amazon.com/cdk/)
|
|
385
|
+
|
|
386
|
+
## Migration Guide
|
|
387
|
+
|
|
388
|
+
### From Standard CDK Library
|
|
389
|
+
|
|
390
|
+
To migrate from a standard CDK library to CDK8s library:
|
|
391
|
+
|
|
392
|
+
1. **Update your `.projenrc.ts`**:
|
|
393
|
+
```typescript
|
|
394
|
+
// Before
|
|
395
|
+
import { CdkLibrary } from '@jttc/projen-project-types';
|
|
396
|
+
|
|
397
|
+
// After
|
|
398
|
+
import { Cdk8sLibrary } from '@jttc/projen-project-types';
|
|
399
|
+
```
|
|
400
|
+
|
|
401
|
+
2. **Add CDK8s configuration**:
|
|
402
|
+
```typescript
|
|
403
|
+
const project = new Cdk8sLibrary({
|
|
404
|
+
// ... existing options
|
|
405
|
+
k8sVersion: K8sVersion.V1_31,
|
|
406
|
+
});
|
|
407
|
+
```
|
|
408
|
+
|
|
409
|
+
3. **Run projen to regenerate**:
|
|
410
|
+
```bash
|
|
411
|
+
npx projen
|
|
412
|
+
```
|
|
413
|
+
|
|
414
|
+
### From Plain CDK8s
|
|
415
|
+
|
|
416
|
+
To adopt this project type from a plain CDK8s project:
|
|
417
|
+
|
|
418
|
+
1. **Install the package**:
|
|
419
|
+
```bash
|
|
420
|
+
npm install --save-dev @jttc/projen-project-types
|
|
421
|
+
```
|
|
422
|
+
|
|
423
|
+
2. **Create `.projenrc.ts`** with your current configuration
|
|
424
|
+
3. **Run projen** to apply the project template
|
|
425
|
+
4. **Review and commit** the generated configuration files
|
|
426
|
+
|
|
427
|
+
## Contributing
|
|
428
|
+
|
|
429
|
+
Contributions to improve the CDK8s Library project type are welcome! Please check the repository for details on:
|
|
430
|
+
|
|
431
|
+
- Reporting bugs
|
|
432
|
+
- Suggesting enhancements
|
|
433
|
+
- Submitting pull requests
|
|
434
|
+
- Development workflow
|
|
435
|
+
|
|
436
|
+
## Support
|
|
437
|
+
|
|
438
|
+
For support with the CDK8s Library project type:
|
|
439
|
+
|
|
440
|
+
- **Repository**: [GitHub Repository](https://github.com/JumpToTheCloud/projen-project-types)
|
|
441
|
+
- **Issues**: [GitHub Issues](https://github.com/JumpToTheCloud/projen-project-types/issues)
|
|
442
|
+
- **Discussions**: [GitHub Discussions](https://github.com/JumpToTheCloud/projen-project-types/discussions)
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AwsCdkTypeScriptApp, AwsCdkTypeScriptAppOptions } from 'projen/lib/awscdk';
|
|
2
|
+
/**
|
|
3
|
+
* CDK TypeScript App Project
|
|
4
|
+
*
|
|
5
|
+
* @pjid cdk-app
|
|
6
|
+
*/
|
|
7
|
+
export declare class CdkApp extends AwsCdkTypeScriptApp {
|
|
8
|
+
constructor(options: AwsCdkTypeScriptAppOptions);
|
|
9
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CdkApp = void 0;
|
|
5
|
+
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
6
|
+
const awscdk_1 = require("projen/lib/awscdk");
|
|
7
|
+
const common_options_1 = require("../common/common-options");
|
|
8
|
+
/**
|
|
9
|
+
* CDK TypeScript App Project
|
|
10
|
+
*
|
|
11
|
+
* @pjid cdk-app
|
|
12
|
+
*/
|
|
13
|
+
class CdkApp extends awscdk_1.AwsCdkTypeScriptApp {
|
|
14
|
+
constructor(options) {
|
|
15
|
+
const opts = common_options_1.CommonOptionsConfig.withCommonOptionsDefaults({
|
|
16
|
+
...options,
|
|
17
|
+
});
|
|
18
|
+
super({
|
|
19
|
+
...opts,
|
|
20
|
+
});
|
|
21
|
+
common_options_1.CommonOptionsConfig.withCommonComponents(this, opts);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
exports.CdkApp = CdkApp;
|
|
25
|
+
_a = JSII_RTTI_SYMBOL_1;
|
|
26
|
+
CdkApp[_a] = { fqn: "@jttc/projen-project-types.CdkApp", version: "1.0.0-beta.3" };
|
|
27
|
+
//# sourceMapping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29uZmlnLndpdGhDb21tb25PcHRpb25zRGVmYXVsdHMoe1xuICAgICAgLi4ub3B0aW9ucyxcbiAgICB9KTtcbiAgICBzdXBlcih7XG4gICAgICAuLi5vcHRzLFxuICAgIH0pO1xuICAgIENvbW1vbk9wdGlvbnNDb25maWcud2l0aENvbW1vbkNvbXBvbmVudHModGhpcywgb3B0cyk7XG4gIH1cbn1cbiJdfQ==
|
|
@@ -23,5 +23,5 @@ class CdkLibrary extends awscdk_1.AwsCdkConstructLibrary {
|
|
|
23
23
|
}
|
|
24
24
|
exports.CdkLibrary = CdkLibrary;
|
|
25
25
|
_a = JSII_RTTI_SYMBOL_1;
|
|
26
|
-
CdkLibrary[_a] = { fqn: "@jttc/projen-project-types.CdkLibrary", version: "1.0.0-beta.
|
|
26
|
+
CdkLibrary[_a] = { fqn: "@jttc/projen-project-types.CdkLibrary", version: "1.0.0-beta.3" };
|
|
27
27
|
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2RrLWxpYnJhcnktcHJvamVjdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jZGsvY2RrLWxpYnJhcnktcHJvamVjdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7OztBQUFBLDhDQUcyQjtBQUMzQiw2REFBK0Q7QUFFL0Q7Ozs7R0FJRztBQUNILE1BQWEsVUFBVyxTQUFRLCtCQUFzQjtJQUNwRCxZQUFZLE9BQXNDO1FBQ2hELE1BQU0sSUFBSSxHQUFHLG9DQUFtQixDQUFDLHlCQUF5QixDQUFDO1lBQ3pELEdBQUcsT0FBTztTQUNYLENBQUMsQ0FBQztRQUNILEtBQUssQ0FBQztZQUNKLEdBQUcsSUFBSTtTQUNSLENBQUMsQ0FBQztRQUNILG9DQUFtQixDQUFDLG9CQUFvQixDQUFDLElBQUksRUFBRSxJQUFJLENBQUMsQ0FBQztJQUN2RCxDQUFDOztBQVRILGdDQVVDIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHtcbiAgQXdzQ2RrQ29uc3RydWN0TGlicmFyeSxcbiAgQXdzQ2RrQ29uc3RydWN0TGlicmFyeU9wdGlvbnMsXG59IGZyb20gJ3Byb2plbi9saWIvYXdzY2RrJztcbmltcG9ydCB7IENvbW1vbk9wdGlvbnNDb25maWcgfSBmcm9tICcuLi9jb21tb24vY29tbW9uLW9wdGlvbnMnO1xuXG4vKipcbiAqIENESyBDb25zdHJ1Y3QgTGlicmFyeSBQcm9qZWN0XG4gKlxuICogQHBqaWQgY2RrLWxpYnJhcnlcbiAqL1xuZXhwb3J0IGNsYXNzIENka0xpYnJhcnkgZXh0ZW5kcyBBd3NDZGtDb25zdHJ1Y3RMaWJyYXJ5IHtcbiAgY29uc3RydWN0b3Iob3B0aW9uczogQXdzQ2RrQ29uc3RydWN0TGlicmFyeU9wdGlvbnMpIHtcbiAgICBjb25zdCBvcHRzID0gQ29tbW9uT3B0aW9uc0NvbmZpZy53aXRoQ29tbW9uT3B0aW9uc0RlZmF1bHRzKHtcbiAgICAgIC4uLm9wdGlvbnMsXG4gICAgfSk7XG4gICAgc3VwZXIoe1xuICAgICAgLi4ub3B0cyxcbiAgICB9KTtcbiAgICBDb21tb25PcHRpb25zQ29uZmlnLndpdGhDb21tb25Db21wb25lbnRzKHRoaXMsIG9wdHMpO1xuICB9XG59XG4iXX0=
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AwsCdkConstructLibrary } from 'projen/lib/awscdk';
|
|
2
|
+
import { Cdk8sComponent, Cdk8sLibraryOptions } from '../components';
|
|
3
|
+
/**
|
|
4
|
+
* CDK Construct Library Project
|
|
5
|
+
*
|
|
6
|
+
* @pjid cdk8s-library
|
|
7
|
+
*/
|
|
8
|
+
export declare class Cdk8sLibrary extends AwsCdkConstructLibrary {
|
|
9
|
+
readonly cdk8s: Cdk8sComponent;
|
|
10
|
+
constructor(options: Cdk8sLibraryOptions);
|
|
11
|
+
postSynthesize(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Cdk8sLibrary = void 0;
|
|
5
|
+
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
6
|
+
const child_process_1 = require("child_process");
|
|
7
|
+
const awscdk_1 = require("projen/lib/awscdk");
|
|
8
|
+
const common_options_1 = require("../common/common-options");
|
|
9
|
+
const components_1 = require("../components");
|
|
10
|
+
/**
|
|
11
|
+
* CDK Construct Library Project
|
|
12
|
+
*
|
|
13
|
+
* @pjid cdk8s-library
|
|
14
|
+
*/
|
|
15
|
+
class Cdk8sLibrary extends awscdk_1.AwsCdkConstructLibrary {
|
|
16
|
+
constructor(options) {
|
|
17
|
+
const opts = common_options_1.CommonOptionsConfig.withCommonOptionsDefaults({
|
|
18
|
+
...options,
|
|
19
|
+
});
|
|
20
|
+
super(opts);
|
|
21
|
+
this.cdk8s = new components_1.Cdk8sComponent(this, 'cdk8s-component', opts);
|
|
22
|
+
this.addDeps('constructs@^10.4.2');
|
|
23
|
+
common_options_1.CommonOptionsConfig.withCommonComponents(this, opts);
|
|
24
|
+
}
|
|
25
|
+
postSynthesize() {
|
|
26
|
+
const cdk8sImportTask = this.tasks.tryFind('cdk8s:import');
|
|
27
|
+
if (cdk8sImportTask) {
|
|
28
|
+
(0, child_process_1.execSync)(this.runTaskCommand(cdk8sImportTask), {
|
|
29
|
+
cwd: this.outdir,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.Cdk8sLibrary = Cdk8sLibrary;
|
|
35
|
+
_a = JSII_RTTI_SYMBOL_1;
|
|
36
|
+
Cdk8sLibrary[_a] = { fqn: "@jttc/projen-project-types.Cdk8sLibrary", version: "1.0.0-beta.3" };
|
|
37
|
+
//# sourceMappingURL=data:application/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