@bluedynamics/cdk8s-plone 0.1.5 → 0.1.6

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 (37) hide show
  1. package/.jsii +3 -3
  2. package/CLAUDE.md +352 -0
  3. package/README.md +55 -179
  4. package/documentation/Makefile +357 -0
  5. package/documentation/README.md +284 -0
  6. package/documentation/mx.ini +3 -0
  7. package/documentation/sources/_static/brand-theme.css +685 -0
  8. package/documentation/sources/_static/custom-icons.css +123 -0
  9. package/documentation/sources/_static/fonts/hack/Hack-Regular.woff2 +0 -0
  10. package/documentation/sources/_static/fonts/orbitron/Orbitron-Black.woff2 +11 -0
  11. package/documentation/sources/_static/fonts/orbitron/Orbitron-Bold.woff2 +11 -0
  12. package/documentation/sources/_static/fonts/orbitron/Orbitron-Regular.woff2 +0 -0
  13. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-Bold.woff2 +11 -0
  14. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-Medium.woff2 +11 -0
  15. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-Regular.woff2 +11 -0
  16. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-SemiBold.woff2 +11 -0
  17. package/documentation/sources/_static/kup6s-icon-explanation.svg +32 -0
  18. package/documentation/sources/_static/kup6s-icon-howto.svg +34 -0
  19. package/documentation/sources/_static/kup6s-icon-plone.svg +79 -0
  20. package/documentation/sources/_static/kup6s-icon-reference.svg +34 -0
  21. package/documentation/sources/_static/kup6s-icon-tutorials.svg +30 -0
  22. package/documentation/sources/_static/logo-fix.js +12 -0
  23. package/documentation/sources/conf.py +105 -0
  24. package/documentation/sources/explanation/architecture.md +311 -0
  25. package/documentation/sources/explanation/features.md +353 -0
  26. package/documentation/sources/explanation/index.md +51 -0
  27. package/documentation/sources/how-to/index.md +56 -0
  28. package/documentation/sources/how-to/setup-prerequisites.md +354 -0
  29. package/documentation/sources/index.md +108 -0
  30. package/documentation/sources/reference/api/.gitkeep +1 -0
  31. package/documentation/sources/reference/configuration-options.md +370 -0
  32. package/documentation/sources/reference/index.md +59 -0
  33. package/documentation/sources/tutorials/01-quick-start.md +157 -0
  34. package/documentation/sources/tutorials/index.md +48 -0
  35. package/lib/httpcache.js +1 -1
  36. package/lib/plone.js +1 -1
  37. package/package.json +1 -1
package/.jsii CHANGED
@@ -108,7 +108,7 @@
108
108
  },
109
109
  "name": "@bluedynamics/cdk8s-plone",
