@bluedynamics/cdk8s-plone 0.1.36 → 0.1.38
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.jsii +4 -4
- package/documentation/sources/explanation/architecture.md +31 -23
- package/documentation/sources/explanation/features.md +47 -36
- package/documentation/sources/explanation/index.md +12 -3
- package/documentation/sources/how-to/configure-security-context.md +148 -0
- package/documentation/sources/how-to/deploy-classic-ui.md +57 -49
- package/documentation/sources/how-to/deploy-production-volto.md +61 -51
- package/documentation/sources/how-to/deploy-with-vinyl-cache.md +18 -9
- package/documentation/sources/how-to/enable-prometheus-monitoring.md +123 -0
- package/documentation/sources/how-to/index.md +14 -6
- package/documentation/sources/how-to/schedule-pods.md +150 -0
- package/documentation/sources/how-to/setup-prerequisites.md +53 -44
- package/documentation/sources/index.md +23 -14
- package/documentation/sources/reference/api/index.md +11 -2
- package/documentation/sources/reference/configuration-options.md +217 -50
- package/documentation/sources/reference/index.md +13 -4
- package/documentation/sources/tutorials/01-quick-start.md +27 -19
- package/documentation/sources/tutorials/index.md +10 -1
- package/lib/deployment.js +7 -2
- package/lib/httpcache.js +1 -1
- package/lib/pdb.js +2 -1
- package/lib/plone.js +1 -1
- package/lib/vinylcache.js +1 -1
- package/package.json +7 -7
package/.jsii
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
]
|
|
8
8
|
},
|
|
9
9
|
"dependencies": {
|
|
10
|
-
"cdk8s": "^2.70.
|
|
10
|
+
"cdk8s": "^2.70.68",
|
|
11
11
|
"cdk8s-plus-30": "^2.4.10",
|
|
12
12
|
"constructs": "^10.4.2"
|
|
13
13
|
},
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"stability": "stable"
|
|
97
97
|
},
|
|
98
98
|
"homepage": "https://github.com/bluedynamics/cdk8s-plone.git",
|
|
99
|
-
"jsiiVersion": "5.9.
|
|
99
|
+
"jsiiVersion": "5.9.44 (build 150b837)",
|
|
100
100
|
"license": "Apache-2.0",
|
|
101
101
|
"metadata": {
|
|
102
102
|
"jsii": {
|
|
@@ -2852,6 +2852,6 @@
|
|
|
2852
2852
|
"symbolId": "src/vinylcache:VinylCacheToleration"
|
|
2853
2853
|
}
|
|
2854
2854
|
},
|
|
2855
|
-
"version": "0.1.
|
|
2856
|
-
"fingerprint": "
|
|
2855
|
+
"version": "0.1.38",
|
|
2856
|
+
"fingerprint": "a1tHRGX37kAGmsCtB0pTKR1IeY4oHKhXY1/5tzIjpYk="
|
|
2857
2857
|
}
|
|
@@ -1,4 +1,13 @@
|
|
|
1
|
-
|
|
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
|
|
2
11
|
|
|
3
12
|
Understanding the architecture and design of cdk8s-plone deployments.
|
|
4
13
|
|
|
@@ -6,9 +15,9 @@ Understanding the architecture and design of cdk8s-plone deployments.
|
|
|
6
15
|
|
|
7
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.
|
|
8
17
|
|
|
9
|
-
## Key
|
|
18
|
+
## Key features
|
|
10
19
|
|
|
11
|
-
### Deployment
|
|
20
|
+
### Deployment variants
|
|
12
21
|
|
|
13
22
|
cdk8s-plone supports two deployment variants:
|
|
14
23
|
|
|
@@ -25,7 +34,7 @@ cdk8s-plone supports two deployment variants:
|
|
|
25
34
|
- Traditional Plone experience
|
|
26
35
|
- Simpler deployment model
|
|
27
36
|
|
|
28
|
-
### High
|
|
37
|
+
### High availability
|
|
29
38
|
|
|
30
39
|
**Replica Management**
|
|
31
40
|
- Configurable number of replicas for backend and frontend
|
|
@@ -42,7 +51,7 @@ cdk8s-plone supports two deployment variants:
|
|
|
42
51
|
- Liveness probes: Automatic restart of unhealthy pods
|
|
43
52
|
- Configurable delays, timeouts, and thresholds
|
|
44
53
|
|
|
45
|
-
### HTTP
|
|
54
|
+
### HTTP caching layer
|
|
46
55
|
|
|
47
56
|
**Varnish Integration**
|
|
48
57
|
- Uses [kube-httpcache](https://github.com/mittwald/kube-httpcache) Helm chart
|
|
@@ -57,7 +66,7 @@ cdk8s-plone supports two deployment variants:
|
|
|
57
66
|
- Better scalability
|
|
58
67
|
- Automatic cache invalidation on content changes
|
|
59
68
|
|
|
60
|
-
### Caching
|
|
69
|
+
### Caching options
|
|
61
70
|
|
|
62
71
|
cdk8s-plone supports two HTTP caching approaches:
|
|
63
72
|
|
|
@@ -75,7 +84,7 @@ cdk8s-plone supports two HTTP caching approaches:
|
|
|
75
84
|
|
|
76
85
|
Choose PloneHttpcache for standalone deployments without cloud-vinyl. Choose PloneVinylCache when the operator is available for centralized cache management.
|
|
77
86
|
|
|
78
|
-
### Multi-
|
|
87
|
+
### Multi-language support
|
|
79
88
|
|
|
80
89
|
The library is published in multiple languages:
|
|
81
90
|
|
|
@@ -89,7 +98,7 @@ The library is published in multiple languages:
|
|
|
89
98
|
- Pythonic API
|
|
90
99
|
- Published to PyPI: `cdk8s-plone`
|
|
91
100
|
|
|
92
|
-
## Architecture
|
|
101
|
+
## Architecture diagram
|
|
93
102
|
|
|
94
103
|
```mermaid
|
|
95
104
|
graph TB
|
|
@@ -139,7 +148,7 @@ graph TB
|
|
|
139
148
|
Backend3 --> DB
|
|
140
149
|
```
|
|
141
150
|
|
|
142
|
-
## Component
|
|
151
|
+
## Component responsibilities
|
|
143
152
|
|
|
144
153
|
### Backend
|
|
145
154
|
|
|
@@ -195,7 +204,7 @@ graph TB
|
|
|
195
204
|
- Horizontal: Add replicas for cache distribution
|
|
196
205
|
- Vertical: Increase memory for larger cache
|
|
197
206
|
|
|
198
|
-
## Kubernetes
|
|
207
|
+
## Kubernetes resources created
|
|
199
208
|
|
|
200
209
|
For a typical Volto deployment, cdk8s-plone creates:
|
|
201
210
|
|
|
@@ -217,9 +226,9 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
217
226
|
- Secret (admin credentials)
|
|
218
227
|
- ServiceMonitor (optional, for Prometheus)
|
|
219
228
|
|
|
220
|
-
## Design
|
|
229
|
+
## Design decisions
|
|
221
230
|
|
|
222
|
-
### CDK8S
|
|
231
|
+
### CDK8S constructs
|
|
223
232
|
|
|
224
233
|
**Why CDK8S?**
|
|
225
234
|
- Type-safe infrastructure as code
|
|
@@ -234,7 +243,7 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
234
243
|
- Easier testing
|
|
235
244
|
- Composition over configuration
|
|
236
245
|
|
|
237
|
-
### Separate
|
|
246
|
+
### Separate frontend and backend
|
|
238
247
|
|
|
239
248
|
**Volto Architecture:**
|
|
240
249
|
- Independent scaling of frontend and backend
|
|
@@ -248,7 +257,7 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
248
257
|
- Legacy integrations
|
|
249
258
|
- Specific add-on requirements
|
|
250
259
|
|
|
251
|
-
### Optional Varnish
|
|
260
|
+
### Optional Varnish layer
|
|
252
261
|
|
|
253
262
|
**Design Choice:**
|
|
254
263
|
- Varnish is optional, not mandatory
|
|
@@ -262,7 +271,7 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
262
271
|
- Better performance at scale
|
|
263
272
|
- Reduced backend load
|
|
264
273
|
|
|
265
|
-
### Health
|
|
274
|
+
### Health probes
|
|
266
275
|
|
|
267
276
|
**Readiness Probe:**
|
|
268
277
|
- Enabled by default for backend
|
|
@@ -274,9 +283,9 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
274
283
|
- Recommended enabled for frontend (detect SSR hangs)
|
|
275
284
|
- Configurable thresholds
|
|
276
285
|
|
|
277
|
-
## Production
|
|
286
|
+
## Production considerations
|
|
278
287
|
|
|
279
|
-
### Resource
|
|
288
|
+
### Resource planning
|
|
280
289
|
|
|
281
290
|
**Backend:**
|
|
282
291
|
- Plan for catalog size and query complexity
|
|
@@ -292,7 +301,7 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
292
301
|
- Memory size determines cache capacity
|
|
293
302
|
- Monitor hit rates and adjust sizing
|
|
294
303
|
|
|
295
|
-
### High
|
|
304
|
+
### High availability
|
|
296
305
|
|
|
297
306
|
**Recommendations:**
|
|
298
307
|
- Minimum 2 replicas per component
|
|
@@ -321,9 +330,8 @@ For a typical Volto deployment, cdk8s-plone creates:
|
|
|
321
330
|
- Grafana for visualization
|
|
322
331
|
- Kubernetes events monitoring
|
|
323
332
|
|
|
324
|
-
## See
|
|
333
|
+
## See also
|
|
325
334
|
|
|
326
|
-
-
|
|
327
|
-
-
|
|
328
|
-
-
|
|
329
|
-
- [Quick Start](../tutorials/01-quick-start.md) - Getting started tutorial
|
|
335
|
+
- {doc}`features` — Feature overview and deployment variants.
|
|
336
|
+
- {doc}`/reference/configuration-options` — Complete configuration reference.
|
|
337
|
+
- {doc}`/tutorials/01-quick-start` — Getting started tutorial.
|
|
@@ -1,10 +1,21 @@
|
|
|
1
|
+
---
|
|
2
|
+
myst:
|
|
3
|
+
html_meta:
|
|
4
|
+
"description": "Overview of cdk8s-plone features: deployment variants, high availability, caching, resource management, monitoring, and multi-language support."
|
|
5
|
+
"property=og:description": "Overview of cdk8s-plone features: deployment variants, high availability, caching, resource management, monitoring, and multi-language support."
|
|
6
|
+
"property=og:title": "Features"
|
|
7
|
+
"keywords": "Plone, cdk8s, Kubernetes, features, Volto, Varnish, Prometheus"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
# Features
|
|
2
11
|
|
|
3
12
|
Complete overview of cdk8s-plone features and capabilities.
|
|
4
13
|
|
|
5
|
-
## Core
|
|
14
|
+
## Core features
|
|
15
|
+
|
|
16
|
+
(deployment-variants)=
|
|
6
17
|
|
|
7
|
-
### Deployment
|
|
18
|
+
### Deployment variants
|
|
8
19
|
|
|
9
20
|
cdk8s-plone supports two deployment modes to match your requirements:
|
|
10
21
|
|
|
@@ -20,9 +31,9 @@ cdk8s-plone supports two deployment modes to match your requirements:
|
|
|
20
31
|
- Traditional Plone experience
|
|
21
32
|
- Best for: Legacy migrations, existing add-ons, simpler deployments
|
|
22
33
|
|
|
23
|
-
See
|
|
34
|
+
See {doc}`architecture` for a deeper architectural comparison of the two variants.
|
|
24
35
|
|
|
25
|
-
### High
|
|
36
|
+
### High availability
|
|
26
37
|
|
|
27
38
|
**Configurable Replicas**
|
|
28
39
|
- Set any number of replicas for backend and frontend
|
|
@@ -42,7 +53,7 @@ backend: {
|
|
|
42
53
|
}
|
|
43
54
|
```
|
|
44
55
|
|
|
45
|
-
### HTTP
|
|
56
|
+
### HTTP caching with Varnish
|
|
46
57
|
|
|
47
58
|
cdk8s-plone supports two caching backends: the self-contained mittwald kube-httpcache Helm chart (`PloneHttpcache`) and the operator-managed cloud-vinyl VinylCache (`PloneVinylCache`).
|
|
48
59
|
|
|
@@ -69,7 +80,7 @@ cdk8s-plone supports two caching backends: the self-contained mittwald kube-http
|
|
|
69
80
|
- Cache hit/miss metrics
|
|
70
81
|
- Performance monitoring
|
|
71
82
|
|
|
72
|
-
### Resource
|
|
83
|
+
### Resource management
|
|
73
84
|
|
|
74
85
|
**Fine-Grained Control**
|
|
75
86
|
- CPU requests and limits
|
|
@@ -87,7 +98,7 @@ backend: {
|
|
|
87
98
|
}
|
|
88
99
|
```
|
|
89
100
|
|
|
90
|
-
### Health
|
|
101
|
+
### Health monitoring
|
|
91
102
|
|
|
92
103
|
**Readiness Probes**
|
|
93
104
|
- Ensures pods are ready before receiving traffic
|
|
@@ -112,7 +123,7 @@ frontend: {
|
|
|
112
123
|
}
|
|
113
124
|
```
|
|
114
125
|
|
|
115
|
-
### Environment
|
|
126
|
+
### Environment configuration
|
|
116
127
|
|
|
117
128
|
**Flexible Environment Variables**
|
|
118
129
|
- Use cdk8s-plus-30 Env API
|
|
@@ -134,7 +145,7 @@ backend: {
|
|
|
134
145
|
}
|
|
135
146
|
```
|
|
136
147
|
|
|
137
|
-
### Kubernetes
|
|
148
|
+
### Kubernetes annotations
|
|
138
149
|
|
|
139
150
|
**Three Levels of Annotations**
|
|
140
151
|
- **Deployment annotations**: Metadata for the deployment resource
|
|
@@ -154,7 +165,7 @@ backend: {
|
|
|
154
165
|
}
|
|
155
166
|
```
|
|
156
167
|
|
|
157
|
-
### Private
|
|
168
|
+
### Private registry support
|
|
158
169
|
|
|
159
170
|
**Image Pull Secrets**
|
|
160
171
|
- Support for private container registries
|
|
@@ -169,17 +180,17 @@ new Plone(chart, 'my-plone', {
|
|
|
169
180
|
})
|
|
170
181
|
```
|
|
171
182
|
|
|
172
|
-
## Multi-
|
|
183
|
+
## Multi-language support
|
|
173
184
|
|
|
174
|
-
### TypeScript
|
|
185
|
+
### TypeScript and JavaScript
|
|
175
186
|
|
|
176
|
-
**Native CDK8S
|
|
187
|
+
**Native CDK8S experience**
|
|
177
188
|
- Full TypeScript type definitions
|
|
178
189
|
- IDE autocomplete and validation
|
|
179
190
|
- Familiar syntax for web developers
|
|
180
191
|
|
|
181
192
|
**Installation:**
|
|
182
|
-
```
|
|
193
|
+
```shell
|
|
183
194
|
npm install @bluedynamics/cdk8s-plone
|
|
184
195
|
```
|
|
185
196
|
|
|
@@ -195,13 +206,13 @@ new Plone(chart, 'my-plone', {
|
|
|
195
206
|
|
|
196
207
|
### Python
|
|
197
208
|
|
|
198
|
-
**JSII-
|
|
209
|
+
**JSII-generated bindings**
|
|
199
210
|
- Pythonic API
|
|
200
211
|
- Type hints support
|
|
201
212
|
- Familiar syntax for Python developers
|
|
202
213
|
|
|
203
214
|
**Installation:**
|
|
204
|
-
```
|
|
215
|
+
```shell
|
|
205
216
|
pip install cdk8s-plone
|
|
206
217
|
```
|
|
207
218
|
|
|
@@ -215,11 +226,11 @@ Plone(chart, "my-plone",
|
|
|
215
226
|
)
|
|
216
227
|
```
|
|
217
228
|
|
|
218
|
-
## Infrastructure as
|
|
229
|
+
## Infrastructure as code benefits
|
|
219
230
|
|
|
220
|
-
### Type
|
|
231
|
+
### Type safety
|
|
221
232
|
|
|
222
|
-
**Compile-
|
|
233
|
+
**Compile-time validation**
|
|
223
234
|
- Catch configuration errors before deployment
|
|
224
235
|
- IDE validation and autocomplete
|
|
225
236
|
- Refactoring support
|
|
@@ -235,7 +246,7 @@ backend: {
|
|
|
235
246
|
|
|
236
247
|
### Reusability
|
|
237
248
|
|
|
238
|
-
**Construct
|
|
249
|
+
**Construct composition**
|
|
239
250
|
- Create custom constructs
|
|
240
251
|
- Encapsulate best practices
|
|
241
252
|
- Share across projects
|
|
@@ -266,7 +277,7 @@ class ProductionPlone extends Construct {
|
|
|
266
277
|
|
|
267
278
|
### Testing
|
|
268
279
|
|
|
269
|
-
**Unit
|
|
280
|
+
**Unit testing**
|
|
270
281
|
- Test infrastructure definitions
|
|
271
282
|
- Validate resource creation
|
|
272
283
|
- Catch regressions early
|
|
@@ -284,9 +295,9 @@ test('creates backend deployment', () => {
|
|
|
284
295
|
});
|
|
285
296
|
```
|
|
286
297
|
|
|
287
|
-
### Programmatic
|
|
298
|
+
### Programmatic control
|
|
288
299
|
|
|
289
|
-
**Dynamic
|
|
300
|
+
**Dynamic configuration**
|
|
290
301
|
- Use loops and conditionals
|
|
291
302
|
- Environment-based configuration
|
|
292
303
|
- Dynamic resource generation
|
|
@@ -305,9 +316,9 @@ environments.forEach(env => {
|
|
|
305
316
|
});
|
|
306
317
|
```
|
|
307
318
|
|
|
308
|
-
## Production-
|
|
319
|
+
## Production-ready features
|
|
309
320
|
|
|
310
|
-
### Manifest
|
|
321
|
+
### Manifest generation
|
|
311
322
|
|
|
312
323
|
**Standard Kubernetes YAML**
|
|
313
324
|
- Generates standard Kubernetes manifests
|
|
@@ -315,22 +326,22 @@ environments.forEach(env => {
|
|
|
315
326
|
- Apply with `kubectl apply -f`
|
|
316
327
|
|
|
317
328
|
**Output:**
|
|
318
|
-
```
|
|
329
|
+
```shell
|
|
319
330
|
cdk8s synth
|
|
320
331
|
# Creates dist/ directory with YAML files
|
|
321
332
|
kubectl apply -f dist/
|
|
322
333
|
```
|
|
323
334
|
|
|
324
|
-
### Helm
|
|
335
|
+
### Helm chart integration
|
|
325
336
|
|
|
326
|
-
**PloneHttpcache
|
|
337
|
+
**PloneHttpcache uses Helm**
|
|
327
338
|
- Leverages battle-tested kube-httpcache chart
|
|
328
339
|
- Automatic updates available
|
|
329
340
|
- Community-maintained
|
|
330
341
|
|
|
331
|
-
### Monitoring
|
|
342
|
+
### Monitoring integration
|
|
332
343
|
|
|
333
|
-
**Prometheus
|
|
344
|
+
**Prometheus ready**
|
|
334
345
|
- ServiceMonitor support for Varnish
|
|
335
346
|
- Pod annotations for scraping
|
|
336
347
|
- Standard metrics endpoints
|
|
@@ -344,7 +355,7 @@ new PloneHttpcache(chart, 'cache', {
|
|
|
344
355
|
});
|
|
345
356
|
```
|
|
346
357
|
|
|
347
|
-
## Upcoming
|
|
358
|
+
## Upcoming features
|
|
348
359
|
|
|
349
360
|
Features planned for future releases:
|
|
350
361
|
|
|
@@ -353,9 +364,9 @@ Features planned for future releases:
|
|
|
353
364
|
|
|
354
365
|
**Note:** Ingress and TLS management are intentionally out of scope - these should be handled by your cluster's ingress controller and cert-manager. RelStorage with PostgreSQL is already supported through external database configuration (separation of concerns).
|
|
355
366
|
|
|
356
|
-
## See
|
|
367
|
+
## See also
|
|
357
368
|
|
|
358
|
-
-
|
|
359
|
-
-
|
|
360
|
-
-
|
|
361
|
-
- [Example
|
|
369
|
+
- {doc}`architecture` — System architecture and design.
|
|
370
|
+
- {doc}`/reference/configuration-options` — Complete configuration reference.
|
|
371
|
+
- {doc}`/tutorials/01-quick-start` — Getting started tutorial.
|
|
372
|
+
- [Example project](https://github.com/bluedynamics/cdk8s-plone-example) — Complete working example.
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
+
---
|
|
2
|
+
myst:
|
|
3
|
+
html_meta:
|
|
4
|
+
"description": "Understanding-oriented discussion of cdk8s-plone concepts, architecture, and design decisions."
|
|
5
|
+
"property=og:description": "Understanding-oriented discussion of cdk8s-plone concepts, architecture, and design decisions."
|
|
6
|
+
"property=og:title": "Explanation"
|
|
7
|
+
"keywords": "Plone, cdk8s, Kubernetes, architecture, design, concepts"
|
|
8
|
+
---
|
|
9
|
+
|
|
1
10
|
```{image} ../_static/kup6s-icon-explanation.svg
|
|
2
11
|
:align: center
|
|
3
12
|
:class: section-icon-large
|
|
@@ -9,7 +18,7 @@
|
|
|
9
18
|
|
|
10
19
|
Explanation guides clarify and illuminate particular topics. They broaden the understanding of cdk8s-plone and help you make informed decisions about how to use it.
|
|
11
20
|
|
|
12
|
-
## Architecture
|
|
21
|
+
## Architecture and concepts
|
|
13
22
|
|
|
14
23
|
```{toctree}
|
|
15
24
|
---
|
|
@@ -20,7 +29,7 @@ features
|
|
|
20
29
|
architecture
|
|
21
30
|
```
|
|
22
31
|
|
|
23
|
-
## Key
|
|
32
|
+
## Key topics
|
|
24
33
|
|
|
25
34
|
*This section will explain:*
|
|
26
35
|
- Plone architecture and component relationships
|
|
@@ -34,7 +43,7 @@ architecture
|
|
|
34
43
|
- Scaling and high availability considerations
|
|
35
44
|
- Performance optimization
|
|
36
45
|
|
|
37
|
-
## Design
|
|
46
|
+
## Design decisions
|
|
38
47
|
|
|
39
48
|
*This section will document:*
|
|
40
49
|
- Why certain defaults were chosen
|
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
---
|
|
2
|
+
myst:
|
|
3
|
+
html_meta:
|
|
4
|
+
"description": "Harden Plone backend and frontend pods with a Kubernetes container security context: capabilities, UID/GID, read-only root, privilege escalation."
|
|
5
|
+
"property=og:description": "Harden Plone backend and frontend pods with a Kubernetes container security context: capabilities, UID/GID, read-only root, privilege escalation."
|
|
6
|
+
"property=og:title": "Configure security context"
|
|
7
|
+
"keywords": "Plone, cdk8s, Kubernetes, security context, Pod Security Standards, hardening"
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
```{image} ../_static/kup6s-icon-howto.svg
|
|
11
|
+
:align: center
|
|
12
|
+
:class: section-icon-large
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
# Configure security context
|
|
16
|
+
|
|
17
|
+
<div class="page-metadata">
|
|
18
|
+
<div class="metadata-content">
|
|
19
|
+
<p><strong>Type</strong>: How-To (Task-oriented)</p>
|
|
20
|
+
<p><strong>Difficulty</strong>: Intermediate</p>
|
|
21
|
+
<p><strong>Time</strong>: 10 minutes</p>
|
|
22
|
+
</div>
|
|
23
|
+
</div>
|
|
24
|
+
|
|
25
|
+
This guide shows you how to harden backend and frontend pods by setting a Kubernetes container security context through `cdk8s-plone`.
|
|
26
|
+
Use it when your cluster enforces Pod Security Standards, when an admission webhook rejects permissive pods, or when you want to apply least-privilege defaults.
|
|
27
|
+
|
|
28
|
+
## Prerequisites
|
|
29
|
+
|
|
30
|
+
- A working Plone deployment using `cdk8s-plone`.
|
|
31
|
+
- A Plone image that runs as a non-root user (the official `plone/plone-backend` and `plone/plone-frontend` images do).
|
|
32
|
+
- Cluster knowledge of any namespace-level Pod Security Standards in effect.
|
|
33
|
+
|
|
34
|
+
## Apply a baseline hardened context
|
|
35
|
+
|
|
36
|
+
Set `securityContext` on `backend` or `frontend` (or both).
|
|
37
|
+
|
|
38
|
+
```typescript
|
|
39
|
+
import { Plone, PloneVariant } from '@bluedynamics/cdk8s-plone';
|
|
40
|
+
|
|
41
|
+
new Plone(chart, 'plone', {
|
|
42
|
+
variant: PloneVariant.VOLTO,
|
|
43
|
+
backend: {
|
|
44
|
+
image: 'plone/plone-backend:6.1.3',
|
|
45
|
+
securityContext: {
|
|
46
|
+
runAsNonRoot: true,
|
|
47
|
+
allowPrivilegeEscalation: false,
|
|
48
|
+
capabilities: {
|
|
49
|
+
drop: ['ALL'],
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
frontend: {
|
|
54
|
+
image: 'plone/plone-frontend:16.0.0',
|
|
55
|
+
securityContext: {
|
|
56
|
+
runAsNonRoot: true,
|
|
57
|
+
allowPrivilegeEscalation: false,
|
|
58
|
+
capabilities: {
|
|
59
|
+
drop: ['ALL'],
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
These four settings satisfy the Kubernetes **restricted** Pod Security Standard for containers that do not need extra capabilities.
|
|
67
|
+
|
|
68
|
+
## Pin the UID and GID
|
|
69
|
+
|
|
70
|
+
If your cluster requires explicit user and group IDs (for example, when you mount shared volumes), set them:
|
|
71
|
+
|
|
72
|
+
```typescript
|
|
73
|
+
backend: {
|
|
74
|
+
image: 'plone/plone-backend:6.1.3',
|
|
75
|
+
securityContext: {
|
|
76
|
+
runAsUser: 500,
|
|
77
|
+
runAsGroup: 500,
|
|
78
|
+
runAsNonRoot: true,
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
The official Plone backend image already uses UID `500`.
|
|
84
|
+
Match that UID to keep file permissions consistent with the image.
|
|
85
|
+
|
|
86
|
+
## Mount the root filesystem read-only
|
|
87
|
+
|
|
88
|
+
```typescript
|
|
89
|
+
backend: {
|
|
90
|
+
image: 'plone/plone-backend:6.1.3',
|
|
91
|
+
securityContext: {
|
|
92
|
+
runAsNonRoot: true,
|
|
93
|
+
readOnlyRootFilesystem: true,
|
|
94
|
+
allowPrivilegeEscalation: false,
|
|
95
|
+
capabilities: {
|
|
96
|
+
drop: ['ALL'],
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
}
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
```{warning}
|
|
103
|
+
A read-only root filesystem breaks any container that writes outside mounted volumes.
|
|
104
|
+
Plone's Zope writes temporary files; verify the pod stays `Ready` after rollout.
|
|
105
|
+
Mount writable `emptyDir` volumes for `/tmp` and the Zope `var/` directory through `podAnnotations` or the underlying `Deployment` patches if you hit `EROFS` errors.
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
## Add a specific capability
|
|
109
|
+
|
|
110
|
+
When you must add a Linux capability, drop everything else first.
|
|
111
|
+
|
|
112
|
+
```typescript
|
|
113
|
+
backend: {
|
|
114
|
+
image: 'plone/plone-backend:6.1.3',
|
|
115
|
+
securityContext: {
|
|
116
|
+
runAsNonRoot: true,
|
|
117
|
+
allowPrivilegeEscalation: false,
|
|
118
|
+
capabilities: {
|
|
119
|
+
add: ['SYS_PTRACE'],
|
|
120
|
+
drop: ['ALL'],
|
|
121
|
+
},
|
|
122
|
+
},
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Verify the rollout
|
|
127
|
+
|
|
128
|
+
```shell
|
|
129
|
+
# Generate manifests
|
|
130
|
+
cdk8s synth
|
|
131
|
+
|
|
132
|
+
# Confirm the securityContext appears on the pod template
|
|
133
|
+
grep -A 10 securityContext dist/*.yaml
|
|
134
|
+
|
|
135
|
+
# Apply and check pod status
|
|
136
|
+
kubectl apply -f dist/
|
|
137
|
+
kubectl rollout status deployment/<plone-backend-deployment> -n <namespace>
|
|
138
|
+
|
|
139
|
+
# Inspect the running container
|
|
140
|
+
kubectl exec -n <namespace> deployment/<plone-backend-deployment> -- id
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
A pod that fails to start with `CreateContainerConfigError` or `permission denied` usually points to a UID, capability, or read-only conflict.
|
|
144
|
+
|
|
145
|
+
## See also
|
|
146
|
+
|
|
147
|
+
- {doc}`/reference/configuration-options` — Full `PloneSecurityContext` reference.
|
|
148
|
+
- [Kubernetes Pod Security Standards](https://kubernetes.io/docs/concepts/security/pod-security-standards/) — Cluster-level policy reference.
|