@bluedynamics/cdk8s-plone 0.1.43 → 0.1.44

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 (73) hide show
  1. package/.jsii +24 -23
  2. package/API.md +6 -2
  3. package/README.md +3 -3
  4. package/documentation/sources/conf.py +55 -29
  5. package/documentation/sources/explanation/architecture.md +14 -16
  6. package/documentation/sources/explanation/cdk8s-workflow.md +66 -0
  7. package/documentation/sources/explanation/index.md +1 -27
  8. package/documentation/sources/how-to/backup-and-restore.md +107 -0
  9. package/documentation/sources/how-to/configure-env-and-secrets.md +184 -0
  10. package/documentation/sources/how-to/configure-ingress-tls.md +108 -0
  11. package/documentation/sources/how-to/configure-security-context.md +0 -5
  12. package/documentation/sources/how-to/deploy-blicca.md +8 -8
  13. package/documentation/sources/how-to/{deploy-production-volto.md → deploy-volto.md} +20 -25
  14. package/documentation/sources/how-to/deploy-with-httpcache.md +224 -0
  15. package/documentation/sources/how-to/deploy-with-vinyl-cache.md +0 -5
  16. package/documentation/sources/how-to/enable-prometheus-monitoring.md +4 -5
  17. package/documentation/sources/how-to/index.md +15 -8
  18. package/documentation/sources/how-to/scale-and-high-availability.md +122 -0
  19. package/documentation/sources/how-to/schedule-pods.md +0 -5
  20. package/documentation/sources/how-to/troubleshooting.md +113 -0
  21. package/documentation/sources/how-to/upgrade-and-rollout.md +89 -0
  22. package/documentation/sources/index.md +3 -11
  23. package/documentation/sources/reference/api/index.md +6 -4
  24. package/documentation/sources/reference/configuration-options.md +85 -516
  25. package/documentation/sources/reference/index.md +16 -43
  26. package/documentation/sources/tutorials/01-quick-start.md +1 -1
  27. package/documentation/sources/tutorials/index.md +7 -11
  28. package/examples/blicca/.env.example +3 -2
  29. package/examples/blicca/README.md +21 -24
  30. package/examples/blicca/__snapshots__/main.test.ts.snap +138 -345
  31. package/examples/blicca/main.test.ts +7 -0
  32. package/examples/blicca/main.ts +8 -7
  33. package/examples/blicca/postgres.plain.ts +115 -0
  34. package/examples/blicca/tsconfig.json +33 -0
  35. package/examples/{production-volto → volto}/.env.example +3 -2
  36. package/examples/{production-volto → volto}/README.md +20 -23
  37. package/examples/{production-volto → volto}/__snapshots__/main.test.ts.snap +139 -345
  38. package/examples/{production-volto → volto}/main.test.ts +7 -0
  39. package/examples/{production-volto → volto}/main.ts +8 -7
  40. package/examples/{production-volto → volto}/package.json +1 -1
  41. package/examples/volto/postgres.plain.ts +115 -0
  42. package/examples/volto/tsconfig.json +33 -0
  43. package/lib/httpcache.js +1 -1
  44. package/lib/imports/vinyl.bluedynamics.eu.d.ts +4011 -53
  45. package/lib/imports/vinyl.bluedynamics.eu.js +1786 -157
  46. package/lib/plone.js +1 -1
  47. package/lib/vinylcache.d.ts +3 -1
  48. package/lib/vinylcache.js +3 -2
  49. package/package.json +1 -1
  50. package/documentation/sources/_static/brand-theme.css +0 -685
  51. package/documentation/sources/_static/custom-icons.css +0 -123
  52. package/documentation/sources/_static/fonts/hack/Hack-Regular.woff2 +0 -0
  53. package/documentation/sources/_static/fonts/orbitron/Orbitron-Black.woff2 +0 -11
  54. package/documentation/sources/_static/fonts/orbitron/Orbitron-Bold.woff2 +0 -11
  55. package/documentation/sources/_static/fonts/orbitron/Orbitron-Regular.woff2 +0 -0
  56. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-Bold.woff2 +0 -11
  57. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-Medium.woff2 +0 -11
  58. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-Regular.woff2 +0 -11
  59. package/documentation/sources/_static/fonts/rajdhani/Rajdhani-SemiBold.woff2 +0 -11
  60. package/documentation/sources/_static/kup6s-icon-explanation.svg +0 -32
  61. package/documentation/sources/_static/kup6s-icon-howto.svg +0 -34
  62. package/documentation/sources/_static/kup6s-icon-reference.svg +0 -34
  63. package/documentation/sources/_static/kup6s-icon-tutorials.svg +0 -30
  64. package/documentation/sources/_static/logo-fix.js +0 -12
  65. package/documentation/sources/reference/api/.gitkeep +0 -1
  66. package/examples/blicca/postgres.bitnami.ts +0 -49
  67. package/examples/production-volto/postgres.bitnami.ts +0 -49
  68. /package/documentation/sources/_static/{kup6s-icon-plone.svg → logo.svg} +0 -0
  69. /package/examples/{production-volto → volto}/cdk8s.yaml +0 -0
  70. /package/examples/{production-volto → volto}/config/varnish.tpl.vcl +0 -0
  71. /package/examples/{production-volto → volto}/ingress.ts +0 -0
  72. /package/examples/{production-volto → volto}/jest.config.js +0 -0
  73. /package/examples/{production-volto → volto}/postgres.cloudnativepg.ts +0 -0