110
110
  "readme": {
111
- "markdown": "# CDK8S Plone\n\nA CDK8S library for deploying Plone CMS to Kubernetes.\n\nThis library provides constructs to bootstrap a Plone deployment on a Kubernetes cluster using the [CDK8S](https://cdk8s.io) framework.\n\n## Features\n\n- **Backend**: Plone backend (API with `plone.volto` or Classic-UI)\n- **Frontend**: Plone Volto (modern React-based user interface)\n- **Varnish Caching**: Optional HTTP caching layer using [kube-httpcache](https://github.com/mittwald/kube-httpcache) with cluster-wide cache invalidation\n- **High Availability**: Configurable replicas with PodDisruptionBudgets\n- **Multi-language Support**: Published to npm (TypeScript/JavaScript) and PyPI (Python)\n\n\n## Installation\n\n### TypeScript/JavaScript\n\nCreate a new CDK8S project (or use an existing one):\n\n```bash\ncdk8s init typescript-app\n```\n\nInstall the library:\n\n```bash\nnpm install @bluedynamics/cdk8s-plone\n```\n\nPackage: [@bluedynamics/cdk8s-plone](https://www.npmjs.com/package/@bluedynamics/cdk8s-plone)\n\n### Python\n\nCreate a new CDK8S project:\n\n```bash\ncdk8s init python-app\n```\n\nInstall the library:\n\n```bash\npip install cdk8s-plone\n```\n\nPackage: [cdk8s-plone](https://pypi.org/project/cdk8s-plone/)\n\n\n## Quick Start\n\n### Basic Plone Deployment\n\n```typescript\nimport { App, Chart } from 'cdk8s';\nimport { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';\n\nconst app = new App();\nconst chart = new Chart(app, 'PloneDeployment');\n\nnew Plone(chart, 'my-plone', {\n variant: PloneVariant.VOLTO,\n backend: {\n image: 'plone/plone-backend:6.0.10',\n replicas: 3,\n },\n frontend: {\n image: 'plone/plone-frontend:16.0.0',\n replicas: 2,\n },\n});\n\napp.synth();\n```\n\n### With Varnish HTTP Cache\n\n```typescript\nimport { PloneHttpcache } from '@bluedynamics/cdk8s-plone';\n\nconst plone = new Plone(chart, 'my-plone', {\n variant: PloneVariant.VOLTO,\n backend: { image: 'plone/plone-backend:6.0.10' },\n frontend: { image: 'plone/plone-frontend:16.0.0' },\n});\n\nnew PloneHttpcache(chart, 'cache', {\n plone: plone,\n existingSecret: 'varnish-secret',\n replicas: 2,\n});\n```\n\n### Generate Kubernetes Manifests\n\n```bash\ncdk8s synth\n```\n\nThe manifests are stored in the `dist/` directory.\n\nFor a complete example, see the [example project](https://github.com/bluedynamics/cdk8s-plone-example).\n\n## Prerequisites\n\n- **kubectl** - Command-line tool for deploying Kubernetes manifests. [Install kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)\n- **Helm** (optional) - Only needed if generating Helm charts. [Install Helm](https://helm.sh/docs/intro/install/)\n- **Node.js** - For TypeScript/JavaScript development\n- **Python 3.8+** - For Python development\n\n\n## API Documentation\n\nFor complete API documentation, see [API.md](./API.md).\n\n### Key Constructs\n\n#### `Plone`\n\nMain construct for deploying Plone CMS. Supports two variants:\n- **VOLTO**: Modern React frontend with REST API backend (default)\n- **CLASSICUI**: Traditional server-side rendered Plone\n\nProperties:\n- `backendServiceName` - Name of the backend Kubernetes service\n- `frontendServiceName` - Name of the frontend service (VOLTO only)\n- `variant` - Deployment variant (VOLTO or CLASSICUI)\n- `siteId` - Plone site ID in ZODB (default: 'Plone')\n\n#### `PloneHttpcache`\n\nVarnish HTTP caching layer using the [kube-httpcache](https://github.com/mittwald/kube-httpcache) Helm chart.\n\nProperties:\n- `httpcacheServiceName` - Name of the Varnish service\n\n### Configuration Options\n\n#### `PloneOptions`\n\n- `version` - Version of your project\n- `siteId` - Plone site ID (default: 'Plone')\n- `variant` - PloneVariant.VOLTO or PloneVariant.CLASSICUI (default: VOLTO)\n- `backend` - Backend configuration (PloneBaseOptions)\n- `frontend` - Frontend configuration (PloneBaseOptions, required for VOLTO)\n- `imagePullSecrets` - Image pull secrets for private registries\n\n#### `PloneBaseOptions`\n\nConfiguration for backend or frontend:\n\n**Container:**\n- `image` - Container image (e.g., 'plone/plone-backend:6.0.10')\n- `imagePullPolicy` - Pull policy (default: 'IfNotPresent')\n- `replicas` - Number of replicas (default: 2)\n- `environment` - Environment variables (cdk8s-plus-30.Env)\n\n**Resources:**\n- `requestCpu` / `limitCpu` - CPU requests/limits\n- `requestMemory` / `limitMemory` - Memory requests/limits\n\n**High Availability:**\n- `minAvailable` - Min pods during updates (for PodDisruptionBudget)\n- `maxUnavailable` - Max unavailable pods during updates\n\n**Health Probes:**\n- `readinessEnabled` - Enable readiness probe (default: true)\n- `readinessInitialDelaySeconds` / `readinessTimeoutSeconds` / `readinessPeriodSeconds`\n- `readinessSuccessThreshold` / `readinessFailureThreshold`\n- `livenessEnabled` - Enable liveness probe (default: false, recommended true for frontend)\n- `livenessInitialDelaySeconds` / `livenessTimeoutSeconds` / `livenessPeriodSeconds`\n- `livenessSuccessThreshold` / `livenessFailureThreshold`\n\n**Annotations:**\n- `annotations` - Deployment metadata annotations\n- `podAnnotations` - Pod template annotations (e.g., for Prometheus)\n- `serviceAnnotations` - Service annotations (e.g., for external-dns)\n\n#### `PloneHttpcacheOptions`\n\n- `plone` - Plone construct to attach cache to (required)\n- `varnishVcl` - VCL configuration as string\n- `varnishVclFile` - Path to VCL configuration file\n- `existingSecret` - Kubernetes secret for Varnish admin credentials\n- `replicas` - Number of Varnish replicas (default: 2)\n- `requestCpu` / `limitCpu` - CPU resources\n- `requestMemory` / `limitMemory` - Memory resources\n- `servicemonitor` - Enable Prometheus ServiceMonitor (default: false)\n- `exporterEnabled` - Enable Prometheus exporter sidecar (default: true)\n- `chartVersion` - kube-httpcache Helm chart version (default: latest)\n- `appVersion` - kube-httpcache container image version (default: chartVersion or chart default)\n\n\n## Development\n\nThis project uses [Projen](https://projen.io/) to manage project configuration. **Do not edit generated files directly.**\n\n### Setup\n\nClone the repository and install dependencies:\n\n```bash\nnvm use lts/*\ncorepack enable\nnpx projen\n```\n\n### Common Commands\n\n```bash\n# Run tests\nnpx projen test\n\n# Run tests in watch mode\nnpx projen test:watch\n\n# Build (compile TypeScript + generate JSII bindings)\nnpx projen build\n\n# Lint\nnpx projen eslint\n\n# Generate API documentation\nnpx projen docgen\n\n# Package for distribution\nnpx projen package-all\n```\n\n### Making Changes\n\n1. Edit `.projenrc.ts` for project configuration changes\n2. Run `npx projen` to regenerate project files\n3. Make code changes in `src/`\n4. Run tests and update snapshots if needed: `npx projen test -- -u`\n\n## References\n\n- [CDK8S Documentation](https://cdk8s.io/)\n- [Kubernetes Probes Documentation](https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/)\n- [kube-httpcache Helm Chart](https://github.com/mittwald/kube-httpcache)\n- [Example Project](https://github.com/bluedynamics/cdk8s-plone-example)\n\n## License\n\nSee [LICENSE](./LICENSE) file."
111
+ "markdown": "# CDK8S Plone\n\n> TypeScript and Python library for deploying Plone CMS to Kubernetes using CDK8S\n\n[![npm version](https://badge.fury.io/js/%40bluedynamics%2Fcdk8s-plone.svg)](https://www.npmjs.com/package/@bluedynamics/cdk8s-plone)\n[![PyPI version](https://badge.fury.io/py/cdk8s-plone.svg)](https://pypi.org/project/cdk8s-plone/)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)\n\n## Overview\n\ncdk8s-plone provides CDK8S constructs for deploying [Plone CMS](https://plone.org/) on Kubernetes. Define your infrastructure using TypeScript or Python and generate Kubernetes manifests automatically.\n\n**Key Features:**\n- 🚀 Supports Volto (modern React frontend) and Classic UI\n- 📦 High availability with configurable replicas\n- Optional Varnish HTTP caching layer\n- 🔧 Fine-grained resource and probe configuration\n- 🌍 Multi-language support (TypeScript/JavaScript and Python)\n- ✅ Type-safe infrastructure as code\n\n## Quick Start\n\n### Installation\n\n**TypeScript/JavaScript:**\n```bash\nnpm install @bluedynamics/cdk8s-plone\n```\n\n**Python:**\n```bash\npip install cdk8s-plone\n```\n\n### Basic Example\n\n```typescript\nimport { App, Chart } from 'cdk8s';\nimport { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';\n\nconst app = new App();\nconst chart = new Chart(app, 'PloneDeployment');\n\nnew Plone(chart, 'my-plone', {\n variant: PloneVariant.VOLTO,\n backend: {\n image: 'plone/plone-backend:6.1.3',\n replicas: 3,\n },\n frontend: {\n image: 'plone/plone-frontend:16.0.0',\n replicas: 2,\n },\n});\n\napp.synth();\n```\n\nGenerate Kubernetes manifests:\n```bash\ncdk8s synth\nkubectl apply -f dist/\n```\n\n## Documentation\n\n**📚 Full documentation:** https://bluedynamics.github.io/cdk8s-plone/\n\n- [Quick Start Tutorial](https://bluedynamics.github.io/cdk8s-plone/tutorials/01-quick-start.html)\n- [Configuration Reference](https://bluedynamics.github.io/cdk8s-plone/reference/configuration-options.html)\n- [Architecture Overview](https://bluedynamics.github.io/cdk8s-plone/explanation/architecture.html)\n- [Complete API Documentation](./API.md)\n\n## Examples\n\nSee the [cdk8s-plone-example](https://github.com/bluedynamics/cdk8s-plone-example) repository for complete working examples.\n\n## Requirements\n\n- **kubectl** - [Install kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)\n- **Node.js 16+** (for TypeScript/JavaScript) - [Install Node.js](https://nodejs.org/)\n- **Python 3.8+** (for Python) - [Install Python](https://www.python.org/)\n- **Kubernetes cluster** (local or cloud)\n\nFor detailed setup instructions, see [Setup Prerequisites](https://bluedynamics.github.io/cdk8s-plone/how-to/setup-prerequisites.html).\n\n## Development\n\nThis project uses [Projen](https://projen.io/) for project management.\n\n```bash\n# Install dependencies\nnpm install\n\n# Run tests\nnpm test\n\n# Build\nnpm run build\n\n# Update project configuration\n# Edit .projenrc.ts, then run:\nnpx projen\n```\n\nFor detailed development instructions, see [CONTRIBUTING.md](./CONTRIBUTING.md) (if available).\n\n## Resources\n\n- [CDK8S Documentation](https://cdk8s.io/)\n- [Plone CMS](https://plone.org/)\n- [kube-httpcache](https://github.com/mittwald/kube-httpcache) (for HTTP caching)\n- [Example Project](https://github.com/bluedynamics/cdk8s-plone-example)\n\n## License\n\n[Apache 2.0](LICENSE)\n\n## Maintainers\n\nMaintained by [Blue Dynamics Alliance](https://github.com/bluedynamics)\n\n**Author:** Jens W. Klein (jk@kleinundpartner.at)\n"
112
112
  },
