@bluedynamics/cdk8s-plone 0.1.63 → 0.2.0
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 +248 -68
- package/API.md +154 -8
- package/documentation/sources/how-to/deploy-with-vinyl-cache.md +35 -9
- package/documentation/sources/how-to/upgrade-and-rollout.md +12 -2
- package/documentation/sources/reference/configuration-options.md +37 -0
- package/lib/deployment.d.ts +28 -6
- package/lib/deployment.js +45 -2
- package/lib/httpcache.js +1 -1
- package/lib/imports/vinyl.bluedynamics.eu.d.ts +7796 -77
- package/lib/imports/vinyl.bluedynamics.eu.js +3636 -12
- package/lib/index.d.ts +1 -0
- package/lib/index.js +1 -1
- package/lib/kube.d.ts +24 -0
- package/lib/kube.js +89 -0
- package/lib/plone.d.ts +32 -0
- package/lib/plone.js +31 -2
- package/lib/service.d.ts +14 -5
- package/lib/service.js +33 -5
- package/lib/vinylcache.d.ts +22 -6
- package/lib/vinylcache.js +32 -7
- package/package.json +2 -1
package/API.md
CHANGED
|
@@ -148,9 +148,13 @@ Any object.
|
|
|
148
148
|
| **Name** | **Type** | **Description** |
|
|
149
149
|
| --- | --- | --- |
|
|
150
150
|
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.node">node</a></code> | <code>constructs.Node</code> | The tree node. |
|
|
151
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.backendDeployment">backendDeployment</a></code> | <code>cdk8s.ApiObject</code> | The backend Deployment, as an escape hatch for fields without a dedicated option. |
|
|
152
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.backendService">backendService</a></code> | <code>cdk8s.ApiObject</code> | The backend Service, as an escape hatch, see `backendDeployment`. |
|
|
151
153
|
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.backendServiceName">backendServiceName</a></code> | <code>string</code> | Name of the backend Kubernetes service. |
|
|
152
154
|
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.siteId">siteId</a></code> | <code>string</code> | The Plone site ID in ZODB. |
|
|
153
155
|
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.variant">variant</a></code> | <code><a href="#@bluedynamics/cdk8s-plone.PloneVariant">PloneVariant</a></code> | The deployment variant being used (VOLTO or BLICCA). |
|
|
156
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.frontendDeployment">frontendDeployment</a></code> | <code>cdk8s.ApiObject</code> | The frontend Deployment, as an escape hatch, see `backendDeployment`. |
|
|
157
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.frontendService">frontendService</a></code> | <code>cdk8s.ApiObject</code> | The frontend Service, as an escape hatch, see `backendDeployment`. |
|
|
154
158
|
| <code><a href="#@bluedynamics/cdk8s-plone.Plone.property.frontendServiceName">frontendServiceName</a></code> | <code>string</code> | Name of the frontend Kubernetes service. |
|
|
155
159
|
|
|
156
160
|
---
|
|
@@ -167,6 +171,34 @@ The tree node.
|
|
|
167
171
|
|
|
168
172
|
---
|
|
169
173
|
|
|
174
|
+
##### `backendDeployment`<sup>Required</sup> <a name="backendDeployment" id="@bluedynamics/cdk8s-plone.Plone.property.backendDeployment"></a>
|
|
175
|
+
|
|
176
|
+
```typescript
|
|
177
|
+
public readonly backendDeployment: ApiObject;
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
- *Type:* cdk8s.ApiObject
|
|
181
|
+
|
|
182
|
+
The backend Deployment, as an escape hatch for fields without a dedicated option.
|
|
183
|
+
|
|
184
|
+
JSON patches apply to the final manifest, so plain values are kept:
|
|
185
|
+
`plone.backendDeployment.addJsonPatch(JsonPatch.add('/spec/template/spec/containers/0/args', ['--debug']))`.
|
|
186
|
+
The Plone container is always `containers/0`.
|
|
187
|
+
|
|
188
|
+
---
|
|
189
|
+
|
|
190
|
+
##### `backendService`<sup>Required</sup> <a name="backendService" id="@bluedynamics/cdk8s-plone.Plone.property.backendService"></a>
|
|
191
|
+
|
|
192
|
+
```typescript
|
|
193
|
+
public readonly backendService: ApiObject;
|
|
194
|
+
```
|
|
195
|
+
|
|
196
|
+
- *Type:* cdk8s.ApiObject
|
|
197
|
+
|
|
198
|
+
The backend Service, as an escape hatch, see `backendDeployment`.
|
|
199
|
+
|
|
200
|
+
---
|
|
201
|
+
|
|
170
202
|
##### `backendServiceName`<sup>Required</sup> <a name="backendServiceName" id="@bluedynamics/cdk8s-plone.Plone.property.backendServiceName"></a>
|
|
171
203
|
|
|
172
204
|
```typescript
|
|
@@ -205,6 +237,34 @@ The deployment variant being used (VOLTO or BLICCA).
|
|
|
205
237
|
|
|
206
238
|
---
|
|
207
239
|
|
|
240
|
+
##### `frontendDeployment`<sup>Optional</sup> <a name="frontendDeployment" id="@bluedynamics/cdk8s-plone.Plone.property.frontendDeployment"></a>
|
|
241
|
+
|
|
242
|
+
```typescript
|
|
243
|
+
public readonly frontendDeployment: ApiObject;
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
- *Type:* cdk8s.ApiObject
|
|
247
|
+
|
|
248
|
+
The frontend Deployment, as an escape hatch, see `backendDeployment`.
|
|
249
|
+
|
|
250
|
+
Only set when variant is VOLTO, otherwise undefined.
|
|
251
|
+
|
|
252
|
+
---
|
|
253
|
+
|
|
254
|
+
##### `frontendService`<sup>Optional</sup> <a name="frontendService" id="@bluedynamics/cdk8s-plone.Plone.property.frontendService"></a>
|
|
255
|
+
|
|
256
|
+
```typescript
|
|
257
|
+
public readonly frontendService: ApiObject;
|
|
258
|
+
```
|
|
259
|
+
|
|
260
|
+
- *Type:* cdk8s.ApiObject
|
|
261
|
+
|
|
262
|
+
The frontend Service, as an escape hatch, see `backendDeployment`.
|
|
263
|
+
|
|
264
|
+
Only set when variant is VOLTO, otherwise undefined.
|
|
265
|
+
|
|
266
|
+
---
|
|
267
|
+
|
|
208
268
|
##### `frontendServiceName`<sup>Optional</sup> <a name="frontendServiceName" id="@bluedynamics/cdk8s-plone.Plone.property.frontendServiceName"></a>
|
|
209
269
|
|
|
210
270
|
```typescript
|
|
@@ -560,6 +620,9 @@ Has the form `http://<cache>-invalidation.<namespace>:8090`, the same
|
|
|
560
620
|
address the operator reports in `status.invalidationURL`. The proxy serves
|
|
561
621
|
all namespaces and routes by `Host`, so the bare Service name is rejected.
|
|
562
622
|
|
|
623
|
+
Purges from clients that cannot set an `X-Vinyl-Purge-Host` header, such
|
|
624
|
+
as `plone.cachepurging`, only match cached pages if `purgeHosts` is set.
|
|
625
|
+
|
|
563
626
|
Throws if the chart has no namespace, because the URL cannot be built
|
|
564
627
|
without one, or if `invalidation` is disabled.
|
|
565
628
|
|
|
@@ -748,6 +811,7 @@ const ploneBaseOptions: PloneBaseOptions = { ... }
|
|
|
748
811
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.replicas">replicas</a></code> | <code>number</code> | Number of pod replicas to run. |
|
|
749
812
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.requestCpu">requestCpu</a></code> | <code>string</code> | CPU request for the container. |
|
|
750
813
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.requestMemory">requestMemory</a></code> | <code>string</code> | Memory request for the container. |
|
|
814
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.rollingUpdate">rollingUpdate</a></code> | <code><a href="#@bluedynamics/cdk8s-plone.PloneRollingUpdate">PloneRollingUpdate</a></code> | Rolling update settings for the Deployment (`spec.strategy.rollingUpdate`). For rollouts without a capacity dip use `{ maxUnavailable: 0, maxSurge: '50%' }`: Plone needs time to become ready, and the default lets a quarter of the pods go away first. Not to be confused with the top-level `maxUnavailable` and `minAvailable`, which configure the PodDisruptionBudget. |
|
|
751
815
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.securityContext">securityContext</a></code> | <code><a href="#@bluedynamics/cdk8s-plone.PloneSecurityContext">PloneSecurityContext</a></code> | Security context for the container. |
|
|
752
816
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.service">service</a></code> | <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec">PloneServiceSpec</a></code> | Service configuration: type, trafficDistribution, sessionAffinity, annotations/labels, and a raw `overrides` escape hatch for any other ServiceSpec field. |
|
|
753
817
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneBaseOptions.property.serviceAnnotations">serviceAnnotations</a></code> | <code>{[ key: string ]: string}</code> | Annotations to add to the Service metadata. |
|
|
@@ -1205,6 +1269,19 @@ Memory request for the container.
|
|
|
1205
1269
|
```
|
|
1206
1270
|
|
|
1207
1271
|
|
|
1272
|
+
##### `rollingUpdate`<sup>Optional</sup> <a name="rollingUpdate" id="@bluedynamics/cdk8s-plone.PloneBaseOptions.property.rollingUpdate"></a>
|
|
1273
|
+
|
|
1274
|
+
```typescript
|
|
1275
|
+
public readonly rollingUpdate: PloneRollingUpdate;
|
|
1276
|
+
```
|
|
1277
|
+
|
|
1278
|
+
- *Type:* <a href="#@bluedynamics/cdk8s-plone.PloneRollingUpdate">PloneRollingUpdate</a>
|
|
1279
|
+
- *Default:* Kubernetes default ('25%' surge, '25%' unavailable)
|
|
1280
|
+
|
|
1281
|
+
Rolling update settings for the Deployment (`spec.strategy.rollingUpdate`). For rollouts without a capacity dip use `{ maxUnavailable: 0, maxSurge: '50%' }`: Plone needs time to become ready, and the default lets a quarter of the pods go away first. Not to be confused with the top-level `maxUnavailable` and `minAvailable`, which configure the PodDisruptionBudget.
|
|
1282
|
+
|
|
1283
|
+
---
|
|
1284
|
+
|
|
1208
1285
|
##### `securityContext`<sup>Optional</sup> <a name="securityContext" id="@bluedynamics/cdk8s-plone.PloneBaseOptions.property.securityContext"></a>
|
|
1209
1286
|
|
|
1210
1287
|
```typescript
|
|
@@ -1720,6 +1797,53 @@ This is used in Kubernetes labels and doesn't affect the actual image versions.
|
|
|
1720
1797
|
|
|
1721
1798
|
---
|
|
1722
1799
|
|
|
1800
|
+
### PloneRollingUpdate <a name="PloneRollingUpdate" id="@bluedynamics/cdk8s-plone.PloneRollingUpdate"></a>
|
|
1801
|
+
|
|
1802
|
+
Rolling update settings for a Deployment (`spec.strategy.rollingUpdate`).
|
|
1803
|
+
|
|
1804
|
+
#### Initializer <a name="Initializer" id="@bluedynamics/cdk8s-plone.PloneRollingUpdate.Initializer"></a>
|
|
1805
|
+
|
|
1806
|
+
```typescript
|
|
1807
|
+
import { PloneRollingUpdate } from '@bluedynamics/cdk8s-plone'
|
|
1808
|
+
|
|
1809
|
+
const ploneRollingUpdate: PloneRollingUpdate = { ... }
|
|
1810
|
+
```
|
|
1811
|
+
|
|
1812
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
1813
|
+
|
|
1814
|
+
| **Name** | **Type** | **Description** |
|
|
1815
|
+
| --- | --- | --- |
|
|
1816
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneRollingUpdate.property.maxSurge">maxSurge</a></code> | <code>string \| number</code> | Maximum number of pods created above the desired replica count during an update, as an absolute number (e.g. 1) or a percentage (e.g. '50%'). |
|
|
1817
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneRollingUpdate.property.maxUnavailable">maxUnavailable</a></code> | <code>string \| number</code> | Maximum number of pods that can be unavailable during an update, as an absolute number (e.g. 0) or a percentage (e.g. '25%'). Not to be confused with the PodDisruptionBudget's `maxUnavailable`. |
|
|
1818
|
+
|
|
1819
|
+
---
|
|
1820
|
+
|
|
1821
|
+
##### `maxSurge`<sup>Optional</sup> <a name="maxSurge" id="@bluedynamics/cdk8s-plone.PloneRollingUpdate.property.maxSurge"></a>
|
|
1822
|
+
|
|
1823
|
+
```typescript
|
|
1824
|
+
public readonly maxSurge: string | number;
|
|
1825
|
+
```
|
|
1826
|
+
|
|
1827
|
+
- *Type:* string | number
|
|
1828
|
+
- *Default:* Kubernetes default ('25%')
|
|
1829
|
+
|
|
1830
|
+
Maximum number of pods created above the desired replica count during an update, as an absolute number (e.g. 1) or a percentage (e.g. '50%').
|
|
1831
|
+
|
|
1832
|
+
---
|
|
1833
|
+
|
|
1834
|
+
##### `maxUnavailable`<sup>Optional</sup> <a name="maxUnavailable" id="@bluedynamics/cdk8s-plone.PloneRollingUpdate.property.maxUnavailable"></a>
|
|
1835
|
+
|
|
1836
|
+
```typescript
|
|
1837
|
+
public readonly maxUnavailable: string | number;
|
|
1838
|
+
```
|
|
1839
|
+
|
|
1840
|
+
- *Type:* string | number
|
|
1841
|
+
- *Default:* Kubernetes default ('25%')
|
|
1842
|
+
|
|
1843
|
+
Maximum number of pods that can be unavailable during an update, as an absolute number (e.g. 0) or a percentage (e.g. '25%'). Not to be confused with the PodDisruptionBudget's `maxUnavailable`.
|
|
1844
|
+
|
|
1845
|
+
---
|
|
1846
|
+
|
|
1723
1847
|
### PloneSecurityContext <a name="PloneSecurityContext" id="@bluedynamics/cdk8s-plone.PloneSecurityContext"></a>
|
|
1724
1848
|
|
|
1725
1849
|
Security context for a Plone container.
|
|
@@ -1873,7 +1997,7 @@ const ploneServiceSpec: PloneServiceSpec = { ... }
|
|
|
1873
1997
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.labels">labels</a></code> | <code>{[ key: string ]: string}</code> | Extra labels to add to the Service metadata. |
|
|
1874
1998
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.loadBalancerClass">loadBalancerClass</a></code> | <code>string</code> | Load balancer implementation class. |
|
|
1875
1999
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.loadBalancerSourceRanges">loadBalancerSourceRanges</a></code> | <code>string[]</code> | Source IP ranges allowed to access a LoadBalancer service. |
|
|
1876
|
-
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.overrides">overrides</a></code> | <code>{[ key: string ]: any}</code> | Raw ServiceSpec overrides as a free-form map (e.g. `{ ipFamilyPolicy: 'PreferDualStack' }`). Highest precedence
|
|
2000
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.overrides">overrides</a></code> | <code>{[ key: string ]: any}</code> | Raw ServiceSpec overrides as a free-form map in manifest form (e.g. `{ ipFamilyPolicy: 'PreferDualStack' }`). Highest precedence: each top-level key replaces the field on top of all curated fields and the construct-managed base. Use for any ServiceSpec field not covered above. Keys and values are written to the Service spec verbatim and are not validated by this construct. cdk8s value objects such as `IntOrString.fromNumber(8080)` are unwrapped, and the TypeScript spellings `clusterIp`, `loadBalancerIp` and `sessionAffinityConfig.clientIp` are accepted for `clusterIP`, `loadBalancerIP` and `clientIP`. |
|
|
1877
2001
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.publishNotReadyAddresses">publishNotReadyAddresses</a></code> | <code>boolean</code> | Publish not-ready addresses (e.g. for headless services with StatefulSets). |
|
|
1878
2002
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.sessionAffinity">sessionAffinity</a></code> | <code>string</code> | Session affinity, 'ClientIP' \| 'None'. |
|
|
1879
2003
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneServiceSpec.property.trafficDistribution">trafficDistribution</a></code> | <code>string</code> | Traffic distribution preference, e.g. 'PreferClose' for topology-aware routing. |
|
|
@@ -1968,7 +2092,7 @@ public readonly overrides: {[ key: string ]: any};
|
|
|
1968
2092
|
- *Type:* {[ key: string ]: any}
|
|
1969
2093
|
- *Default:* none
|
|
1970
2094
|
|
|
1971
|
-
Raw ServiceSpec overrides as a free-form map (e.g. `{ ipFamilyPolicy: 'PreferDualStack' }`). Highest precedence
|
|
2095
|
+
Raw ServiceSpec overrides as a free-form map in manifest form (e.g. `{ ipFamilyPolicy: 'PreferDualStack' }`). Highest precedence: each top-level key replaces the field on top of all curated fields and the construct-managed base. Use for any ServiceSpec field not covered above. Keys and values are written to the Service spec verbatim and are not validated by this construct. cdk8s value objects such as `IntOrString.fromNumber(8080)` are unwrapped, and the TypeScript spellings `clusterIp`, `loadBalancerIp` and `sessionAffinityConfig.clientIp` are accepted for `clusterIP`, `loadBalancerIP` and `clientIP`.
|
|
1972
2096
|
|
|
1973
2097
|
---
|
|
1974
2098
|
|
|
@@ -2031,7 +2155,8 @@ Configuration options for PloneVinylCache (cloud-vinyl operator).
|
|
|
2031
2155
|
Creates a VinylCache custom resource that the cloud-vinyl operator
|
|
2032
2156
|
reconciles into a Varnish Cache cluster with agent-based VCL delivery.
|
|
2033
2157
|
|
|
2034
|
-
Requires
|
|
2158
|
+
Requires cloud-vinyl 1.0.0-rc.2 or later in the cluster
|
|
2159
|
+
(`vinyl.bluedynamics.eu/v1`).
|
|
2035
2160
|
|
|
2036
2161
|
#### Initializer <a name="Initializer" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.Initializer"></a>
|
|
2037
2162
|
|
|
@@ -2055,6 +2180,7 @@ const ploneVinylCacheOptions: PloneVinylCacheOptions = { ... }
|
|
|
2055
2180
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.limitMemory">limitMemory</a></code> | <code>string</code> | Memory limit for Varnish pods. |
|
|
2056
2181
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.monitoring">monitoring</a></code> | <code>boolean</code> | Enable Prometheus monitoring. |
|
|
2057
2182
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.nodeSelector">nodeSelector</a></code> | <code>{[ key: string ]: string}</code> | Node selector labels for the Varnish pods. |
|
|
2183
|
+
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.purgeHosts">purgeHosts</a></code> | <code>string[]</code> | Public site hostnames a PURGE through the invalidation proxy applies to, e.g. `['example.org', 'www.example.org']` (`spec.invalidation.purge.hosts`). |
|
|
2058
2184
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.replicas">replicas</a></code> | <code>number</code> | Number of Varnish pod replicas. |
|
|
2059
2185
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.requestCpu">requestCpu</a></code> | <code>string</code> | CPU request for Varnish pods. |
|
|
2060
2186
|
| <code><a href="#@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.requestMemory">requestMemory</a></code> | <code>string</code> | Memory request for Varnish pods. |
|
|
@@ -2150,10 +2276,12 @@ public readonly image: string;
|
|
|
2150
2276
|
```
|
|
2151
2277
|
|
|
2152
2278
|
- *Type:* string
|
|
2153
|
-
- *Default:* 'varnish:
|
|
2279
|
+
- *Default:* 'varnish:9.1.0'
|
|
2154
2280
|
|
|
2155
2281
|
Container image for the Varnish pods.
|
|
2156
2282
|
|
|
2283
|
+
cloud-vinyl 1.0 is tested with the docker-library `varnish` 9.1 image.
|
|
2284
|
+
|
|
2157
2285
|
---
|
|
2158
2286
|
|
|
2159
2287
|
##### `invalidation`<sup>Optional</sup> <a name="invalidation" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.invalidation"></a>
|
|
@@ -2227,6 +2355,25 @@ Constrains pods to nodes matching all specified labels.
|
|
|
2227
2355
|
|
|
2228
2356
|
---
|
|
2229
2357
|
|
|
2358
|
+
##### `purgeHosts`<sup>Optional</sup> <a name="purgeHosts" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.purgeHosts"></a>
|
|
2359
|
+
|
|
2360
|
+
```typescript
|
|
2361
|
+
public readonly purgeHosts: string[];
|
|
2362
|
+
```
|
|
2363
|
+
|
|
2364
|
+
- *Type:* string[]
|
|
2365
|
+
- *Default:* none, purges apply only to the host the client sends
|
|
2366
|
+
|
|
2367
|
+
Public site hostnames a PURGE through the invalidation proxy applies to, e.g. `['example.org', 'www.example.org']` (`spec.invalidation.purge.hosts`).
|
|
2368
|
+
|
|
2369
|
+
Varnish keys cached pages by URL and site host, while clients reach the
|
|
2370
|
+
proxy through `invalidationUrl`. For a purge without an
|
|
2371
|
+
`X-Vinyl-Purge-Host` header, the proxy sends one purge per listed host.
|
|
2372
|
+
Clients that cannot set headers, such as `plone.cachepurging`, need this,
|
|
2373
|
+
or their purges match nothing. At most 16 lowercase hostnames.
|
|
2374
|
+
|
|
2375
|
+
---
|
|
2376
|
+
|
|
2230
2377
|
##### `replicas`<sup>Optional</sup> <a name="replicas" id="@bluedynamics/cdk8s-plone.PloneVinylCacheOptions.property.replicas"></a>
|
|
2231
2378
|
|
|
2232
2379
|
```typescript
|
|
@@ -2273,13 +2420,13 @@ public readonly shardBy: string;
|
|
|
2273
2420
|
```
|
|
2274
2421
|
|
|
2275
2422
|
- *Type:* string
|
|
2276
|
-
- *Default:* operator default ("
|
|
2423
|
+
- *Default:* operator default ("URL")
|
|
2277
2424
|
|
|
2278
2425
|
Shard director: what value is hashed for shard selection.
|
|
2279
2426
|
|
|
2280
|
-
"
|
|
2427
|
+
Only "URL" (the request URL) is supported. cloud-vinyl 1.0 removed "HASH":
|
|
2428
|
+
the cluster routing runs in vcl_recv, before Varnish computes the hash.
|
|
2281
2429
|
Only applied when director is "shard".
|
|
2282
|
-
Requires cloud-vinyl operator >= 0.4.2.
|
|
2283
2430
|
|
|
2284
2431
|
---
|
|
2285
2432
|
|
|
@@ -2297,7 +2444,6 @@ Shard director: which backends the director considers when selecting a shard.
|
|
|
2297
2444
|
"CHOSEN" (default) only considers the chosen backend healthy; "ALL" requires all
|
|
2298
2445
|
backends to be healthy.
|
|
2299
2446
|
Only applied when director is "shard".
|
|
2300
|
-
Requires cloud-vinyl operator >= 0.4.2.
|
|
2301
2447
|
|
|
2302
2448
|
---
|
|
2303
2449
|
|
|
@@ -19,7 +19,9 @@ myst:
|
|
|
19
19
|
|
|
20
20
|
## Prerequisites
|
|
21
21
|
|
|
22
|
-
- The **cloud-vinyl operator** must be installed in your cluster
|
|
22
|
+
- The **cloud-vinyl operator 1.0.0-rc.2 or later** must be installed in your cluster.
|
|
23
|
+
`PloneVinylCache` renders `vinyl.bluedynamics.eu/v1`, which earlier releases do not serve.
|
|
24
|
+
Apply the CRD server-side, as described in the cloud-vinyl release notes.
|
|
23
25
|
- A working Plone deployment using `cdk8s-plone`
|
|
24
26
|
- `@bluedynamics/cdk8s-plone` version with VinylCache support
|
|
25
27
|
|
|
@@ -134,28 +136,36 @@ new PloneVinylCache(chart, 'cache', {
|
|
|
134
136
|
});
|
|
135
137
|
```
|
|
136
138
|
|
|
139
|
+
(vinyl-cache-invalidation)=
|
|
140
|
+
|
|
137
141
|
### Cache invalidation
|
|
138
142
|
|
|
139
143
|
Invalidation is enabled by default (PURGE, BAN, xkey). Configure `plone.cachepurging` to point to the VinylCache invalidation proxy endpoint.
|
|
140
144
|
|
|
141
145
|
The proxy serves the caches of all namespaces and routes by `Host`, so the address must include the namespace.
|
|
142
|
-
Give the chart a namespace and read the address from `invalidationUrl`:
|
|
146
|
+
Give the chart a namespace, list the public hostnames of the site in `purgeHosts`, and read the address from `invalidationUrl`:
|
|
143
147
|
|
|
144
148
|
```typescript
|
|
145
149
|
const chart = new Chart(app, 'site', { namespace: 'plone' });
|
|
146
|
-
const cache = new PloneVinylCache(chart, 'cache', {
|
|
150
|
+
const cache = new PloneVinylCache(chart, 'cache', {
|
|
151
|
+
plone,
|
|
152
|
+
purgeHosts: ['example.org', 'www.example.org'],
|
|
153
|
+
});
|
|
147
154
|
// http://<cache>-invalidation.plone:8090
|
|
148
155
|
console.log(cache.invalidationUrl);
|
|
149
156
|
```
|
|
150
157
|
|
|
158
|
+
Varnish keys a cached page by its URL and its site host.
|
|
159
|
+
`plone.cachepurging` cannot tell the proxy the site host, so the proxy sends one purge per entry in `purgeHosts`.
|
|
160
|
+
Without `purgeHosts`, its purges succeed but remove nothing, and pages only change after their TTL.
|
|
161
|
+
To check that purges work, watch `vinyl_objects_purged_total`.
|
|
162
|
+
|
|
151
163
|
Enter this value as a caching proxy in the `plone.cachepurging` settings.
|
|
152
164
|
Do not build the address from `vinylCacheServiceName` yourself: the proxy rejects the bare `<cache>-invalidation` name with `404 unknown cache`, and `plone.cachepurging` does not log failed purges.
|
|
153
165
|
`invalidationUrl` throws if the chart has no namespace or if `invalidation` is disabled.
|
|
154
166
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
Starting with 0.4.2 the operator's own pod IP is automatically added to the PURGE ACL, so purges from the operator itself work without additional configuration.
|
|
158
|
-
:::
|
|
167
|
+
cloud-vinyl handles PURGE, BAN, and xkey requests in its own VCL with its own access lists.
|
|
168
|
+
A custom `vclRecvSnippet` only runs for `GET` and `HEAD` requests and must not handle them.
|
|
159
169
|
|
|
160
170
|
To disable invalidation:
|
|
161
171
|
|
|
@@ -168,13 +178,13 @@ new PloneVinylCache(chart, 'cache', {
|
|
|
168
178
|
|
|
169
179
|
### Shard director tuning
|
|
170
180
|
|
|
171
|
-
For shard-based load distribution (the default), you can fine-tune the consistent-hash behavior.
|
|
181
|
+
For shard-based load distribution (the default), you can fine-tune the consistent-hash behavior.
|
|
172
182
|
|
|
173
183
|
```typescript
|
|
174
184
|
new PloneVinylCache(chart, 'cache', {
|
|
175
185
|
plone: plone,
|
|
176
186
|
director: 'shard',
|
|
177
|
-
shardBy: 'URL', //
|
|
187
|
+
shardBy: 'URL', // the only supported value; cloud-vinyl 1.0 removed 'HASH'
|
|
178
188
|
shardHealthy: 'ALL', // require all backends healthy (vs. only "CHOSEN")
|
|
179
189
|
shardRampup: '45s', // warm-up window for newly added backends
|
|
180
190
|
shardReplicas: 128, // Ketama replicas per backend
|
|
@@ -183,6 +193,22 @@ new PloneVinylCache(chart, 'cache', {
|
|
|
183
193
|
|
|
184
194
|
Shard options are ignored for non-shard directors (`round_robin`, `random`, `hash`).
|
|
185
195
|
|
|
196
|
+
## Upgrading from cloud-vinyl 0.x
|
|
197
|
+
|
|
198
|
+
This `cdk8s-plone` release targets cloud-vinyl 1.0.
|
|
199
|
+
|
|
200
|
+
1. Upgrade the operator and its CRD to 1.0.0-rc.2 or later first, following the cloud-vinyl release notes.
|
|
201
|
+
The new manifests use `vinyl.bluedynamics.eu/v1`, which older operators reject.
|
|
202
|
+
2. Set `purgeHosts` if you use `plone.cachepurging`, see {ref}`vinyl-cache-invalidation`.
|
|
203
|
+
3. Review the manifest diff:
|
|
204
|
+
- `apiVersion` changes from `v1alpha1` to `v1`.
|
|
205
|
+
- The default image changes from `varnish:7.6` to `varnish:9.1.0`, the image cloud-vinyl 1.0 is tested with.
|
|
206
|
+
Set `image` to keep another one.
|
|
207
|
+
- The default `vclRecv` snippet no longer contains PURGE and BAN handling.
|
|
208
|
+
Since cloud-vinyl 0.7.0 it did not compile, so caches with the default snippet never became ready.
|
|
209
|
+
4. Replace `shardBy: 'HASH'` with `'URL'` or drop it.
|
|
210
|
+
cloud-vinyl 1.0 removed `HASH`, and `PloneVinylCache` rejects it.
|
|
211
|
+
|
|
186
212
|
## Migrating from PloneHttpcache
|
|
187
213
|
|
|
188
214
|
Replace `PloneHttpcache` with `PloneVinylCache`:
|
|
@@ -38,8 +38,18 @@ cdk8s synth
|
|
|
38
38
|
kubectl apply -f dist/
|
|
39
39
|
```
|
|
40
40
|
|
|
41
|
-
Kubernetes replaces the pods with the
|
|
42
|
-
|
|
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.
|
|
43
53
|
|
|
44
54
|
```{important}
|
|
45
55
|
Upgrading to a new Plone major or minor version may require a Plone site upgrade step that `cdk8s-plone` does not perform.
|
|
@@ -98,6 +98,17 @@ backend: {
|
|
|
98
98
|
}
|
|
99
99
|
```
|
|
100
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
|
+
|
|
101
112
|
### Probes
|
|
102
113
|
|
|
103
114
|
Readiness probes are enabled by default; liveness probes are **disabled** by default.
|
|
@@ -138,6 +149,8 @@ It requires Kubernetes 1.30 or later.
|
|
|
138
149
|
|
|
139
150
|
Configure the generated Kubernetes `Service` through the grouped `service` option.
|
|
140
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.
|
|
141
154
|
|
|
142
155
|
```typescript
|
|
143
156
|
backend: {
|
|
@@ -159,6 +172,30 @@ backend: {
|
|
|
159
172
|
The top-level `serviceAnnotations` option is deprecated. Use `service.annotations` instead.
|
|
160
173
|
```
|
|
161
174
|
|
|
175
|
+
### Escape hatch
|
|
176
|
+
|
|
177
|
+
For fields without a dedicated option, patch the generated objects with [JSON Patch](https://cdk8s.io/docs/latest/basics/escape-hatches).
|
|
178
|
+
`Plone` exposes `backendDeployment`, `backendService`, `frontendDeployment`, and `frontendService`.
|
|
179
|
+
The frontend properties are `undefined` for the Blicca variant.
|
|
180
|
+
|
|
181
|
+
```typescript
|
|
182
|
+
import { JsonPatch } from 'cdk8s';
|
|
183
|
+
|
|
184
|
+
const plone = new Plone(chart, 'plone');
|
|
185
|
+
plone.backendDeployment.addJsonPatch(
|
|
186
|
+
JsonPatch.add('/spec/strategy', {
|
|
187
|
+
type: 'RollingUpdate',
|
|
188
|
+
rollingUpdate: { maxUnavailable: 0, maxSurge: '50%' },
|
|
189
|
+
}),
|
|
190
|
+
JsonPatch.add('/spec/template/spec/containers/0/args', ['--debug']),
|
|
191
|
+
);
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
- Patches apply to the final manifest, so you write values in their manifest form, such as `'50%'` or `cpu: '2'`.
|
|
195
|
+
- The Plone container is always `containers/0`.
|
|
196
|
+
- Patches are not validated.
|
|
197
|
+
Prefer a dedicated option where one exists.
|
|
198
|
+
|
|
162
199
|
### Environment variables
|
|
163
200
|
|
|
164
201
|
Pass environment variables with the cdk8s-plus `Env` API, including values sourced from a `Secret`.
|
package/lib/deployment.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ApiObject } from 'cdk8s';
|
|
1
2
|
import * as kplus from 'cdk8s-plus-30';
|
|
2
3
|
import { Construct } from 'constructs';
|
|
3
4
|
import * as k8s from './imports/k8s';
|
|
@@ -23,6 +24,24 @@ export interface PloneImageOptions {
|
|
|
23
24
|
*/
|
|
24
25
|
readonly imagePullPolicy?: string;
|
|
25
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* Rolling update settings for a Deployment (`spec.strategy.rollingUpdate`).
|
|
29
|
+
*/
|
|
30
|
+
export interface PloneRollingUpdate {
|
|
31
|
+
/**
|
|
32
|
+
* Maximum number of pods created above the desired replica count during
|
|
33
|
+
* an update, as an absolute number (e.g. 1) or a percentage (e.g. '50%').
|
|
34
|
+
* @default - Kubernetes default ('25%')
|
|
35
|
+
*/
|
|
36
|
+
readonly maxSurge?: number | string;
|
|
37
|
+
/**
|
|
38
|
+
* Maximum number of pods that can be unavailable during an update, as an
|
|
39
|
+
* absolute number (e.g. 0) or a percentage (e.g. '25%'). Not to be confused
|
|
40
|
+
* with the PodDisruptionBudget's `maxUnavailable`.
|
|
41
|
+
* @default - Kubernetes default ('25%')
|
|
42
|
+
*/
|
|
43
|
+
readonly maxUnavailable?: number | string;
|
|
44
|
+
}
|
|
26
45
|
/**
|
|
27
46
|
* Configuration options for PloneDeployment.
|
|
28
47
|
*/
|
|
@@ -93,12 +112,6 @@ export interface PloneDeploymentOptions {
|
|
|
93
112
|
readonly podAnnotations?: {
|
|
94
113
|
[name: string]: string;
|
|
95
114
|
};
|
|
96
|
-
/**
|
|
97
|
-
* Additional container specification overrides.
|
|
98
|
-
* Advanced use only - merges with generated container spec.
|
|
99
|
-
* @default - undefined
|
|
100
|
-
*/
|
|
101
|
-
readonly ploneContainer?: k8s.Container;
|
|
102
115
|
/**
|
|
103
116
|
* Sidecar containers to run alongside the main container.
|
|
104
117
|
* @example [{ name: 'log-forwarder', image: 'fluentd:latest' }]
|
|
@@ -154,6 +167,11 @@ export interface PloneDeploymentOptions {
|
|
|
154
167
|
* @default - `preStopDelaySeconds` + 30, which keeps the Kubernetes default of 30 seconds for the shutdown itself
|
|
155
168
|
*/
|
|
156
169
|
readonly terminationGracePeriodSeconds?: number;
|
|
170
|
+
/**
|
|
171
|
+
* Rolling update settings, see `PloneRollingUpdate`.
|
|
172
|
+
* @default - Kubernetes default strategy
|
|
173
|
+
*/
|
|
174
|
+
readonly rollingUpdate?: PloneRollingUpdate;
|
|
157
175
|
}
|
|
158
176
|
/**
|
|
159
177
|
* PloneDeployment creates a Kubernetes Deployment for Plone containers.
|
|
@@ -163,5 +181,9 @@ export interface PloneDeploymentOptions {
|
|
|
163
181
|
* and an optional PodDisruptionBudget.
|
|
164
182
|
*/
|
|
165
183
|
export declare class PloneDeployment extends Construct {
|
|
184
|
+
/**
|
|
185
|
+
* The Kubernetes Deployment, for JSON patches as an escape hatch.
|
|
186
|
+
*/
|
|
187
|
+
readonly deployment: ApiObject;
|
|
166
188
|
constructor(scope: Construct, id: string, options: PloneDeploymentOptions);
|
|
167
189
|
}
|