@bluedynamics/cdk8s-plone 0.3.1 → 0.3.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 (68) hide show
  1. package/.jsii +2 -2
  2. package/lib/config/plone-vinyl-backend-response.vcl +25 -0
  3. package/lib/config/plone-vinyl-recv.vcl +18 -0
  4. package/{examples/volto → lib}/config/varnish.tpl.vcl +1 -1
  5. package/lib/httpcache.js +1 -1
  6. package/lib/plone.js +1 -1
  7. package/lib/vinylcache.js +1 -1
  8. package/package.json +3 -2
  9. package/.claude/claude.md +0 -39
  10. package/.claude/settings.local.json +0 -31
  11. package/CLAUDE.md +0 -352
  12. package/docs/superpowers/plans/2026-06-12-configurable-service-spec.md +0 -608
  13. package/docs/superpowers/specs/2026-06-12-configurable-service-spec-design.md +0 -192
  14. package/documentation/Makefile +0 -357
  15. package/documentation/README.md +0 -284
  16. package/documentation/mx.ini +0 -3
  17. package/documentation/sources/_static/logo.svg +0 -79
  18. package/documentation/sources/conf.py +0 -145
  19. package/documentation/sources/explanation/architecture.md +0 -336
  20. package/documentation/sources/explanation/cdk8s-workflow.md +0 -66
  21. package/documentation/sources/explanation/features.md +0 -374
  22. package/documentation/sources/explanation/index.md +0 -34
  23. package/documentation/sources/how-to/backup-and-restore.md +0 -107
  24. package/documentation/sources/how-to/configure-env-and-secrets.md +0 -184
  25. package/documentation/sources/how-to/configure-ingress-tls.md +0 -108
  26. package/documentation/sources/how-to/configure-security-context.md +0 -143
  27. package/documentation/sources/how-to/deploy-blicca.md +0 -334
  28. package/documentation/sources/how-to/deploy-volto.md +0 -324
  29. package/documentation/sources/how-to/deploy-with-httpcache.md +0 -224
  30. package/documentation/sources/how-to/deploy-with-vinyl-cache.md +0 -273
  31. package/documentation/sources/how-to/enable-prometheus-monitoring.md +0 -122
  32. package/documentation/sources/how-to/index.md +0 -85
  33. package/documentation/sources/how-to/scale-and-high-availability.md +0 -122
  34. package/documentation/sources/how-to/schedule-pods.md +0 -145
  35. package/documentation/sources/how-to/setup-prerequisites.md +0 -363
  36. package/documentation/sources/how-to/troubleshooting.md +0 -113
  37. package/documentation/sources/how-to/upgrade-and-rollout.md +0 -140
  38. package/documentation/sources/index.md +0 -109
  39. package/documentation/sources/reference/api/index.md +0 -40
  40. package/documentation/sources/reference/configuration-options.md +0 -352
  41. package/documentation/sources/reference/index.md +0 -41
  42. package/documentation/sources/tutorials/01-quick-start.md +0 -165
  43. package/documentation/sources/tutorials/index.md +0 -53
  44. package/examples/blicca/.env.example +0 -20
  45. package/examples/blicca/README.md +0 -339
  46. package/examples/blicca/__snapshots__/main.test.ts.snap +0 -1035
  47. package/examples/blicca/cdk8s.yaml +0 -6
  48. package/examples/blicca/config/varnish.tpl.vcl +0 -217
  49. package/examples/blicca/ingress.ts +0 -217
  50. package/examples/blicca/jest.config.js +0 -11
  51. package/examples/blicca/main.test.ts +0 -18
  52. package/examples/blicca/main.ts +0 -101
  53. package/examples/blicca/package.json +0 -36
  54. package/examples/blicca/postgres.cloudnativepg.ts +0 -63
  55. package/examples/blicca/postgres.plain.ts +0 -115
  56. package/examples/blicca/tsconfig.json +0 -33
  57. package/examples/volto/.env.example +0 -21
  58. package/examples/volto/README.md +0 -292
  59. package/examples/volto/__snapshots__/main.test.ts.snap +0 -1206
  60. package/examples/volto/cdk8s.yaml +0 -6
  61. package/examples/volto/ingress.ts +0 -229
  62. package/examples/volto/jest.config.js +0 -11
  63. package/examples/volto/main.test.ts +0 -18
  64. package/examples/volto/main.ts +0 -105
  65. package/examples/volto/package.json +0 -36
  66. package/examples/volto/postgres.cloudnativepg.ts +0 -63
  67. package/examples/volto/postgres.plain.ts +0 -115
  68. package/examples/volto/tsconfig.json +0 -33