113
113
  "repository": {
114
114
  "type": "git",
@@ -1248,6 +1248,6 @@
1248
1248
  "symbolId": "src/plone:PloneVariant"
1249
1249
  }
1250
1250
  },
1251
- "version": "0.1.5",
1252
- "fingerprint": "Q0Ytwy5sRLfzi4pEzD2hiOWRCkuXa9vTKbdZXTaedlk="
1251
+ "version": "0.1.6",
1252
+ "fingerprint": "depZZYpzfH8bEtxQEeVuqwlkPEPyCD3pZVw9TOCbtE8="
1253
1253
  }
package/CLAUDE.md ADDED
@@ -0,0 +1,352 @@
1
+ # Claude Code Project Guide
2
+
3
+ This document provides context and guidelines for Claude Code when working on this project.
4
+
5
+ ## Project Overview
6
+
7
+ **cdk8s-plone** is a TypeScript/Python library for deploying Plone CMS to Kubernetes using CDK8S constructs. It provides type-safe infrastructure as code with support for Volto (React frontend) and Classic UI deployments.
8
+
9
+ ## Git Workflow
10
+
11
+ **IMPORTANT: Never merge directly to `main`**
12
+
13
+ This project uses a Pull Request workflow:
14
+
15
+ 1. **Create a feature branch** from `main`:
16
+ ```bash
17
+ git checkout -b feature/description
18
+ # or
19
+ git checkout -b docs/description
20
+ # or
21
+ git checkout -b fix/description
22
+ ```
23
+
24
+ 2. **Make commits** on the feature branch with descriptive messages
25
+
26
+ 3. **Create a Pull Request** to merge into `main`:
27
+ - Use GitHub UI or `gh` CLI
28
+ - PRs are required for code review
29
+ - Never push directly to `main`
30
+ - Never merge locally to `main`
31
+
32
+ 4. **PR will be reviewed and merged** by maintainers
33
+
34
+ ### Branch Naming Conventions
35
+
36
+ - `feat/` or `feature/` - New features
37
+ - `fix/` - Bug fixes
38
+ - `docs/` - Documentation changes
39
+ - `chore/` - Maintenance tasks
40
+ - `refactor/` - Code refactoring
41
+ - `test/` - Test additions or changes
42
+
43
+ ## Working with Worktrees
44
+
45
+ **Recommended for parallel development and multi-instance work**
46
+
47
+ Git worktrees allow you to work on multiple branches simultaneously without switching contexts. This is especially useful when:
48
+ - Multiple Claude Code instances are working on different features
49
+ - You need to switch between features frequently
50
+ - You want to keep branches completely isolated
51
+
52
+ ### Setting Up Worktrees
53
+
54
+ **Create a worktree for each feature branch:**
55
+
56
+ ```bash
57
+ # From the main repository
58
+ git worktree add ../cdk8s-plone-feature-name feature/feature-name
59
+
60
+ # For existing branches
61
+ git worktree add ../cdk8s-plone-docs docs/diataxis-sphinx-skeleton
62
+
63
+ # For new branches
64
+ git worktree add -b feat/new-feature ../cdk8s-plone-new-feature
65
+ ```
66
+
67
+ **Directory structure with worktrees:**
68
+ ```
69
+ ~/ws/cdev/
70
+ ├── cdk8s-plone/ # Main repository (usually on main branch)
71
+ ├── cdk8s-plone-docs/ # Worktree for documentation work
72
+ ├── cdk8s-plone-frontend/ # Worktree for frontend features
73
+ └── cdk8s-plone-monitoring/ # Worktree for monitoring features
74
+ ```
75
+
76
+ ### Working with Worktrees
77
+
78
+ **List all worktrees:**
79
+ ```bash
80
+ git worktree list
81
+ ```
82
+
83
+ **Remove a worktree when done:**
84
+ ```bash
85
+ # Delete the worktree directory first
86
+ rm -rf ../cdk8s-plone-feature-name
87
+
88
+ # Then prune the worktree reference
89
+ git worktree prune
90
+ ```
91
+
92
+ **Switch between worktrees:**
93
+ ```bash
94
+ # Simply cd to the worktree directory
95
+ cd ../cdk8s-plone-docs
96
+
97
+ # Each worktree is an independent working directory
98
+ # with its own checked out branch
99
+ ```
100
+
101
+ ### Worktree Best Practices
102
+
103
+ 1. **One feature per worktree**: Keep each worktree focused on a single feature or task
104
+ 2. **Clean up after merge**: Remove worktrees once their branches are merged
105
+ 3. **Use descriptive directory names**: Name worktrees after their branch or feature
106
+ 4. **Regular git fetch**: Run `git fetch` in any worktree to update all branch references
107
+ 5. **Avoid nested worktrees**: Don't create worktrees inside other worktrees
108
+
109
+ ### Example Workflow with Worktrees
110
+
111
+ ```bash
112
+ # Setup: Create worktree for documentation work
113
+ cd ~/ws/cdev/cdk8s-plone
114
+ git worktree add -b docs/add-tutorial ../cdk8s-plone-docs
115
+
116
+ # Work: Make changes in the worktree
117
+ cd ../cdk8s-plone-docs
118
+ # ... make documentation changes ...
119
+ git add . && git commit -m "docs: add new tutorial"
120
+ git push -u origin docs/add-tutorial
121
+
122
+ # Create PR using gh CLI
123
+ gh pr create --title "Add new tutorial" --body "..."
124
+
125
+ # Cleanup: After PR is merged
126
+ cd ~/ws/cdev/cdk8s-plone
127
+ git fetch
128
+ git pull # Update main branch
129
+ rm -rf ../cdk8s-plone-docs
130
+ git worktree prune
131
+ ```
132
+
133
+ ### Benefits of Worktrees
134
+
135
+ - ✅ **No branch switching**: Keep different features in separate directories
136
+ - ✅ **Parallel work**: Multiple Claude instances can work independently
137
+ - ✅ **Clean state**: Each worktree maintains its own working directory state
138
+ - ✅ **Fast context switching**: Just `cd` between directories
139
+ - ✅ **No uncommitted changes conflicts**: Each worktree is isolated
140
+
141
+ ## Project Structure
142
+
143
+ ```
144
+ .
145
+ ├── src/ # TypeScript source code
146
+ │ ├── plone.ts # Main Plone construct
147
+ │ ├── service.ts # Service utilities
148
+ │ └── ...
149
+ ├── test/ # Jest tests
150
+ ├── documentation/ # Sphinx documentation (Diataxis framework)
151
+ │ ├── sources/ # Documentation source files
152
+ │ ├── Makefile # Build automation (mxmake)
153
+ │ └── README.md # Documentation contributor guide
154
+ ├── .projenrc.ts # Projen project configuration
155
+ ├── API.md # Auto-generated API documentation
156
+ └── README.md # Main project README
157
+ ```
158
+
159
+ ## Build System
160
+
161
+ This project uses **Projen** for project management.
162
+
163
+ **⚠️ DO NOT edit generated files directly**
164
+
165
+ Generated files include:
166
+ - `package.json`
167
+ - `tsconfig.json`
168
+ - `.gitignore`
169
+ - GitHub Actions workflows (except custom ones)
170
+ - And more...
171
+
172
+ ### Making Changes
173
+
174
+ 1. **Edit `.projenrc.ts`** for project configuration changes
175
+ 2. **Run `npx projen`** to regenerate files
176
+ 3. **Make code changes** in `src/`
177
+ 4. **Run tests**: `npx projen test`
178
+ 5. **Update snapshots if needed**: `npx projen test -- -u`
179
+
180
+ ### Common Commands
181
+
182
+ ```bash
183
+ # Install dependencies
184
+ npm install
185
+
186
+ # Run tests
187
+ npx projen test
188
+
189
+ # Run tests in watch mode
190
+ npx projen test:watch
191
+
192
+ # Build (compile + generate bindings)
193
+ npx projen build
194
+
195
+ # Lint
196
+ npx projen eslint
197
+
198
+ # Generate API docs
199
+ npx projen docgen
200
+
201
+ # Package for distribution
202
+ npx projen package-all
203
+
204
+ # Update project files after .projenrc.ts changes
205
+ npx projen
206
+ ```
207
+
208
+ ## Documentation
209
+
210
+ Documentation uses **Sphinx** with the **Diataxis framework**:
211
+
212
+ - **Tutorials**: Learning-oriented, step-by-step guides
213
+ - **How-To Guides**: Goal-oriented, problem-solving recipes
214
+ - **Reference**: Information-oriented, technical specifications
215
+ - **Explanation**: Understanding-oriented, concepts and design
216
+
217
+ ### Building Documentation
218
+
219
+ ```bash
220
+ cd documentation
221
+
222
+ # Build HTML
223
+ make docs
224
+
225
+ # Live-reload development server
226
+ make docs-live
227
+
228
+ # Clean and rebuild
229
+ make clean && make docs
230
+ ```
231
+
232
+ ### Documentation Deployment
233
+
234
+ - Documentation auto-deploys to GitHub Pages on push to `main`
235
+ - Workflow: `.github/workflows/documentation.yml`
236
+ - Published at: `https://bluedynamics.github.io/cdk8s-plone/`
237
+
238
+ ## Testing
239
+
240
+ - **Framework**: Jest
241
+ - **Test location**: `test/` directory
242
+ - **Snapshots**: Used for testing generated Kubernetes manifests
243
+ - **Update snapshots**: `npx projen test -- -u`
244
+
245
+ ## Multi-Language Support
246
+
247
+ The library is published in multiple languages via JSII:
248
+
249
+ - **TypeScript/JavaScript**: `@bluedynamics/cdk8s-plone` on npm
250
+ - **Python**: `cdk8s-plone` on PyPI
251
+
252
+ JSII configuration is in `package.json` under the `jsii` field.
253
+
254
+ ## Code Style
255
+
256
+ - **Linter**: ESLint with TypeScript support
257
+ - **Style**: Configured via `.projenrc.ts`
258
+ - **Run linter**: `npx projen eslint`
259
+
260
+ ## Commit Messages
261
+
262
+ Follow conventional commit format:
263
+
264
+ ```
265
+ <type>(<scope>): <subject>
266
+
267
+ <body>
268
+
269
+ <footer>
270
+ ```
271
+
272
+ **Types:**
273
+ - `feat`: New feature
274
+ - `fix`: Bug fix
275
+ - `docs`: Documentation changes
276
+ - `chore`: Maintenance tasks
277
+ - `refactor`: Code refactoring
278
+ - `test`: Test additions or changes
279
+ - `ci`: CI/CD changes
280
+
281
+ **Example:**
282
+ ```
283
+ feat(plone): add support for custom environment variables
284
+
285
+ Allow passing custom environment variables to backend and frontend
286
+ containers using the cdk8s-plus-30 Env API.
287
+
288
+ Closes #123
289
+ ```
290
+
291
+ All commits from Claude Code include:
292
+ ```
293
+ 🤖 Generated with [Claude Code](https://claude.com/claude-code)
294
+
295
+ Co-Authored-By: Claude <noreply@anthropic.com>
296
+ ```
297
+
298
+ ## CI/CD
299
+
300
+ GitHub Actions workflows:
301
+
302
+ - **build.yml**: Build, test, and package
303
+ - **release.yml**: Create releases and publish to npm/PyPI
304
+ - **upgrade-main.yml**: Dependency upgrades
305
+ - **pull-request-lint.yml**: PR validation
306
+ - **documentation.yml**: Build and deploy docs to GitHub Pages
307
+
308
+ ## Dependencies
309
+
310
+ ### Runtime Dependencies
311
+
312
+ - `cdk8s` - CDK8S framework
313
+ - `cdk8s-plus-30` - CDK8S plus constructs
314
+ - `constructs` - Construct base classes
315
+
316
+ ### Development Dependencies
317
+
318
+ - `projen` - Project management
319
+ - `jsii` - Multi-language support
320
+ - `jest` - Testing
321
+ - `typescript` - Language
322
+ - `eslint` - Linting
323
+
324
+ ## Publishing
325
+
326
+ **Do not manually publish packages**
327
+
328
+ Publishing is automated via GitHub Actions on release:
329
+ 1. Create and push a git tag (via `npx projen release`)
330
+ 2. GitHub Actions builds and publishes to npm and PyPI
331
+ 3. Release notes are auto-generated
332
+
333
+ ## Important Notes
334
+
335
+ - **Never merge to main**: Always create PRs
336
+ - **Don't edit generated files**: Use `.projenrc.ts` and run `npx projen`
337
+ - **Update snapshots after changes**: Run `npx projen test -- -u`
338
+ - **Follow Diataxis**: When adding docs, use the correct category
339
+ - **Documentation builds required**: Run `make docs` to verify doc changes
340
+
341
+ ## Resources
342
+
343
+ - [CDK8S Documentation](https://cdk8s.io/)
344
+ - [Projen Documentation](https://projen.io/)
345
+ - [Diataxis Framework](https://diataxis.fr/)
346
+ - [JSII Documentation](https://aws.github.io/jsii/)
347
+ - [Example Project](https://github.com/bluedynamics/cdk8s-plone-example)
348
+
349
+ ## Maintainer Contact
350
+
351
+ **Author:** Jens W. Klein (jk@kleinundpartner.at)
352
+ **Organization:** [Blue Dynamics Alliance](https://github.com/bluedynamics)
package/README.md CHANGED
@@ -1,56 +1,38 @@
1
1
  # CDK8S Plone
2
2
 
3
- A CDK8S library for deploying Plone CMS to Kubernetes.
3
+ > TypeScript and Python library for deploying Plone CMS to Kubernetes using CDK8S
4
4
 
5
- This library provides constructs to bootstrap a Plone deployment on a Kubernetes cluster using the [CDK8S](https://cdk8s.io) framework.
5
+ [![npm version](https://badge.fury.io/js/%40bluedynamics%2Fcdk8s-plone.svg)](https://www.npmjs.com/package/@bluedynamics/cdk8s-plone)
6
+ [![PyPI version](https://badge.fury.io/py/cdk8s-plone.svg)](https://pypi.org/project/cdk8s-plone/)
7
+ [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
6
8
 
7
- ## Features
9
+ ## Overview
8
10
 
9
- - **Backend**: Plone backend (API with `plone.volto` or Classic-UI)
10
- - **Frontend**: Plone Volto (modern React-based user interface)
11
- - **Varnish Caching**: Optional HTTP caching layer using [kube-httpcache](https://github.com/mittwald/kube-httpcache) with cluster-wide cache invalidation
12
- - **High Availability**: Configurable replicas with PodDisruptionBudgets
13
- - **Multi-language Support**: Published to npm (TypeScript/JavaScript) and PyPI (Python)
11
+ cdk8s-plone provides CDK8S constructs for deploying [Plone CMS](https://plone.org/) on Kubernetes. Define your infrastructure using TypeScript or Python and generate Kubernetes manifests automatically.
14
12
 
13
+ **Key Features:**
14
+ - 🚀 Supports Volto (modern React frontend) and Classic UI
15
+ - 📦 High availability with configurable replicas
16
+ - ⚡ Optional Varnish HTTP caching layer
17
+ - 🔧 Fine-grained resource and probe configuration
18
+ - 🌍 Multi-language support (TypeScript/JavaScript and Python)
19
+ - ✅ Type-safe infrastructure as code
15
20
 
16
- ## Installation
17
-
18
- ### TypeScript/JavaScript
19
-
20
- Create a new CDK8S project (or use an existing one):
21
-
22
- ```bash
23
- cdk8s init typescript-app
24
- ```
21
+ ## Quick Start
25
22
 
26
- Install the library:
23
+ ### Installation
27
24
 
25
+ **TypeScript/JavaScript:**
28
26
  ```bash
29
27
  npm install @bluedynamics/cdk8s-plone
30
28
  ```
31
29
 
32
- Package: [@bluedynamics/cdk8s-plone](https://www.npmjs.com/package/@bluedynamics/cdk8s-plone)
33
-
34
- ### Python
35
-
36
- Create a new CDK8S project:
37
-
38
- ```bash
39
- cdk8s init python-app
40
- ```
41
-
42
- Install the library:
43
-
30
+ **Python:**
44
31
  ```bash
45
32
  pip install cdk8s-plone
46
33
  ```
47
34
 
48
- Package: [cdk8s-plone](https://pypi.org/project/cdk8s-plone/)
49
-
50
-
51
- ## Quick Start
52
-
53
- ### Basic Plone Deployment
35
+ ### Basic Example
54
36
 
55
37
  ```typescript
56
38
  import { App, Chart } from 'cdk8s';
@@ -62,7 +44,7 @@ const chart = new Chart(app, 'PloneDeployment');
62
44
  new Plone(chart, 'my-plone', {
63
45
  variant: PloneVariant.VOLTO,
64
46
  backend: {
65
- image: 'plone/plone-backend:6.0.10',
47
+ image: 'plone/plone-backend:6.1.3',
66
48
  replicas: 3,
67
49
  },
68
50
  frontend: {
@@ -74,174 +56,68 @@ new Plone(chart, 'my-plone', {
74
56
  app.synth();
75
57
  ```
76
58
 
77
- ### With Varnish HTTP Cache
78
-
79
- ```typescript
80
- import { PloneHttpcache } from '@bluedynamics/cdk8s-plone';
81
-
82
- const plone = new Plone(chart, 'my-plone', {
83
- variant: PloneVariant.VOLTO,
84
- backend: { image: 'plone/plone-backend:6.0.10' },
85
- frontend: { image: 'plone/plone-frontend:16.0.0' },
86
- });
87
-
88
- new PloneHttpcache(chart, 'cache', {
89
- plone: plone,
90
- existingSecret: 'varnish-secret',
91
- replicas: 2,
92
- });
93
- ```
94
-
95
- ### Generate Kubernetes Manifests
96
-
59
+ Generate Kubernetes manifests:
97
60
  ```bash
98
61
  cdk8s synth
62
+ kubectl apply -f dist/
99
63
  ```
100
64
 
101
- The manifests are stored in the `dist/` directory.
102
-
103
- For a complete example, see the [example project](https://github.com/bluedynamics/cdk8s-plone-example).
104
-
105
- ## Prerequisites
106
-
107
- - **kubectl** - Command-line tool for deploying Kubernetes manifests. [Install kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
108
- - **Helm** (optional) - Only needed if generating Helm charts. [Install Helm](https://helm.sh/docs/intro/install/)
109
- - **Node.js** - For TypeScript/JavaScript development
110
- - **Python 3.8+** - For Python development
65
+ ## Documentation
111
66
 
67
+ **📚 Full documentation:** https://bluedynamics.github.io/cdk8s-plone/
112
68
 
113
- ## API Documentation
69
+ - [Quick Start Tutorial](https://bluedynamics.github.io/cdk8s-plone/tutorials/01-quick-start.html)
70
+ - [Configuration Reference](https://bluedynamics.github.io/cdk8s-plone/reference/configuration-options.html)
71
+ - [Architecture Overview](https://bluedynamics.github.io/cdk8s-plone/explanation/architecture.html)
72
+ - [Complete API Documentation](./API.md)
114
73
 
115
- For complete API documentation, see [API.md](./API.md).
74
+ ## Examples
116
75
 
117
- ### Key Constructs
76
+ See the [cdk8s-plone-example](https://github.com/bluedynamics/cdk8s-plone-example) repository for complete working examples.
118
77
 
119
- #### `Plone`
78
+ ## Requirements
120
79
 
121
- Main construct for deploying Plone CMS. Supports two variants:
122
- - **VOLTO**: Modern React frontend with REST API backend (default)
123
- - **CLASSICUI**: Traditional server-side rendered Plone
124
-
125
- Properties:
126
- - `backendServiceName` - Name of the backend Kubernetes service
127
- - `frontendServiceName` - Name of the frontend service (VOLTO only)
128
- - `variant` - Deployment variant (VOLTO or CLASSICUI)
129
- - `siteId` - Plone site ID in ZODB (default: 'Plone')
130
-
131
- #### `PloneHttpcache`
132
-
133
- Varnish HTTP caching layer using the [kube-httpcache](https://github.com/mittwald/kube-httpcache) Helm chart.
134
-
135
- Properties:
136
- - `httpcacheServiceName` - Name of the Varnish service
137
-
138
- ### Configuration Options
139
-
140
- #### `PloneOptions`
141
-
142
- - `version` - Version of your project
143
- - `siteId` - Plone site ID (default: 'Plone')
144
- - `variant` - PloneVariant.VOLTO or PloneVariant.CLASSICUI (default: VOLTO)
145
- - `backend` - Backend configuration (PloneBaseOptions)
146
- - `frontend` - Frontend configuration (PloneBaseOptions, required for VOLTO)
147
- - `imagePullSecrets` - Image pull secrets for private registries
148
-
149
- #### `PloneBaseOptions`
150
-
151
- Configuration for backend or frontend:
152
-
153
- **Container:**
154
- - `image` - Container image (e.g., 'plone/plone-backend:6.0.10')
155
- - `imagePullPolicy` - Pull policy (default: 'IfNotPresent')
156
- - `replicas` - Number of replicas (default: 2)
157
- - `environment` - Environment variables (cdk8s-plus-30.Env)
158
-
159
- **Resources:**
160
- - `requestCpu` / `limitCpu` - CPU requests/limits
161
- - `requestMemory` / `limitMemory` - Memory requests/limits
162
-
163
- **High Availability:**
164
- - `minAvailable` - Min pods during updates (for PodDisruptionBudget)
165
- - `maxUnavailable` - Max unavailable pods during updates
166
-
167
- **Health Probes:**
168
- - `readinessEnabled` - Enable readiness probe (default: true)
169
- - `readinessInitialDelaySeconds` / `readinessTimeoutSeconds` / `readinessPeriodSeconds`
170
- - `readinessSuccessThreshold` / `readinessFailureThreshold`
171
- - `livenessEnabled` - Enable liveness probe (default: false, recommended true for frontend)
172
- - `livenessInitialDelaySeconds` / `livenessTimeoutSeconds` / `livenessPeriodSeconds`
173
- - `livenessSuccessThreshold` / `livenessFailureThreshold`
174
-
175
- **Annotations:**
176
- - `annotations` - Deployment metadata annotations
177
- - `podAnnotations` - Pod template annotations (e.g., for Prometheus)
178
- - `serviceAnnotations` - Service annotations (e.g., for external-dns)
179
-
180
- #### `PloneHttpcacheOptions`
181
-
182
- - `plone` - Plone construct to attach cache to (required)
183
- - `varnishVcl` - VCL configuration as string
184
- - `varnishVclFile` - Path to VCL configuration file
185
- - `existingSecret` - Kubernetes secret for Varnish admin credentials
186
- - `replicas` - Number of Varnish replicas (default: 2)
187
- - `requestCpu` / `limitCpu` - CPU resources
188
- - `requestMemory` / `limitMemory` - Memory resources
189
- - `servicemonitor` - Enable Prometheus ServiceMonitor (default: false)
190
- - `exporterEnabled` - Enable Prometheus exporter sidecar (default: true)
191
- - `chartVersion` - kube-httpcache Helm chart version (default: latest)
192
- - `appVersion` - kube-httpcache container image version (default: chartVersion or chart default)
80
+ - **kubectl** - [Install kubectl](https://kubernetes.io/docs/tasks/tools/#kubectl)
81
+ - **Node.js 16+** (for TypeScript/JavaScript) - [Install Node.js](https://nodejs.org/)
82
+ - **Python 3.8+** (for Python) - [Install Python](https://www.python.org/)
83
+ - **Kubernetes cluster** (local or cloud)
193
84
 
85
+ For detailed setup instructions, see [Setup Prerequisites](https://bluedynamics.github.io/cdk8s-plone/how-to/setup-prerequisites.html).
194
86
 
195
87
  ## Development
196
88
 
197
- This project uses [Projen](https://projen.io/) to manage project configuration. **Do not edit generated files directly.**
198
-
199
- ### Setup
200
-
201
- Clone the repository and install dependencies:
89
+ This project uses [Projen](https://projen.io/) for project management.
202
90
 
203
91
  ```bash
204
- nvm use lts/*
205
- corepack enable
206
- npx projen
207
- ```
208
-
209
- ### Common Commands
92
+ # Install dependencies
93
+ npm install
210
94
 
211
- ```bash
212
95
  # Run tests
213
- npx projen test
214
-
215
- # Run tests in watch mode
216
- npx projen test:watch
96
+ npm test
217
97
 
218
- # Build (compile TypeScript + generate JSII bindings)
219
- npx projen build
98
+ # Build
99
+ npm run build
220
100
 
221
- # Lint
222
- npx projen eslint
223
-
224
- # Generate API documentation
225
- npx projen docgen
226
-
227
- # Package for distribution
228
- npx projen package-all
101
+ # Update project configuration
102
+ # Edit .projenrc.ts, then run:
103
+ npx projen
229
104
  ```
230
105
 
231
- ### Making Changes
232
-
233
- 1. Edit `.projenrc.ts` for project configuration changes
234
- 2. Run `npx projen` to regenerate project files
235
- 3. Make code changes in `src/`
236
- 4. Run tests and update snapshots if needed: `npx projen test -- -u`
106
+ For detailed development instructions, see [CONTRIBUTING.md](./CONTRIBUTING.md) (if available).
237
107
 
238
- ## References
108
+ ## Resources
239
109
 
240
110
  - [CDK8S Documentation](https://cdk8s.io/)
241
- - [Kubernetes Probes Documentation](https://kubernetes.io/docs/concepts/configuration/liveness-readiness-startup-probes/)
242
- - [kube-httpcache Helm Chart](https://github.com/mittwald/kube-httpcache)
111
+ - [Plone CMS](https://plone.org/)
112
+ - [kube-httpcache](https://github.com/mittwald/kube-httpcache) (for HTTP caching)
243
113
  - [Example Project](https://github.com/bluedynamics/cdk8s-plone-example)
244
114
 
245
115
  ## License
246
116
 
247
- See [LICENSE](./LICENSE) file.
117
+ [Apache 2.0](LICENSE)
118
+
119
+ ## Maintainers
120
+
121
+ Maintained by [Blue Dynamics Alliance](https://github.com/bluedynamics)
122
+
123
+ **Author:** Jens W. Klein (jk@kleinundpartner.at)