@@ -1,142 +1,84 @@
1
1
  ---
2
2
  myst:
3
3
  html_meta:
4
- "description": "Complete reference for cdk8s-plone constructs and configuration options: Plone, PloneHttpcache, PloneVinylCache."
5
- "property=og:description": "Complete reference for cdk8s-plone constructs and configuration options: Plone, PloneHttpcache, PloneVinylCache."
6
- "property=og:title": "Configuration options"
7
- "keywords": "Plone, cdk8s, Kubernetes, configuration, reference, Volto, Varnish"
4
+ "description": "Task-oriented configuration guide for cdk8s-plone with copy-pasteable examples, linking to the generated API reference."
5
+ "property=og:description": "Task-oriented configuration guide for cdk8s-plone with copy-pasteable examples, linking to the generated API reference."
6
+ "property=og:title": "Configuration guide"
7
+ "keywords": "Plone, cdk8s, Kubernetes, configuration, Volto, Blicca, Varnish"
8
8
  ---
9
9
 
10
- # Configuration options
10
+ # Configuration guide
11
11
 
12
- Complete reference for all configuration options in cdk8s-plone.
12
+ This guide shows the most common ways to configure cdk8s-plone, grouped by task, with copy-pasteable examples.
13
13
 
14
- ## Key constructs
15
-
16
- ### `Plone`
17
-
18
- Main construct for deploying Plone CMS. Supports two variants:
19
- - **VOLTO**: React single-page frontend talking to the REST API backend (default)
20
- - **BLICCA**: the Plone backend renders the UI server-side and serves HTML directly
14
+ ```{important}
15
+ For the complete and authoritative list of every construct, option, type, default value, and whether it is required, see the {doc}`API reference <api/index>`.
16
+ That reference is generated from the TypeScript source, so it never drifts.
17
+ This guide is hand-written orientation and deliberately does **not** repeat the full option tables.
18
+ ```
21
19
 
22
- **Properties:**
23
- - `backendServiceName` - Name of the backend Kubernetes service
24
- - `frontendServiceName` - Name of the frontend service (VOLTO only)
25
- - `variant` - Deployment variant (VOLTO or BLICCA)
26
- - `siteId` - Plone site ID in ZODB (default: 'Plone')
20
+ ## Constructs at a glance
27
21
 