@@ -1,336 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
4
- "description": "Architecture and design of cdk8s-plone deployments: components, caching options, and production considerations."
5
- "property=og:description": "Architecture and design of cdk8s-plone deployments: components, caching options, and production considerations."
6
- "property=og:title": "Architecture overview"
7
- "keywords": "Plone, cdk8s, Kubernetes, architecture, design, Volto, Varnish, caching"
8
- ---
9
-
10
- # Architecture overview
11
-
12
- Understanding the architecture and design of cdk8s-plone deployments.
13
-
14
- ## Overview
15
-
16
- cdk8s-plone provides CDK8S constructs for deploying Plone CMS on Kubernetes. The library handles all Kubernetes resources needed for a production-grade Plone deployment.
17
-
18
- ## Key features
19
-
20
- ### Deployment variants
21
-
22
- cdk8s-plone supports two deployment variants:
23
-
24
- **Volto (React single-page frontend)**
25
- - React-based frontend (Volto)
26
- - REST API backend (Plone)
27
- - Separate services for frontend and backend
28
- - Headless CMS architecture
29
-
30
- **Blicca (server-side rendered)**
31
- - The Plone backend renders the UI and serves HTML directly
32
- - Single integrated service
33
- - Simpler deployment model
34
-
35
- Blicca is the new name for the variant Plone formerly called "Classic UI".
36
- Both approaches are equally current; they differ in where rendering happens, not in how modern they are.
37
-
38
- ### High availability
39
-
40
- **Replica Management**
41
- - Configurable number of replicas for backend and frontend
42
- - Default: 2 replicas for each component
43
- - Supports horizontal scaling
44
-
45
- **Pod Disruption Budgets**
46
- - Ensures minimum availability during cluster operations
47
- - Configurable `minAvailable` and `maxUnavailable` thresholds
48
- - Protects against voluntary disruptions (node drains, updates)
49
-
50
- **Health Probes**
51
- - Readiness probes: Traffic routing only to healthy pods
52
- - Liveness probes: Automatic restart of unhealthy pods
53
- - Configurable delays, timeouts, and thresholds
54
-
55
- ### HTTP caching layer
56
-
57
- **Varnish Integration**
58
- - Uses [kube-httpcache](https://github.com/mittwald/kube-httpcache) Helm chart
59
- - Cluster-wide cache invalidation
60
- - HTTP/2 support
61
- - Configurable VCL
62
- - Prometheus metrics export
63
-
64
- **Benefits**
65
- - Reduced backend load
66
- - Improved response times
67
- - Better scalability
68
- - Automatic cache invalidation on content changes
69
-
70
- ### Caching options
71
-
72
- cdk8s-plone supports two HTTP caching approaches:
73
-
74
- **PloneHttpcache (mittwald/kube-httpcache)**
75
- - Self-contained: deploys Varnish via Helm chart, no operator needed
76
- - Full VCL template with Go template variable injection
77
- - Prometheus exporter sidecar for metrics
78
-
79
- **PloneVinylCache (cloud-vinyl operator)**
80
- - Operator-managed: creates a VinylCache custom resource
81
- - Structured VCL generation with snippet injection hooks
82
- - Built-in cache invalidation proxy (PURGE, BAN, xkey)
83
- - Agent-based VCL delivery and Prometheus metrics
84
- - Requires the [cloud-vinyl operator](https://github.com/bluedynamics/cloud-vinyl) in the cluster
85
-
86
- Choose PloneHttpcache for standalone deployments without cloud-vinyl. Choose PloneVinylCache when the operator is available for centralized cache management.
87
-
88
- ### Multi-language support
89
-
90
- The library is published in multiple languages:
91
-
92
- **TypeScript/JavaScript**
93
- - Native CDK8S experience
94
- - Full TypeScript types
95
- - Published to npm: `@bluedynamics/cdk8s-plone`
96
-
97
- **Python**
98
- - JSII-generated Python bindings
99
- - Pythonic API
100
- - Published to PyPI: `cdk8s-plone`
101
-
102
- ## Architecture diagram
103
-
104
- ```mermaid
105
- graph TB
106
- subgraph "External access"
107
- Client[Client / Browser]
108
- Ingress[Ingress Controller]
109
- end
110
-
111
- subgraph "Cache layer (optional)"
112
- Varnish[Varnish<br/>PloneHttpcache or PloneVinylCache]
113
- end
114
-
115
- subgraph "Frontend (Volto variant only)"
116
- FrontendSvc[Frontend Service]
117
- Frontend1[Frontend Pod]
118
- Frontend2[Frontend Pod]
119
- end
120
-
121
- subgraph "Backend (REST API for Volto, HTML for Blicca)"
122
- BackendSvc[Backend Service]
123
- Backend1[Backend Pod]
124
- Backend2[Backend Pod]
125
- end
126
-
127
- subgraph "Data layer"
128
- DB[(PostgreSQL<br/>with RelStorage)]
129
- end
130
-
131
- Client --> Ingress
132
- Ingress --> Varnish
133
- Varnish -.Volto: cache miss.-> FrontendSvc
134
- Varnish -.Blicca: cache miss.-> BackendSvc
135
- Varnish -.invalidation.-> BackendSvc
136
-
137
- FrontendSvc --> Frontend1
138
- FrontendSvc --> Frontend2
139
-
140
- Frontend1 --> BackendSvc
141
- Frontend2 --> BackendSvc
142
-
143
- BackendSvc --> Backend1
144
- BackendSvc --> Backend2
145
-
146
- Backend1 --> DB
147
- Backend2 --> DB
148
- ```
149
-
150
- ## Component responsibilities
151
-
152
- ### Backend
153
-
154
- **Responsibilities:**
155
- - Plone REST API
156
- - Content management
157
- - ZODB with RelStorage (external database)
158
- - Search indexing
159
- - Workflow engine
160
-
161
- **Resources:**
162
- - CPU: Compute-intensive operations (catalog queries, indexing)
163
- - Memory: ZODB cache, Python processes
164
- - Storage: Delegated to external database (PostgreSQL/MySQL/Oracle)
165
-
166
- **Scaling:**
167
- - Horizontal: Add replicas for read scalability with RelStorage
168
- - Vertical: Increase resources for large catalogs
169
- - External database handles storage and multi-writer scenarios
170
-
171
- ### Frontend (Volto)
172
-
173
- **Responsibilities:**
174
- - React single-page application
175
- - Server-side rendering (SSR)
176
- - API client
177
- - User interface
178
-
179
- **Resources:**
180
- - CPU: SSR rendering, JavaScript execution
181
- - Memory: Node.js processes, SSR caching
182
- - Storage: Minimal (build artifacts only)
183
-
184
- **Scaling:**
185
- - Horizontal: Add replicas for traffic handling
186
- - Vertical: Increase resources for SSR performance
187
- - No shared storage needed (stateless)
188
-
189
- ### HTTP Cache (Varnish)
190
-
191
- **Responsibilities:**
192
- - HTTP caching
193
- - Cache invalidation
194
- - Request routing
195
- - Load distribution
196
-
197
- **Resources:**
198
- - CPU: Request processing, cache lookup
199
- - Memory: Cache storage
200
- - Storage: Not required (in-memory cache)
201
-
202
- **Scaling:**
203
- - Horizontal: Add replicas for cache distribution
204
- - Vertical: Increase memory for larger cache
205
-
206
- ## Kubernetes resources created
207
-
208
- For a typical Volto deployment, cdk8s-plone creates:
209
-
210
- **Backend:**
211
- - Deployment (backend pods)
212
- - Service (internal)
213
- - PodDisruptionBudget (optional)
214
- - ConfigMap (optional, for configuration)
215
-
216
- **Frontend:**
217
- - Deployment (frontend pods)
218
- - Service (internal)
219
- - PodDisruptionBudget (optional)
220
-
221
- **HTTP Cache (optional):**
222
- - StatefulSet (Varnish pods)
223
- - Service (entry point)
224
- - ConfigMap (VCL configuration)
225
- - Secret (admin credentials)
226
- - ServiceMonitor (optional, for Prometheus)
227
-
228
- ## Design decisions
229
-
230
- ### CDK8S constructs
231
-
232
- **Why CDK8S?**
233
- - Type-safe infrastructure as code
234
- - Reusable components
235
- - Familiar programming languages
236
- - No templating required
237
- - IDE support and IntelliSense
238
-
239
- **Benefits:**
240
- - Reduced boilerplate
241
- - Better error detection
242
- - Easier testing
243
- - Composition over configuration
244
-
245
- ### Separate frontend and backend
246
-
247
- **Volto Architecture:**
248
- - Independent scaling of frontend and backend
249
- - Frontend can be restarted without affecting backend
250
- - Better resource utilization
251
- - Clear separation of concerns
252
-
253
- **When to use Blicca:**
254
- - Simpler deployment model
255
- - Lower resource requirements
256
- - Legacy integrations
257
- - Specific add-on requirements
258
-
259
- ### Optional Varnish layer
260
-
261
- **Design Choice:**
262
- - Varnish is optional, not mandatory
263
- - Uses established Helm chart (kube-httpcache)
264
- - Cluster-wide cache invalidation
265
- - Production-tested solution
266
-
267
- **Trade-offs:**
268
- - Additional complexity
269
- - More resources required
270
- - Better performance at scale
271
- - Reduced backend load
272
-
273
- ### Health probes
274
-
275
- **Readiness Probe:**
276
- - Enabled by default for backend
277
- - Prevents traffic to unready pods
278
- - Fast startup detection
279
-
280
- **Liveness Probe:**
281
- - Disabled by default for backend (Plone is resilient)
282
- - Recommended enabled for frontend (detect SSR hangs)
283
- - Configurable thresholds
284
-
285
- ## Production considerations
286
-
287
- ### Resource planning
288
-
289
- **Backend:**
290
- - Plan for catalog size and query complexity
291
- - ZODB cache size affects memory needs
292
- - Indexing operations are CPU-intensive
293
-
294
- **Frontend:**
295
- - SSR requires CPU resources
296
- - Memory for Node.js processes
297
- - Scale based on traffic patterns
298
-
299
- **Cache:**
300
- - Memory size determines cache capacity
301
- - Monitor hit rates and adjust sizing
302
-
303
- ### High availability
304
-
305
- **Recommendations:**
306
- - Minimum 2 replicas per component
307
- - Configure PodDisruptionBudgets
308
- - Use node affinity for distribution
309
- - Enable health probes
310
-
311
- **Database:**
312
- - External database required (PostgreSQL, MySQL, or Oracle)
313
- - Uses RelStorage for ZODB persistence
314
- - Enables true multi-writer deployments
315
- - Better backup and recovery options
316
- - MySQL derivatives (MariaDB, Percona) and Oracle are supported but untested
317
-
318
- ### Monitoring
319
-
320
- **Metrics to Track:**
321
- - Pod resource usage (CPU, memory)
322
- - Request rates and latencies
323
- - Cache hit rates
324
- - Error rates
325
- - Health probe failures
326
-
327
- **Tools:**
328
- - Prometheus for metrics collection
329
- - Grafana for visualization
330
- - Kubernetes events monitoring
331
-
332
- ## See also
333
-
334
- - {doc}`features` — Feature overview and deployment variants.
335
- - {doc}`/reference/configuration-options` — Complete configuration reference.
336
- - {doc}`/tutorials/01-quick-start` — Getting started tutorial.
@@ -1,66 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
4
- "description": "How cdk8s-plone fits into the cdk8s workflow: constructs, synthesis to Kubernetes manifests, and applying them by hand or through GitOps."
5
- "property=og:description": "How cdk8s-plone fits into the cdk8s workflow: constructs, synthesis to Kubernetes manifests, and applying them by hand or through GitOps."
6
- "property=og:title": "About the cdk8s workflow"
7
- "keywords": "Plone, cdk8s, Kubernetes, synth, constructs, GitOps, ArgoCD, Helm"
8
- ---
9
-
10
- # About the cdk8s workflow
11
-
12
- This page explains where `cdk8s-plone` sits in the cdk8s workflow and why that workflow looks the way it does.
13
- It is background reading, not a set of steps; for the steps, see {doc}`/tutorials/01-quick-start`.
14
-
15
- ## Code, synth, apply
16
-
17
- [cdk8s](https://cdk8s.io/) is a framework for defining Kubernetes resources in a general-purpose programming language.
18
- You write TypeScript or Python that constructs objects, run a synthesis step, and get plain Kubernetes YAML.
19
- Nothing about cdk8s talks to a cluster: it is a manifest generator.
20
-
21
- The workflow has three distinct phases, and keeping them apart explains most of how cdk8s-plone behaves.
22
- First you write code that instantiates constructs inside an `App` and one or more `Chart` objects.
23
- Then you run `cdk8s synth`, which evaluates that code and writes Kubernetes manifests into the `dist/` directory.
24
- Finally you apply those manifests to a cluster, either with `kubectl apply` or through a GitOps controller.
25
-
26
- The separation matters because the manifests are an ordinary, reviewable artifact.
27
- You can read the YAML, diff it across changes, and run policy checks on it before anything reaches the cluster.
28
-
29
- ## Where cdk8s-plone fits
30
-
31
- `cdk8s-plone` is a construct library, not an application you run.
32
- You compose its constructs, mainly `Plone` and one of the cache constructs, inside your own cdk8s app.
33
- A construct is a reusable building block: `Plone` expands into the Deployments, Services, and optional PodDisruptionBudget and ServiceMonitor that a Plone site needs, with production-minded defaults you can override.
34
-
35
- This is the same idea as a Helm chart or a Kustomize base, but expressed in code rather than templated YAML.
36
- Because the inputs are typed options rather than free-form values, your editor and the compiler catch mistakes before synthesis, and the {doc}`API reference </reference/api/index>` is generated from those types.
37
-
38
- ## Synthesis time versus apply time
39
-
40
- The two cache constructs illustrate the phase distinction well, because they resolve at different times.
41
-
42
- `PloneHttpcache` renders the mittwald kube-httpcache Helm chart during synthesis.
43
- It shells out to the `helm` CLI, so `helm` must be present where you run `cdk8s synth`, and the chart's resources land in your `dist/` output as ordinary manifests.
44
-
45
- `PloneVinylCache` instead emits a `VinylCache` custom resource.
46
- That resource does nothing on its own; the cloud-vinyl operator reconciles it at apply time and creates the underlying Varnish deployment in the cluster.
47
- The work happens later, and in a different place, than the synthesis that produced the manifest.
48
-
49
- Neither approach is universally better.
50
- Rendering at synthesis keeps everything in one reviewable artifact, while delegating to an operator keeps the cluster as the source of truth and lets the operator manage the cache over its lifetime.
51
- For the practical trade-offs between the two caches, see {doc}`architecture`.
52
-
53
- ## Applying by hand or through GitOps
54
-
55
- Because synthesis produces plain YAML, you can apply it however you already deploy Kubernetes resources.
56
- A small project applies `dist/` directly with `kubectl`.
57
- A larger one commits the synthesized manifests to a repository and lets a GitOps controller such as Argo CD or Flux reconcile them, so the cluster always matches what is in version control.
58
-
59
- A common middle path runs `cdk8s synth` in continuous integration and publishes the result, so the synthesis is reproducible and the applied manifests are auditable.
60
- In every case the cdk8s-plone code stays the single definition of the deployment, and the manifests are a derived, inspectable product of it.
61
-
62
- ## See also
63
-
64
- - {doc}`architecture` — the components a `Plone` construct creates and how they relate.
65
- - {doc}`/tutorials/01-quick-start` — the workflow applied end to end.
66
- - [cdk8s documentation](https://cdk8s.io/docs/latest/) — the framework this builds on.