@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,140 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
4
- "description": "Upgrade the Plone image and the cdk8s-plone library, roll out changes safely, and roll back a failed update."
5
- "property=og:description": "Upgrade the Plone image and the cdk8s-plone library, roll out changes safely, and roll back a failed update."
6
- "property=og:title": "Upgrade and roll out"
7
- "keywords": "Plone, cdk8s, Kubernetes, upgrade, rollout, rolling update, rollback, migration"
8
- ---
9
-
10
- # Upgrade and roll out
11
-
12
- This guide shows you how to upgrade the Plone images and the `cdk8s-plone` library, roll the change out safely, and roll it back if it fails.
13
-
14
- ## Prerequisites
15
-
16
- - A working Plone deployment created with `cdk8s-plone`.
17
- - Two or more replicas if you need a zero-downtime rollout. See {doc}`/how-to/scale-and-high-availability`.
18
-
19
- ## Upgrade the Plone image
20
-
21
- Change the `image` tag on `backend` and `frontend` to the new version.
22
-
23
- ```typescript
24
- backend: {
25
- image: 'plone/plone-backend:6.1.4',
26
- },
27
- frontend: {
28
- image: 'plone/plone-frontend:16.1.0',
29
- }
30
- ```
31
-
32
- Pin a specific tag rather than `latest`, so the rollout is reproducible and you can roll back to a known version.
33
-
34
- Regenerate the manifests and apply them:
35
-
36
- ```shell
37
- cdk8s synth
38
- kubectl apply -f dist/
39
- ```
40
-
41
- Kubernetes replaces the pods with the RollingUpdate strategy.
42
- By default it removes up to a quarter of the old pods before new ones are ready.
43
- Plone takes a while to become ready, so the site runs with less capacity during the rollout.
44
- To keep full capacity, start new pods first and remove old ones only when replacements are ready:
45
-
46
- ```typescript
47
- backend: {
48
- rollingUpdate: { maxUnavailable: 0, maxSurge: '50%' },
49
- }
50
- ```
51
-
52
- The cluster needs room for the extra pods while the rollout runs.
53
-
54
- ```{important}
55
- Upgrading to a new Plone major or minor version may require a Plone site upgrade step that `cdk8s-plone` does not perform.
56
- After the new backend pods are ready, run the upgrade from the Plone control panel (`@@plone-upgrade`) on the maintenance or uncached route.
57
- ```
58
-
59
- ## Avoid errors from stopping pods
60
-
61
- Each old pod keeps serving for 15 seconds after Kubernetes marks it for deletion.
62
- This gives kube-proxy, ingress controllers, and caches that address pods directly, such as Varnish via `PloneVinylCache`, time to stop sending it requests.
63
-
64
- If your cache or ingress controller still logs `503` errors or refused connections while old pods stop, increase the delay:
65
-
66
- ```typescript
67
- backend: {
68
- preStopDelaySeconds: 30,
69
- },
70
- frontend: {
71
- preStopDelaySeconds: 30,
72
- }
73
- ```
74
-
75
- The termination grace period grows with the delay.
76
- If your pods need more than 30 seconds to shut down after the delay, set `terminationGracePeriodSeconds` as well.
77
- See {ref}`graceful-shutdown` for the defaults and constraints.
78
-
79
- ## Watch the rollout
80
-
81
- Follow the rollout and confirm it completes.
82
-
83
- ```shell
84
- kubectl rollout status deployment/<backend-deployment> -n <namespace>
85
- kubectl get pods -n <namespace> -w
86
- ```
87
-
88
- ## Roll back a failed upgrade
89
-
90
- If the new version misbehaves, undo the rollout to the previous ReplicaSet:
91
-
92
- ```shell
93
- kubectl rollout undo deployment/<backend-deployment> -n <namespace>
94
- ```
95
-
96
- To return to a known-good definition instead, restore the previous image tag in your code, then `cdk8s synth` and `kubectl apply -f dist/` again.
97
-
98
- ```{warning}
99
- A rollback reverts the container image, not your data.
100
- If the upgrade ran an irreversible Plone site migration, restore the database from a backup. See {doc}`/how-to/backup-and-restore`.
101
- ```
102
-
103
- ## Upgrade the cdk8s-plone library
104
-
105
- Bump the dependency, regenerate, and review the manifest diff before applying.
106
-
107
- ```shell
108
- npm install @bluedynamics/cdk8s-plone@latest
109
- cdk8s synth
110
- git diff dist/
111
- ```
112
-
113
- Read the [changelog](https://github.com/bluedynamics/cdk8s-plone/releases) for renamed or deprecated options, then apply the reviewed manifests.
114
-
115
- (upgrade-pod-labels)=
116
-
117
- ### Roll out the pod labels before 0.3
118
-
119
- Starting with 0.2.5, every backend and frontend pod carries the labels `app.kubernetes.io/instance` and `cdk8s-plone.bluedynamics.eu/group`.
120
- Adding them replaces all pods once, in an ordinary rolling update.
121
-
122
- Release 0.3 switches the Service and the PodDisruptionBudget to select on these labels.
123
- Roll out a release from 0.2.5 on before you upgrade to 0.3, and wait until it has finished.
124
- Before you apply 0.3, check that no pod lacks the labels.
125
- The following command must print nothing:
126
-
127
- ```shell
128
- kubectl get pods -n <namespace> -l 'app.kubernetes.io/managed-by=cdk8s-plone,!app.kubernetes.io/instance'
129
- ```
130
-
131
- ```{warning}
132
- If you skip this step, all pods that predate the labels leave the Service when 0.3 is applied.
133
- The site is unreachable until the first new pod is ready.
134
- ```
135
-
136
- ## See also
137
-
138
- - {doc}`/how-to/scale-and-high-availability` — replicas and PodDisruptionBudget for zero-downtime rollouts.
139
- - {doc}`/how-to/backup-and-restore` — back up before a risky upgrade.
140
- - {doc}`/reference/api/index` — authoritative option reference for each release.
@@ -1,109 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
4
- "description": "Documentation for cdk8s-plone, a TypeScript and Python library for deploying Plone CMS to Kubernetes with CDK8S."
5
- "property=og:description": "Documentation for cdk8s-plone, a TypeScript and Python library for deploying Plone CMS to Kubernetes with CDK8S."
6
- "property=og:title": "cdk8s-plone documentation"
7
- "keywords": "Plone, cdk8s, Kubernetes, Volto, CMS, infrastructure as code"
8
- ---
9
-
10
- # cdk8s-plone documentation
11
-
12
- <!-- diataxis: landing -->
13
-
14
- ```{image} _static/logo.svg
15
- :alt: cdk8s-plone logo
16
- :width: 200px
17
- :align: center
18
- ```
19
-
20
- **CDK8S Construct Library for Plone CMS Deployment**
21
-
22
- Welcome to the cdk8s-plone documentation. This documentation covers everything from initial setup to advanced configuration and architectural concepts for deploying Plone CMS using CDK8S.
23
-
24
- ## About cdk8s-plone
25
-
26
- cdk8s-plone is a TypeScript construct library for [CDK8S](https://cdk8s.io/) that enables programmatic deployment of [Plone](https://plone.org/) CMS on Kubernetes. It provides type-safe, reusable constructs for Plone Backend and Frontend with production-grade defaults.
27
-
28
- **Key Features:**
29
- - Type-safe TypeScript constructs for Plone Backend and Frontend
30
- - Production-grade defaults with full customization
31
- - Support for PostgreSQL backends
32
- - Comprehensive resource management (CPU, memory, storage)
33
- - Component-level configuration options
34
- - Built on CDK8S for infrastructure as code
35
-
36
- ## Documentation structure
37
-
38
- This documentation follows the [Diátaxis framework](https://diataxis.fr/), organizing content into four categories based on what you need:
39
-
40
- ::::{grid} 2
41
- :gutter: 3
42
-
43
- :::{grid-item-card} Tutorials
44
- :link: tutorials/index
45
- :link-type: doc
46
-
47
- **Learning-oriented**: Step-by-step lessons to build skills
48
-
49
- *Start here if you're new to cdk8s-plone*
50
- :::
51
-
52
- :::{grid-item-card} How-To Guides
53
- :link: how-to/index
54
- :link-type: doc
55
-
56
- **Goal-oriented**: Solutions to specific problems
57
-
58
- *Use these when you need to accomplish something*
59
- :::
60
-
61
- :::{grid-item-card} Reference
62
- :link: reference/index
63
- :link-type: doc
64
-
65
- **Information-oriented**: Technical specifications and configurations
66
-
67
- *Consult when you need detailed information*
68
- :::
69
-
70
- :::{grid-item-card} Explanation
71
- :link: explanation/index
72
- :link-type: doc
73
-
74
- **Understanding-oriented**: Concepts and design decisions
75
-
76
- *Read to deepen your understanding*
77
- :::
78
-
79
- ::::
80
-
81
- ## Quick links
82
-
83
- ### Getting started
84
- - {doc}`tutorials/01-quick-start` — Deploy your first Plone instance
85
- - {doc}`how-to/setup-prerequisites` — Prepare cluster infrastructure
86
- - {doc}`explanation/features` — Explore capabilities
87
-
88
- ### Configuration
89
- - {doc}`reference/configuration-options` — Complete configuration reference
90
- - {doc}`explanation/architecture` — High-level design
91
-
92
- ### Common tasks
93
- - {doc}`how-to/configure-security-context` — Harden backend and frontend pods
94
- - {doc}`how-to/enable-prometheus-monitoring` — Wire up `ServiceMonitor`
95
- - {doc}`how-to/schedule-pods` — `nodeSelector` and tolerations
96
-
97
- ## Table of contents
98
-
99
- ```{toctree}
100
- ---
101
- maxdepth: 3
102
- caption: Documentation
103
- titlesonly: true
104
- ---
105
- tutorials/index
106
- how-to/index
107
- reference/index
108
- explanation/index
109
- ```
@@ -1,40 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
4
- "description": "Auto-generated API reference for cdk8s-plone constructs, interfaces, and enums."
5
- "property=og:description": "Auto-generated API reference for cdk8s-plone constructs, interfaces, and enums."
6
- "property=og:title": "API reference"
7
- "keywords": "Plone, cdk8s, Kubernetes, API, reference, TypeScript, Python"
8
- ---
9
-
10
- # API reference
11
-
12
- Complete API reference for cdk8s-plone constructs, generated from the TypeScript source code.
13
- This is the authoritative reference for every option, type, default, and required flag.
14
-
15
- ## Overview
16
-
17
- The cdk8s-plone library provides the following constructs:
18
-
19
- - **Plone**: main construct for deploying Plone CMS, with support for both the Volto (React frontend) and Blicca (server-side rendered) variants
20
- - **PloneHttpcache**: Varnish caching layer via the mittwald kube-httpcache Helm chart (self-contained)
21
- - **PloneVinylCache**: Varnish caching layer via the cloud-vinyl operator (requires the operator in-cluster)
22
-
23
- ## Language support
24
-
25
- This API documentation shows TypeScript usage examples. The library is also available for Python via JSII transpilation:
26
-
27
- - **TypeScript/JavaScript**: [`@bluedynamics/cdk8s-plone`](https://www.npmjs.com/package/@bluedynamics/cdk8s-plone) on npm
28
- - **Python**: [`cdk8s-plone`](https://pypi.org/project/cdk8s-plone/) on PyPI
29
-
30
- For Python-specific usage, the API remains the same but follows Python naming conventions (snake_case instead of camelCase).
31
-
32
- ---
33
-
34
- ```{include} ../../../../API.md
35
- :relative-docs: ../../../../
36
- :relative-images:
37
- :start-line: 2
38
- ```
39
-
40
- *This API reference is automatically generated from the TypeScript source code. For the latest version, run `npx projen docgen` in the project root.*
@@ -1,352 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
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
- ---
9
-
10
- # Configuration guide
11
-
12
- This guide shows the most common ways to configure cdk8s-plone, grouped by task, with copy-pasteable examples.
13
-
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
- ```
19
-
20
- ## Constructs at a glance
21
-
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.
24
-
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.
27
-
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.
30
-
31
- To choose between the two cache constructs, read {doc}`/explanation/architecture`.
32
-
33
- ## Choose a frontend variant
34
-
35
- The `Plone` construct deploys one of two frontends, selected with `variant`:
36
-
37
- ```typescript
38
- import { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';
39
-
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: {},
45
- });
46
-
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
- });
52
- ```
53
-
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
- ```
59
-
60
- For the conceptual difference between the variants, see {ref}`deployment-variants`.
61
-
62
- ## Configure the backend and frontend
63
-
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.
67
-
68
- ### Images and replicas
69
-
70
- ```typescript
71
- backend: {
72
- image: 'plone/plone-backend:6.1.3',
73
- replicas: 3,
74
- imagePullPolicy: 'Always',
75
- }
76
- ```
77
-
78
- ### Resource requests and limits
79
-
80
- ```typescript
81
- backend: {
82
- requestCpu: '500m',
83
- limitCpu: '2',
84
- requestMemory: '512Mi',
85
- limitMemory: '2Gi',
86
- }
87
- ```
88
-
89
- ### High availability
90
-
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%"`.
93
-
94
- ```typescript
95
- backend: {
96
- replicas: 5,
97
- minAvailable: 3, // keep at least 3 pods available during voluntary disruptions
98
- }
99
- ```
100
-
101
- `rollingUpdate` controls how a Deployment replaces its pods during an update (`spec.strategy.rollingUpdate`).
102
- It is independent of the top-level `maxUnavailable` and `minAvailable`, which configure the PodDisruptionBudget.
103
- Both fields take an absolute number or a percentage string.
104
- Without the option, Kubernetes uses 25% for both.
105
-
106
- ```typescript
107
- backend: {
108
- rollingUpdate: { maxUnavailable: 0, maxSurge: '50%' }, // no capacity dip during rollouts
109
- }
110
- ```
111
-
112
- ### Probes
113
-
114
- Readiness probes are enabled by default; liveness probes are **disabled** by default.
115
-
116
- ```typescript
117
- frontend: {
118
- readinessEnabled: true,
119
- readinessInitialDelaySeconds: 10,
120
- livenessEnabled: true, // opt in; useful for the frontend
121
- livenessInitialDelaySeconds: 30,
122
- }
123
- ```
124
-
125
- (graceful-shutdown)=
126
-
127
- ### Graceful shutdown
128
-
129
- Each Plone container waits in a `preStop` hook before it receives `SIGTERM`.
130
- During that time kube-proxy, ingress controllers, and caches that address pods directly stop sending it requests.
131
-
132
- - `preStopDelaySeconds` defaults to `15`.
133
- `0` disables the hook.
134
- - `terminationGracePeriodSeconds` defaults to `preStopDelaySeconds` plus `30`, so the shutdown after the delay keeps the 30 seconds that Kubernetes grants by default.
135
- Without a hook, the field stays unset.
136
- - An explicit `terminationGracePeriodSeconds` must be greater than `preStopDelaySeconds`.
137
-
138
- ```typescript
139
- backend: {
140
- preStopDelaySeconds: 20,
141
- terminationGracePeriodSeconds: 90, // long-running requests get 70 seconds to finish
142
- }
143
- ```
144
-
145
- The hook uses the native `sleep` action, so the image needs no `sleep` binary.
146
- It requires Kubernetes 1.30 or later.
147
-
148
- ### Service
149
-
150
- Configure the generated Kubernetes `Service` through the grouped `service` option.
151
- Curated fields cover the common cases; `service.overrides` is an escape hatch for any other `ServiceSpec` field and has the highest precedence.
152
- Write overrides in their manifest form, for example `clusterIP` or `targetPort: 8080`.
153
- Each top-level key replaces the field as a whole.
154
-
155
- ```typescript
156
- backend: {
157
- service: {
158
- type: 'LoadBalancer',
159
- trafficDistribution: 'PreferClose',
160
- loadBalancerSourceRanges: ['10.0.0.0/8'],
161
- annotations: {
162
- 'external-dns.alpha.kubernetes.io/hostname': 'backend.example.com',
163
- },
164
- overrides: {
165
- ipFamilyPolicy: 'PreferDualStack',
166
- },
167
- },
168
- }
169
- ```
170
-
171
- ```{note}
172
- The top-level `serviceAnnotations` option is deprecated. Use `service.annotations` instead.
173
- ```
174
-
175
- (groups)=
176
-
177
- ### Groups
178
-
179
- `groups` runs part of a role's pods with different settings behind the same Service, for example an allocator experiment or a canary.
180
- Each group becomes an additional Deployment.
181
-
182
- ```typescript
183
- import { Env, EnvValue } from 'cdk8s-plus-30';
184
-
185
- backend: {
186
- replicas: 4,
187
- groups: [
188
- {
189
- name: 'jemalloc',
190
- replicas: 2,
191
- environment: new Env([], {
192
- LD_PRELOAD: EnvValue.fromValue('/usr/lib/x86_64-linux-gnu/libjemalloc.so.2'),
193
- }),
194
- },
195
- ],
196
- }
197
- ```
198
-
199
- - A group inherits all settings of its role, including probes, resources, scheduling, and the graceful shutdown.
200
- It can set `replicas` (default `1`), `environment`, and `image`.
201
- - `environment` is merged over the role's environment.
202
- A variable with the same name replaces the role's value.
203
- - Group replicas add to the role's `replicas`: the example runs six backend pods.
204
- - Group pods join the role's Service and PodDisruptionBudget.
205
- - Every pod carries the label `cdk8s-plone.bluedynamics.eu/group`, with the value `default` for the main Deployment.
206
- The ServiceMonitor transfers it to the metrics, where Prometheus names it `cdk8s_plone_bluedynamics_eu_group`.
207
- - `name` must be a lowercase DNS label and must not be `default`.
208
- Renaming a group creates a new Deployment, and the old one stays until you delete it.
209
- - `groups` works for `frontend` as well.
210
-
211
- For other settings per group, patch the group's Deployment through `plone.backendGroupDeployments` or `plone.frontendGroupDeployments`, keyed by group name.
212
-
213
- Groups require that the pod labels from 0.2.5 are rolled out before you upgrade, see {ref}`upgrade-pod-labels`.
214
-
215
- ### Escape hatch
216
-
217
- For fields without a dedicated option, patch the generated objects with [JSON Patch](https://cdk8s.io/docs/latest/basics/escape-hatches).
218
- `Plone` exposes `backendDeployment`, `backendService`, `frontendDeployment`, and `frontendService`.
219
- The frontend properties are `undefined` for the Blicca variant.
220
-
221
- ```typescript
222
- import { JsonPatch } from 'cdk8s';
223
-
224
- const plone = new Plone(chart, 'plone');
225
- plone.backendDeployment.addJsonPatch(
226
- JsonPatch.add('/spec/strategy', {
227
- type: 'RollingUpdate',
228
- rollingUpdate: { maxUnavailable: 0, maxSurge: '50%' },
229
- }),
230
- JsonPatch.add('/spec/template/spec/containers/0/args', ['--debug']),
231
- );
232
- ```
233
-
234
- - Patches apply to the final manifest, so you write values in their manifest form, such as `'50%'` or `cpu: '2'`.
235
- - The Plone container is always `containers/0`.
236
- - Patches are not validated.
237
- Prefer a dedicated option where one exists.
238
-
239
- ### Environment variables
240
-
241
- Pass environment variables with the cdk8s-plus `Env` API, including values sourced from a `Secret`.
242
-
243
- ```typescript
244
- import { Env } from 'cdk8s-plus-30';
245
-
246
- backend: {
247
- environment: {
248
- variables: {
249
- RELSTORAGE_DSN: Env.fromSecret(dbSecret, 'dsn'),
250
- },
251
- },
252
- }
253
- ```
254
-
255
- ### Annotations, scheduling, security, and monitoring
256
-
257
- These groups each have a dedicated how-to guide:
258
-
259
- - {doc}`/how-to/schedule-pods` — `nodeSelector` and `tolerations`
260
- - {doc}`/how-to/configure-security-context` — `securityContext` hardening
261
- - {doc}`/how-to/enable-prometheus-monitoring` — `servicemonitor`, `metricsPort`, `metricsPath`
262
-
263
- ## Add a cache
264
-
265
- ```typescript
266
- import { PloneHttpcache } from '@bluedynamics/cdk8s-plone';
267
-
268
- // Self-contained Varnish via the kube-httpcache Helm chart.
269
- new PloneHttpcache(chart, 'cache', {
270
- plone: ploneInstance,
271
- existingSecret: 'varnish-secret',
272
- replicas: 2,
273
- });
274
- ```
275
-
276
- ```typescript
277
- import { PloneVinylCache } from '@bluedynamics/cdk8s-plone';
278
-
279
- // Operator-managed Varnish via the cloud-vinyl operator.
280
- const cache = new PloneVinylCache(chart, 'cache', {
281
- plone: ploneInstance,
282
- storage: [{ name: 'cache', type: 'malloc', size: '1G' }],
283
- cluster: true,
284
- monitoring: true,
285
- });
286
- ```
287
-
288
- ```{important}
289
- `PloneVinylCache` without an explicit `storage` entry runs varnishd with its stock default (~100 MB malloc) regardless of the container memory limit.
290
- Size malloc storage below the pod's memory limit to leave headroom for varnishd overhead.
291
- Never name a storage entry `s0`; the stock image's entrypoint already defines it.
292
- ```
293
-
294
- | Option | Type | Default | Description |
295
- |---|---|---|---|
296
- | `cluster` | boolean | not set | Sets `spec.cluster.enabled`; with clustering, each object is cached once across all replicas |
297
- | `varnishParameters` | map of string | not set | Sets `spec.varnishParameters`, passed to varnishd as `-p name=value` |
298
-
299
- For the full walk-through, including custom VCL snippets and shard-director tuning, see {doc}`/how-to/deploy-with-vinyl-cache`.
300
-
301
- ## Complete example
302
-
303
- ```typescript
304
- import { App, Chart } from 'cdk8s';
305
- import { Plone, PloneVariant, PloneHttpcache } from '@bluedynamics/cdk8s-plone';
306
- import { Env } from 'cdk8s-plus-30';
307
-
308
- const app = new App();
309
- const chart = new Chart(app, 'PloneDeployment');
310
-
311
- const plone = new Plone(chart, 'my-plone', {
312
- siteId: 'MySite',
313
- variant: PloneVariant.VOLTO,
314
- imagePullSecrets: ['registry-secret'],
315
- backend: {
316
- image: 'plone/plone-backend:6.1.3',
317
- replicas: 3,
318
- requestCpu: '500m',
319
- limitCpu: '2',
320
- requestMemory: '512Mi',
321
- limitMemory: '2Gi',
322
- minAvailable: 2,
323
- environment: {
324
- variables: {
325
- SITE: Env.value('MySite'),
326
- },
327
- },
328
- },
329
- frontend: {
330
- image: 'plone/plone-frontend:16.0.0',
331
- replicas: 2,
332
- livenessEnabled: true,
333
- },
334
- });
335
-
336
- new PloneHttpcache(chart, 'cache', {
337
- plone: plone,
338
- existingSecret: 'varnish-secret',
339
- replicas: 2,
340
- servicemonitor: true,
341
- });
342
-
343
- app.synth();
344
- ```
345
-
346
- ## See also
347
-
348
- - {doc}`API reference <api/index>` — every option, type, and default (generated)
349
- - {doc}`/tutorials/01-quick-start` — first deployment, step by step
350
- - {doc}`/how-to/deploy-volto` — production-ready Volto deployment
351
- - {doc}`/how-to/deploy-blicca` — Blicca deployment
352
- - {doc}`/explanation/architecture` — how the pieces fit together
@@ -1,41 +0,0 @@
1
- ---
2
- myst:
3
- html_meta:
4
- "description": "Information-oriented technical reference for cdk8s-plone: the generated API reference and a task-oriented configuration guide."
5
- "property=og:description": "Information-oriented technical reference for cdk8s-plone: the generated API reference and a task-oriented configuration guide."
6
- "property=og:title": "Reference"
7
- "keywords": "Plone, cdk8s, Kubernetes, reference, API, configuration"
8
- ---
9
-
10
- # Reference
11
-
12
- **Information-oriented technical specifications for cdk8s-plone.**
13
-
14
- The reference has two parts that play different roles:
15
-
16
- {doc}`API reference <api/index>`
17
- : The complete, authoritative list of every construct, interface, option, type, default value, and enum.
18
- It is generated from the TypeScript source with `npx projen docgen`, so it never drifts from the code.
19
- Use it to look up exactly what an option does, its type, and whether it is required.
20
-
21
- {doc}`Configuration guide <configuration-options>`
22
- : A hand-written, task-oriented tour of the most common configuration, with copy-pasteable examples.
23
- It links into the API reference rather than repeating it.
24
- Use it to see how options fit together for a real deployment.
25
-
26
- ```{toctree}
27
- ---
28
- maxdepth: 1
29
- titlesonly: true
30
- ---
31
- api/index
32
- configuration-options
33
- ```
34
-
35
- ---
36
-
37
- **Getting started?** Begin with the {doc}`/tutorials/index` for hands-on learning.
38
-
39
- **Solving a specific problem?** Check the {doc}`/how-to/index` for task-oriented solutions.
40
-
41
- **Understanding concepts?** Read the {doc}`/explanation/index` for architecture and design.