28
- **Example:**
29
- ```typescript
30
- import { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';
22
+ `Plone`
23
+ : Deploys the Plone backend and, for the Volto variant, the React frontend, plus their services and (optionally) a `PodDisruptionBudget` and `ServiceMonitor`. This is the entry point.
31
24
 
32
- new Plone(chart, 'my-plone', {
33
- variant: PloneVariant.VOLTO,
34
- siteId: 'MySite',
35
- backend: {
36
- image: 'plone/plone-backend:6.1.3',
37
- replicas: 3,
38
- },
39
- frontend: {
40
- image: 'plone/plone-frontend:16.0.0',
41
- replicas: 2,
42
- },
43
- });
44
- ```
25
+ `PloneHttpcache`
26
+ : Adds a Varnish caching layer through the mittwald [kube-httpcache](https://github.com/mittwald/kube-httpcache) Helm chart. Self-contained: it needs no operator in the cluster.
45
27
 
46
- ---
28
+ `PloneVinylCache`
29
+ : Adds a Varnish caching layer through the [cloud-vinyl](https://github.com/bluedynamics/cloud-vinyl) operator. Requires the operator to be installed in the cluster.
47
30
 
48
- ### `PloneHttpcache`
31
+ To choose between the two cache constructs, read {doc}`/explanation/architecture`.
49
32
 
50
- Varnish HTTP caching layer using the [kube-httpcache](https://github.com/mittwald/kube-httpcache) Helm chart. Provides cluster-wide cache invalidation.
33
+ ## Choose a frontend variant
51
34
 
52
- **Properties:**
53
- - `httpcacheServiceName` - Name of the Varnish service
35
+ The `Plone` construct deploys one of two frontends, selected with `variant`:
54
36
 
55
- **Example:**
56
37
  ```typescript
57
- import { PloneHttpcache } from '@bluedynamics/cdk8s-plone';
38
+ import { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';
58
39
 
59
- new PloneHttpcache(chart, 'cache', {
60
- plone: ploneInstance,
61
- existingSecret: 'varnish-secret',
62
- replicas: 2,
40
+ // Volto: React single-page frontend talking to the REST API backend (default).
41
+ new Plone(chart, 'plone', {
42
+ variant: PloneVariant.VOLTO,
43
+ backend: {},
44
+ frontend: {},
63
45
  });
64
- ```
65
-
66
- ---
67
-
68
- ## Configuration interfaces
69
-
70
- ### `PloneOptions`
71
46
 
72
- Main configuration interface for the Plone construct.
73
-
74
- | Property | Type | Required | Default | Description |
75
- |----------|------|----------|---------|-------------|
76
- | `version` | `string` | No | - | Version of your project |
77
- | `siteId` | `string` | No | `'Plone'` | Plone site ID in ZODB |
78
- | `variant` | `PloneVariant` | No | `VOLTO` | Deployment variant (VOLTO or BLICCA) |
79
- | `backend` | `PloneBaseOptions` | Yes | - | Backend configuration |
80
- | `frontend` | `PloneBaseOptions` | Conditional | - | Frontend configuration (required for VOLTO) |
81
- | `imagePullSecrets` | `string[]` | No | - | Image pull secrets for private registries |
82
-
83
- **Example:**
84
- ```typescript
85
- const options: PloneOptions = {
86
- version: '1.0.0',
87
- siteId: 'MySite',
88
- variant: PloneVariant.VOLTO,
89
- backend: { /* ... */ },
90
- frontend: { /* ... */ },
91
- imagePullSecrets: ['my-registry-secret'],
92
- };
47
+ // Blicca: the backend renders the UI server-side, so there is no separate frontend.
48
+ new Plone(chart, 'plone', {
49
+ variant: PloneVariant.BLICCA,
50
+ backend: {},
51
+ });
93
52
  ```
94
53
 
95
- ---
54
+ ```{note}
55
+ `PloneVariant.CLASSICUI` is a deprecated alias for `PloneVariant.BLICCA`, kept for backward compatibility.
56
+ It keeps its legacy value (`'classicui'`), so existing configuration keeps working unchanged.
57
+ The alias will be removed in a future major release.
58
+ ```
96
59
 
97
- ### `PloneBaseOptions`
60
+ For the conceptual difference between the variants, see {ref}`deployment-variants`.
98
61
 
99
- Configuration for backend or frontend components.
62
+ ## Configure the backend and frontend
100
63
 
101
- #### Container configuration
64
+ Both `backend` and `frontend` take the same options (`PloneBaseOptions`).
65
+ The examples below cover the common groups.
66
+ See the {doc}`API reference <api/index>` for every field, its type, and its default.
102
67
 
103
- | Property | Type | Required | Default | Description |
104
- |----------|------|----------|---------|-------------|
105
- | `image` | `string` | No | `plone/plone-backend:latest` (backend) / `plone/plone-frontend:latest` (frontend) | Container image |
106
- | `imagePullPolicy` | `string` | No | `IfNotPresent` | Image pull policy |
107
- | `replicas` | `number` | No | `2` | Number of pod replicas |
108
- | `environment` | `Env` | No | - | Environment variables (cdk8s-plus-30 `Env`) |
68
+ ### Images and replicas
109
69
 
110
- **Example:**
111
70
  ```typescript
112
- import { Env } from 'cdk8s-plus-30';
113
-
114
71
  backend: {
115
72
  image: 'plone/plone-backend:6.1.3',
116
73
  replicas: 3,
117
74
  imagePullPolicy: 'Always',
118
- environment: {
119
- variables: {
120
- SITE: Env.value('MySite'),
121
- DEBUG_MODE: Env.value('off'),
122
- },
123
- },
124
75
  }
125
76
  ```
126
77
 
127
- #### Resource configuration
78
+ ### Resource requests and limits
128
79
 
129
- | Property | Type | Default | Description |
130
- |----------|------|---------|-------------|
131
- | `requestCpu` | `string` | `200m` | CPU request |
132
- | `limitCpu` | `string` | `500m` | CPU limit |
133
- | `requestMemory` | `string` | `256Mi` | Memory request |
134
- | `limitMemory` | `string` | `512Mi` (backend) / `1Gi` (frontend) | Memory limit |
135
-
136
- **Example:**
137
80
  ```typescript
138
81
  backend: {
139
- image: 'plone/plone-backend:6.1.3',
140
82
  requestCpu: '500m',
141
83
  limitCpu: '2',
142
84
  requestMemory: '512Mi',
@@ -144,112 +86,36 @@ backend: {
144
86
  }
145
87
  ```
146
88
 
147
- #### High availability
89
+ ### High availability
148
90
 
149
- | Property | Type | Description |
150
- |----------|------|-------------|
151
- | `minAvailable` | `number \| string` | Minimum pods available during updates (for PodDisruptionBudget). Accepts an absolute number or a percentage string such as `"50%"`. |
152
- | `maxUnavailable` | `number \| string` | Maximum unavailable pods during updates. Accepts an absolute number or a percentage string such as `"50%"`. |
91
+ A `PodDisruptionBudget` is created automatically when `replicas` is `2` or more, or when you set `minAvailable` or `maxUnavailable` explicitly.
92
+ Both accept an absolute number or a percentage string such as `"50%"`.
153
93
 
154
- **Example:**
155
94
  ```typescript
156
95
  backend: {
157
- image: 'plone/plone-backend:6.1.3',
158
96
  replicas: 5,
159
- minAvailable: 3, // At least 3 pods must be available during updates
97
+ minAvailable: 3, // keep at least 3 pods available during voluntary disruptions
160
98
  }
161
99
  ```
162
100
 
163
- #### Readiness probe
101
+ ### Probes
164
102
 
165
- | Property | Type | Default | Description |
166
- |----------|------|---------|-------------|
167
- | `readinessEnabled` | `boolean` | `true` | Enable readiness probe |
168
- | `readinessInitialDelaySeconds` | `number` | `10` | Seconds before first probe |
169
- | `readinessTimeoutSeconds` | `number` | `15` | Probe timeout |
170
- | `readinessPeriodSeconds` | `number` | `10` | Probe frequency |
171
- | `readinessSuccessThreshold` | `number` | `1` | Consecutive successes required |
172
- | `readinessFailureThreshold` | `number` | `3` | Consecutive failures before marking unready |
103
+ Readiness probes are enabled by default; liveness probes are **disabled** by default.
173
104
 
174
- **Example:**
175
105
  ```typescript
176
- backend: {
177
- image: 'plone/plone-backend:6.1.3',
106
+ frontend: {
178
107
  readinessEnabled: true,
179
108
  readinessInitialDelaySeconds: 10,
180
- readinessTimeoutSeconds: 5,
181
- readinessPeriodSeconds: 10,
182
- readinessFailureThreshold: 3,
183
- }
184
- ```
185
-
186
- #### Liveness probe
187
-
188
- | Property | Type | Default | Description |
189
- |----------|------|---------|-------------|
190
- | `livenessEnabled` | `boolean` | `false` | Enable liveness probe (recommended `true` for frontend) |
191
- | `livenessInitialDelaySeconds` | `number` | `30` | Seconds before first probe |
192
- | `livenessTimeoutSeconds` | `number` | `5` | Probe timeout |
193
- | `livenessPeriodSeconds` | `number` | `10` | Probe frequency |
194
- | `livenessSuccessThreshold` | `number` | `1` | Consecutive successes required |
195
- | `livenessFailureThreshold` | `number` | `3` | Consecutive failures before restart |
196
-
197
- **Example:**
198
- ```typescript
199
- frontend: {
200
- image: 'plone/plone-frontend:16.0.0',
201
- livenessEnabled: true, // Recommended for frontend
109
+ livenessEnabled: true, // opt in; useful for the frontend
202
110
  livenessInitialDelaySeconds: 30,
203
- livenessTimeoutSeconds: 5,
204
- livenessPeriodSeconds: 30,
205
- livenessFailureThreshold: 3,
206
- }
207
- ```
208
-
209
- #### Annotations
210
-
211
- | Property | Type | Description |
212
- |----------|------|-------------|
213
- | `annotations` | `Record<string, string>` | Deployment metadata annotations |
214
- | `podAnnotations` | `Record<string, string>` | Pod template annotations (e.g., for Prometheus) |
215
- | `serviceAnnotations` | `Record<string, string>` | **Deprecated.** Use `service.annotations` instead. Service annotations (e.g., for external-dns) |
216
-
217
- **Example:**
218
- ```typescript
219
- backend: {
220
- image: 'plone/plone-backend:6.1.3',
221
- podAnnotations: {
222
- 'prometheus.io/scrape': 'true',
223
- 'prometheus.io/port': '8080',
224
- },
225
- serviceAnnotations: {
226
- 'external-dns.alpha.kubernetes.io/hostname': 'backend.example.com',
227
- },
228
111
  }
229
112
  ```
230
113
 
231
- #### Service
114
+ ### Service
232
115
 
233
116
  Configure the generated Kubernetes `Service` through the grouped `service` option.
234
- The `service` option is available on both `backend` and `frontend`.
235
- Curated fields cover the common cases.
236
- The `overrides` field is an escape hatch for any other `ServiceSpec` field, and it has the highest precedence.
237
-
238
- | Property | Type | Description |
239
- |----------|------|-------------|
240
- | `service.type` | `string` | Service type: `ClusterIP` (default), `NodePort`, `LoadBalancer`, or `ExternalName` |
241
- | `service.trafficDistribution` | `string` | Traffic distribution preference, for example `PreferClose` |
242
- | `service.sessionAffinity` | `string` | Session affinity: `ClientIP` or `None` |
243
- | `service.externalTrafficPolicy` | `string` | External traffic policy: `Cluster` or `Local` |
244
- | `service.internalTrafficPolicy` | `string` | Internal traffic policy: `Cluster` or `Local` |
245
- | `service.publishNotReadyAddresses` | `boolean` | Publish not-ready addresses |
246
- | `service.loadBalancerClass` | `string` | Load balancer implementation class |
247
- | `service.loadBalancerSourceRanges` | `string[]` | Allowed source IP ranges for a `LoadBalancer` service |
248
- | `service.annotations` | `Record<string, string>` | Service metadata annotations (replaces `serviceAnnotations`) |
249
- | `service.labels` | `Record<string, string>` | Extra Service metadata labels |
250
- | `service.overrides` | `Record<string, any>` | Raw `ServiceSpec` overrides as a free-form map, with the highest precedence |
251
-
252
- **Example:**
117
+ Curated fields cover the common cases; `service.overrides` is an escape hatch for any other `ServiceSpec` field and has the highest precedence.
118
+
253
119
  ```typescript
254
120
  backend: {
255
121
  service: {
@@ -266,342 +132,64 @@ backend: {
266
132
  }
267
133
  ```
268
134
 
269
- (monitoring)=
270
-
271
- #### Prometheus monitoring
272
-
273
- | Property | Type | Default | Description |
274
- |----------|------|---------|-------------|
275
- | `servicemonitor` | `boolean` | `false` | Create a Prometheus `ServiceMonitor` for this component. Requires the Prometheus Operator. |
276
- | `metricsPort` | `string \| number` | main service port | Service port name or number that exposes metrics. |
277
- | `metricsPath` | `string` | `/metrics` | HTTP path the Prometheus scraper requests. |
278
-
279
- You must instrument the backend or frontend container to expose metrics at the configured endpoint.
280
- For step-by-step setup, see {doc}`/how-to/enable-prometheus-monitoring`.
281
-
282
- **Example:**
283
- ```typescript
284
- backend: {
285
- image: 'plone/plone-backend:6.1.3',
286
- servicemonitor: true,
287
- metricsPath: '/metrics',
288
- },
289
- frontend: {
290
- image: 'plone/plone-frontend:16.0.0',
291
- servicemonitor: true,
292
- metricsPort: 9090,
293
- }
135
+ ```{note}
136
+ The top-level `serviceAnnotations` option is deprecated. Use `service.annotations` instead.
294
137
  ```
295
138
 
296
- #### Scheduling
297
-
298
- | Property | Type | Default | Description |
299
- |----------|------|---------|-------------|
300
- | `nodeSelector` | `Record<string, string>` | - | Constrain pods to nodes whose labels match all entries. |
139
+ ### Environment variables
301
140
 
302
- For tainted nodes and taint-based scheduling, see {doc}`/how-to/schedule-pods`.
141
+ Pass environment variables with the cdk8s-plus `Env` API, including values sourced from a `Secret`.
303
142
 
304
- **Example:**
305
143
  ```typescript
144
+ import { Env } from 'cdk8s-plus-30';
145
+
306
146
  backend: {
307
- image: 'plone/plone-backend:6.1.3',
308
- nodeSelector: {
309
- 'topology.kubernetes.io/region': 'fsn1',
147
+ environment: {
148
+ variables: {
149
+ RELSTORAGE_DSN: Env.fromSecret(dbSecret, 'dsn'),
150
+ },
310
151
  },
311
152
  }
312
153
  ```
313
154
 
314
- #### Security context
315
-
316
- | Property | Type | Default | Description |
317
- |----------|------|---------|-------------|
318
- | `securityContext` | `PloneSecurityContext` | - | Container security settings (capabilities, UID/GID, read-only root, privilege escalation). |
155
+ ### Annotations, scheduling, security, and monitoring
319
156
 
320
- **`PloneSecurityContext` fields:**
157
+ These groups each have a dedicated how-to guide:
321
158
 
322
- | Property | Type | Description |
323
- |----------|------|-------------|
324
- | `capabilities` | `PloneCapabilities` | Linux capabilities to add or drop. |
325
- | `runAsUser` | `number` | Run the container as this UID. |
326
- | `runAsGroup` | `number` | Run the container as this GID. |
327
- | `runAsNonRoot` | `boolean` | Require the container to run as non-root. |
328
- | `readOnlyRootFilesystem` | `boolean` | Mount the root filesystem read-only. |
329
- | `allowPrivilegeEscalation` | `boolean` | Allow the process to gain more privileges than its parent. |
330
- | `privileged` | `boolean` | Run the container in privileged mode. |
331
-
332
- **`PloneCapabilities` fields:**
333
-
334
- | Property | Type | Description |
335
- |----------|------|-------------|
336
- | `add` | `string[]` | Capabilities to add (e.g., `'SYS_PTRACE'`). |
337
- | `drop` | `string[]` | Capabilities to drop (e.g., `'ALL'`). |
159
+ - {doc}`/how-to/schedule-pods` `nodeSelector` and `tolerations`
160
+ - {doc}`/how-to/configure-security-context` — `securityContext` hardening
161
+ - {doc}`/how-to/enable-prometheus-monitoring``servicemonitor`, `metricsPort`, `metricsPath`
338
162
 
339
- For a hardening walk-through, see {doc}`/how-to/configure-security-context`.
163
+ ## Add a cache
340
164
 
341
- **Example:**
342
165
  ```typescript
343
- backend: {
344
- image: 'plone/plone-backend:6.1.3',
345
- securityContext: {
346
- runAsNonRoot: true,
347
- runAsUser: 500,
348
- readOnlyRootFilesystem: true,
349
- allowPrivilegeEscalation: false,
350
- capabilities: {
351
- drop: ['ALL'],
352
- },
353
- },
354
- }
355
- ```
356
-
357
- ---
166
+ import { PloneHttpcache } from '@bluedynamics/cdk8s-plone';
358
167
 
359
- ### `PloneHttpcacheOptions`
360
-
361
- Configuration for the Varnish HTTP cache layer.
362
-
363
- | Property | Type | Required | Default | Description |
364
- |----------|------|----------|---------|-------------|
365
- | `plone` | `Plone` | Yes | - | Plone construct to attach cache to |
366
- | `varnishVcl` | `string` | No | - | VCL configuration as string. Takes precedence over `varnishVclFile`. |
367
- | `varnishVclFile` | `string` | No | built-in `config/varnish.tpl.vcl` | Path to a VCL template file |
368
- | `existingSecret` | `string` | No | - | Kubernetes secret for Varnish admin credentials |
369
- | `replicas` | `number` | No | `2` | Number of Varnish replicas |
370
- | `requestCpu` | `string` | No | `100m` | CPU request |
371
- | `limitCpu` | `string` | No | `500m` | CPU limit |
372
- | `requestMemory` | `string` | No | `100Mi` | Memory request |
373
- | `limitMemory` | `string` | No | `500Mi` | Memory limit |
374
- | `servicemonitor` | `boolean` | No | `false` | Enable Prometheus `ServiceMonitor` |
375
- | `exporterEnabled` | `boolean` | No | `true` | Enable Prometheus exporter sidecar |
376
- | `chartVersion` | `string` | No | chart latest | kube-httpcache Helm chart version |
377
- | `appVersion` | `string` | No | matches `chartVersion` | kube-httpcache container image tag |
378
- | `extraEnvVars` | `HttpcacheEnvVar[]` | No | - | Additional env vars for the kube-httpcache container |
379
- | `tolerations` | `HttpcacheToleration[]` | No | - | Pod tolerations for tainted nodes |
380
-
381
- **`HttpcacheEnvVar` fields:**
382
-
383
- | Property | Type | Description |
384
- |----------|------|-------------|
385
- | `name` | `string` | Environment variable name |
386
- | `value` | `string` | Environment variable value |
387
-
388
- **`HttpcacheToleration` fields:**
389
-
390
- | Property | Type | Default | Description |
391
- |----------|------|---------|-------------|
392
- | `key` | `string` | - | Taint key to tolerate |
393
- | `operator` | `string` | `Equal` | `Equal` or `Exists` |
394
- | `value` | `string` | - | Taint value (required for `Equal`) |
395
- | `effect` | `string` | - | `NoSchedule`, `PreferNoSchedule`, or `NoExecute`. Omit to tolerate all effects. |
396
-
397
- **Example:**
398
- ```typescript
168
+ // Self-contained Varnish via the kube-httpcache Helm chart.
399
169
  new PloneHttpcache(chart, 'cache', {
400
170
  plone: ploneInstance,
401
171
  existingSecret: 'varnish-secret',
402
- replicas: 3,
403
- requestCpu: '250m',
404
- limitCpu: '1',
405
- requestMemory: '256Mi',
406
- limitMemory: '1Gi',
407
- servicemonitor: true,
408
- exporterEnabled: true,
409
- });
410
- ```
411
-
412
- **VCL Configuration:**
413
- ```typescript
414
- // Inline VCL
415
- new PloneHttpcache(chart, 'cache', {
416
- plone: ploneInstance,
417
- varnishVcl: `
418
- vcl 4.1;
419
- backend default {
420
- .host = "backend-service";
421
- .port = "8080";
422
- }
423
- `,
424
- });
425
-
426
- // VCL from file
427
- new PloneHttpcache(chart, 'cache', {
428
- plone: ploneInstance,
429
- varnishVclFile: './varnish/default.vcl',
172
+ replicas: 2,
430
173
  });
431
174
  ```
432
175
 
433
- **Extra Environment Variables:**
434
-
435
- Pass additional environment variables to the kube-httpcache container.
436
- These are appended to the built-in env vars (`BACKEND_SERVICE_NAME`, `BACKEND_SERVICE_PORT`, `BACKEND_SITE_ID`, `FRONTEND_SERVICE_NAME`, `FRONTEND_SERVICE_PORT`) and can be referenced in VCL templates using Go template syntax `{{ .Env.VAR_NAME }}`.
437
-
438
176
  ```typescript
439
- new PloneHttpcache(chart, 'cache', {
440
- plone: ploneInstance,
441
- varnishVclFile: './config/custom-varnish.tpl.vcl',
442
- extraEnvVars: [
443
- { name: 'THUMBOR_SERVICE_NAME', value: 'my-thumbor-service' },
444
- ],
445
- });
446
- ```
447
-
448
- ---
177
+ import { PloneVinylCache } from '@bluedynamics/cdk8s-plone';
449
178
 
450
- ### `PloneVinylCacheOptions`
451
-
452
- Configuration for the Varnish HTTP cache layer via the cloud-vinyl operator.
453
- Requires the [cloud-vinyl operator](https://github.com/bluedynamics/cloud-vinyl) to be installed in the cluster.
454
-
455
- | Property | Type | Required | Default | Description |
456
- |----------|------|----------|---------|-------------|
457
- | `plone` | `Plone` | Yes | - | Plone construct to attach cache to |
458
- | `image` | `string` | No | `varnish:7.6` | Container image for the Varnish pods |
459
- | `replicas` | `number` | No | `2` | Number of Varnish replicas |
460
- | `requestCpu` | `string` | No | `100m` | CPU request |
461
- | `limitCpu` | `string` | No | `500m` | CPU limit |
462
- | `requestMemory` | `string` | No | `256Mi` | Memory request |
463
- | `limitMemory` | `string` | No | `512Mi` | Memory limit |
464
- | `storage` | `VinylCacheStorage[]` | No | - | Varnish storage backends. If omitted, the operator falls back to the varnishd default (~100 MB malloc), which is almost always too small. |
465
- | `extraBackends` | `VinylCacheBackend[]` | No | - | Additional backends appended after the auto-generated Plone backends. |
466
- | `director` | `string` | No | `shard` | Director type: `shard`, `round_robin`, `random`, `hash` |
467
- | `shardBy` | `string` | No | operator default (`HASH`) | Shard director: value to hash (`HASH` or `URL`). Requires cloud-vinyl ≥ 0.4.2. |
468
- | `shardHealthy` | `string` | No | operator default (`CHOSEN`) | Shard director: backend health requirement (`CHOSEN` or `ALL`). Requires cloud-vinyl ≥ 0.4.2. |
469
- | `shardRampup` | `string` | No | operator default (`30s`) | Shard director: ramp-up window for newly added backends. |
470
- | `shardReplicas` | `number` | No | operator default (`67`) | Shard director: Ketama replicas per backend. |
471
- | `vclRecvSnippet` | `string` | No | built-in `plone-vinyl-recv.vcl` | Custom VCL snippet for `vcl_recv` |
472
- | `vclBackendResponseSnippet` | `string` | No | built-in `plone-vinyl-backend-response.vcl` | Custom VCL snippet for `vcl_backend_response` |
473
- | `vclDeliverSnippet` | `string` | No | - | Custom VCL snippet for `vcl_deliver` |
474
- | `vclHitSnippet` | `string` | No | - | Custom VCL snippet for `vcl_hit` |
475
- | `vclMissSnippet` | `string` | No | - | Custom VCL snippet for `vcl_miss` |
476
- | `vclPassSnippet` | `string` | No | - | Custom VCL snippet for `vcl_pass` |
477
- | `vclPipeSnippet` | `string` | No | - | Custom VCL snippet for `vcl_pipe` |
478
- | `vclSynthSnippet` | `string` | No | - | Custom VCL snippet for `vcl_synth` |
479
- | `vclPurgeSnippet` | `string` | No | - | Custom VCL snippet for `vcl_purge` |
480
- | `vclHashSnippet` | `string` | No | - | Custom VCL snippet for `vcl_hash` |
481
- | `vclInitSnippet` | `string` | No | - | Custom VCL snippet for `vcl_init` |
482
- | `vclFiniSnippet` | `string` | No | - | Custom VCL snippet for `vcl_fini` |
483
- | `vclBackendFetchSnippet` | `string` | No | - | Custom VCL snippet for `vcl_backend_fetch` |
484
- | `vclBackendErrorSnippet` | `string` | No | - | Custom VCL snippet for `vcl_backend_error` |
485
- | `invalidation` | `boolean` | No | `true` | Enable PURGE/BAN/xkey cache invalidation |
486
- | `monitoring` | `boolean` | No | `false` | Enable Prometheus metrics and `ServiceMonitor` |
487
- | `tolerations` | `VinylCacheToleration[]` | No | - | Pod tolerations for tainted nodes |
488
- | `nodeSelector` | `Record<string, string>` | No | - | Constrain Varnish pods to nodes matching all labels. |
489
-
490
- **`VinylCacheStorage` fields:**
491
-
492
- | Property | Type | Required | Description |
493
- |----------|------|----------|-------------|
494
- | `name` | `string` | Yes | Internal storage identifier (must match `^[a-zA-Z][a-zA-Z0-9_]*$`) |
495
- | `type` | `'malloc' \| 'file'` | Yes | Storage backend type |
496
- | `size` | `string` | Yes | Kubernetes resource quantity (e.g. `"1Gi"`, `"500M"`) |
497
- | `path` | `string` | for `file` | Filesystem path for file-type storage |
498
-
499
- **`VinylCacheBackend` fields:**
500
-
501
- | Property | Type | Required | Default | Description |
502
- |----------|------|----------|---------|-------------|
503
- | `name` | `string` | Yes | - | VCL identifier (must match `^[a-zA-Z][a-zA-Z0-9_]*$`) |
504
- | `serviceName` | `string` | Yes | - | Kubernetes Service name to use as backend |
505
- | `port` | `number` | Yes | - | Service port |
506
- | `probe` | `VinylCacheBackendProbe` | No | - | Health probe configuration |
507
- | `weight` | `number` | No | operator default | Relative weight in the director. `0` marks the backend as standby. |
508
-
509
- **`VinylCacheBackendProbe` fields:**
510
-
511
- | Property | Type | Default | Description |
512
- |----------|------|---------|-------------|
513
- | `url` | `string` | `/` | URL to probe |
514
- | `interval` | `string` | `5s` | Probe interval |
515
- | `timeout` | `string` | `2s` | Probe timeout |
516
- | `window` | `number` | `10` | Number of recent probes evaluated |
517
- | `threshold` | `number` | `8` | Healthy threshold within the window |
518
- | `expectedResponse` | `number` | `200` | Expected HTTP status code |
519
-
520
- **`VinylCacheToleration` fields:**
521
-
522
- | Property | Type | Default | Description |
523
- |----------|------|---------|-------------|
524
- | `key` | `string` | - | Taint key to tolerate |
525
- | `operator` | `string` | `Equal` | `Equal` or `Exists` |
526
- | `value` | `string` | - | Taint value (required for `Equal`) |
527
- | `effect` | `string` | - | `NoSchedule`, `PreferNoSchedule`, or `NoExecute`. Omit to tolerate all effects. |
528
-
529
- **Example:**
530
- ```typescript
179
+ // Operator-managed Varnish via the cloud-vinyl operator.
531
180
  const cache = new PloneVinylCache(chart, 'cache', {
532
181
  plone: ploneInstance,
533
- replicas: 2,
534
- requestCpu: '200m',
535
- limitCpu: '1',
536
- requestMemory: '256Mi',
537
- limitMemory: '1Gi',
182
+ storage: [{ name: 's0', type: 'malloc', size: '1500M' }],
538
183
  monitoring: true,
539
184
  });
540
-
541
- // Use the service name for IngressRoute
542
- console.log(cache.vinylCacheServiceName);
543
- ```
544
-
545
- **Custom VCL Snippets:**
546
- ```typescript
547
- new PloneVinylCache(chart, 'cache', {
548
- plone: ploneInstance,
549
- vclRecvSnippet: `
550
- // Custom routing logic
551
- if (req.url ~ "^/api/") {
552
- set req.backend_hint = plone_backend.backend();
553
- }
554
- `,
555
- });
556
- ```
557
-
558
- **Storage sizing:**
559
- ```typescript
560
- new PloneVinylCache(chart, 'cache', {
561
- plone: ploneInstance,
562
- limitMemory: '2Gi',
563
- storage: [
564
- { name: 's0', type: 'malloc', size: '1500M' },
565
- ],
566
- });
567
185
  ```
568
186
 
569
- Without an explicit `storage` entry, varnishd runs with its stock default (~100 MB malloc) regardless of the container's memory limit. Size malloc storage below the pod's memory limit to leave headroom for varnishd overhead and transient allocations.
570
-
571
- **vs PloneHttpcache:**
572
- - `PloneHttpcache` deploys Varnish via mittwald Helm chart (self-contained, no operator needed)
573
- - `PloneVinylCache` creates a VinylCache CR managed by the cloud-vinyl operator (requires operator in cluster)
574
- - VinylCache provides structured VCL generation, agent-based config delivery, and built-in invalidation proxy
575
-
576
- ---
577
-
578
- ## PloneVariant enum
579
-
580
- Defines the deployment variant:
581
-
582
- | Value | Description |
583
- |-------|-------------|
584
- | `PloneVariant.VOLTO` | React single-page frontend talking to the REST API backend (default) |
585
- | `PloneVariant.BLICCA` | The Plone backend renders the UI server-side and serves HTML directly |
586
- | `PloneVariant.CLASSICUI` | Deprecated alias for `PloneVariant.BLICCA`, kept for backward compatibility |
587
-
588
- `BLICCA` is the new name for the former `CLASSICUI` variant.
589
- Both select the same backend-only deployment.
590
- `CLASSICUI` keeps its legacy value (`'classicui'`), so existing configuration using `CLASSICUI` or that literal keeps working unchanged.
591
- The `CLASSICUI` alias will be removed in a future major release.
592
-
593
- **Example:**
594
- ```typescript
595
- import { PloneVariant } from '@bluedynamics/cdk8s-plone';
596
-
597
- // Volto (React single-page frontend)
598
- variant: PloneVariant.VOLTO
599
-
600
- // Blicca (server-side rendered)
601
- variant: PloneVariant.BLICCA
187
+ ```{important}
188
+ `PloneVinylCache` without an explicit `storage` entry runs varnishd with its stock default (~100 MB malloc) regardless of the container memory limit.
189
+ Size malloc storage below the pod's memory limit to leave headroom for varnishd overhead.
602
190
  ```
603
191
 
604
- ---
192
+ For the full walk-through, including custom VCL snippets and shard-director tuning, see {doc}`/how-to/deploy-with-vinyl-cache`.
605
193
 
606
194
  ## Complete example
607
195
 
@@ -614,11 +202,9 @@ const app = new App();
614
202
  const chart = new Chart(app, 'PloneDeployment');
615
203
 
616
204
  const plone = new Plone(chart, 'my-plone', {
617
- version: '1.0.0',
618
205
  siteId: 'MySite',
619
206
  variant: PloneVariant.VOLTO,
620
207
  imagePullSecrets: ['registry-secret'],
621
-
622
208
  backend: {
623
209
  image: 'plone/plone-backend:6.1.3',
624
210
  replicas: 3,
@@ -627,27 +213,16 @@ const plone = new Plone(chart, 'my-plone', {
627
213
  requestMemory: '512Mi',
628
214
  limitMemory: '2Gi',
629
215
  minAvailable: 2,
630
- readinessEnabled: true,
631
- readinessInitialDelaySeconds: 10,
632
216
  environment: {
633
217
  variables: {
634
218
  SITE: Env.value('MySite'),
635
219
  },
636
220
  },
637
- podAnnotations: {
638
- 'prometheus.io/scrape': 'true',
639
- },
640
221
  },
641
-
642
222
  frontend: {
643
223
  image: 'plone/plone-frontend:16.0.0',
644
224
  replicas: 2,
645
- requestCpu: '250m',
646
- limitCpu: '1',
647
- requestMemory: '256Mi',
648
- limitMemory: '1Gi',
649
225
  livenessEnabled: true,
650
- livenessInitialDelaySeconds: 30,
651
226
  },
652
227
  });
653
228
 
@@ -655,22 +230,16 @@ new PloneHttpcache(chart, 'cache', {
655
230
  plone: plone,
656
231
  existingSecret: 'varnish-secret',
657
232
  replicas: 2,
658
- requestCpu: '250m',
659
- requestMemory: '256Mi',
660
233
  servicemonitor: true,
661
234
  });
662
235
 
663
236
  app.synth();
664
237
  ```
665
238
 
666
- ---
667
-
668
239
  ## See also
669
240
 
670
- - {doc}`/tutorials/01-quick-start` — Get started guide
671
- - {doc}`/how-to/deploy-production-volto` — Production-ready Volto deployment
241
+ - {doc}`API reference <api/index>` every option, type, and default (generated)
242
+ - {doc}`/tutorials/01-quick-start` — first deployment, step by step
243
+ - {doc}`/how-to/deploy-volto` — production-ready Volto deployment
672
244
  - {doc}`/how-to/deploy-blicca` — Blicca deployment
673
- - {doc}`/how-to/deploy-with-vinyl-cache` — `PloneVinylCache` walk-through
674
- - {doc}`/how-to/enable-prometheus-monitoring` — Wire up `ServiceMonitor`
675
- - {doc}`/how-to/configure-security-context` — Harden backend and frontend pods
676
- - {doc}`/how-to/schedule-pods` — `nodeSelector` and `tolerations`
245
+ - {doc}`/explanation/architecture` — how the pieces fit together