cdk8s-plus-32 2.4.13 → 2.5.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 +360 -224
- package/docs/java.md +216 -0
- package/docs/plus/volume.md +46 -0
- package/docs/python.md +310 -2
- package/docs/typescript.md +192 -0
- package/lib/api-resource.js +2 -2
- package/lib/base.js +2 -2
- package/lib/config-map.js +1 -1
- package/lib/container.js +6 -6
- package/lib/cron-job.js +1 -1
- package/lib/daemon-set.js +1 -1
- package/lib/deployment.js +3 -3
- package/lib/handler.js +1 -1
- package/lib/horizontal-pod-autoscaler.js +4 -4
- package/lib/imports/k8s.js +156 -156
- package/lib/ingress.js +2 -2
- package/lib/job.js +1 -1
- package/lib/namespace.js +2 -2
- package/lib/network-policy.js +3 -3
- package/lib/pod.d.ts +4 -4
- package/lib/pod.js +22 -18
- package/lib/probe.js +1 -1
- package/lib/pv.js +4 -4
- package/lib/pvc.js +1 -1
- package/lib/role-binding.js +4 -4
- package/lib/role.js +2 -2
- package/lib/secret.js +6 -6
- package/lib/service-account.js +1 -1
- package/lib/service.js +1 -1
- package/lib/stateful-set.d.ts +53 -16
- package/lib/stateful-set.js +78 -8
- package/lib/volume.d.ts +6 -2
- package/lib/volume.js +9 -3
- package/lib/workload.js +2 -2
- package/package.json +3 -3
package/docs/java.md
CHANGED
|
@@ -7023,6 +7023,7 @@ StatefulSet.Builder.create(Construct scope, java.lang.String id)
|
|
|
7023
7023
|
// .replicas(java.lang.Number)
|
|
7024
7024
|
// .service(Service)
|
|
7025
7025
|
// .strategy(StatefulSetUpdateStrategy)
|
|
7026
|
+
// .volumeClaimTemplates(java.util.List<PersistentVolumeClaimTemplateProps>)
|
|
7026
7027
|
.build();
|
|
7027
7028
|
```
|
|
7028
7029
|
|
|
@@ -7307,8 +7308,34 @@ Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in
|
|
|
7307
7308
|
|
|
7308
7309
|
---
|
|
7309
7310
|
|
|
7311
|
+
##### `volumeClaimTemplates`<sup>Optional</sup> <a name="org.cdk8s.plus32.StatefulSetProps.parameter.volumeClaimTemplates"></a>
|
|
7312
|
+
|
|
7313
|
+
- *Type:* java.util.List<[`org.cdk8s.plus32.PersistentVolumeClaimTemplateProps`](#org.cdk8s.plus32.PersistentVolumeClaimTemplateProps)>
|
|
7314
|
+
- *Default:* No volume claim templates will be created.
|
|
7315
|
+
|
|
7316
|
+
A list of PersistentVolumeClaim templates that will be created for each pod in the StatefulSet.
|
|
7317
|
+
|
|
7318
|
+
The StatefulSet controller creates a PVC and a PV for each template based on the pod's ordinal index,
|
|
7319
|
+
ensuring stable storage across pod restarts and rescheduling.
|
|
7320
|
+
|
|
7321
|
+
Each claim in this list must have at least one matching (by name) volumeMount in one of the containers.
|
|
7322
|
+
|
|
7323
|
+
---
|
|
7324
|
+
|
|
7310
7325
|
#### Methods <a name="Methods"></a>
|
|
7311
7326
|
|
|
7327
|
+
##### `addVolumeClaimTemplate` <a name="org.cdk8s.plus32.StatefulSet.addVolumeClaimTemplate"></a>
|
|
7328
|
+
|
|
7329
|
+
```java
|
|
7330
|
+
public addVolumeClaimTemplate(PersistentVolumeClaimTemplateProps template)
|
|
7331
|
+
```
|
|
7332
|
+
|
|
7333
|
+
###### `template`<sup>Required</sup> <a name="org.cdk8s.plus32.StatefulSet.parameter.template"></a>
|
|
7334
|
+
|
|
7335
|
+
- *Type:* [`org.cdk8s.plus32.PersistentVolumeClaimTemplateProps`](#org.cdk8s.plus32.PersistentVolumeClaimTemplateProps)
|
|
7336
|
+
|
|
7337
|
+
---
|
|
7338
|
+
|
|
7312
7339
|
##### `markHasAutoscaler` <a name="org.cdk8s.plus32.StatefulSet.markHasAutoscaler"></a>
|
|
7313
7340
|
|
|
7314
7341
|
```java
|
|
@@ -7406,6 +7433,16 @@ If this is a target of an autoscaler.
|
|
|
7406
7433
|
|
|
7407
7434
|
---
|
|
7408
7435
|
|
|
7436
|
+
##### `volumeClaimTemplates`<sup>Optional</sup> <a name="org.cdk8s.plus32.StatefulSet.property.volumeClaimTemplates"></a>
|
|
7437
|
+
|
|
7438
|
+
```java
|
|
7439
|
+
public java.util.List<PersistentVolumeClaimTemplateProps> getVolumeClaimTemplates();
|
|
7440
|
+
```
|
|
7441
|
+
|
|
7442
|
+
- *Type:* java.util.List<[`org.cdk8s.plus32.PersistentVolumeClaimTemplateProps`](#org.cdk8s.plus32.PersistentVolumeClaimTemplateProps)>
|
|
7443
|
+
|
|
7444
|
+
---
|
|
7445
|
+
|
|
7409
7446
|
|
|
7410
7447
|
### TlsSecret <a name="org.cdk8s.plus32.TlsSecret"></a>
|
|
7411
7448
|
|
|
@@ -7843,6 +7880,32 @@ Volume.fromHostPath(Construct scope, java.lang.String id, java.lang.String name,
|
|
|
7843
7880
|
|
|
7844
7881
|
---
|
|
7845
7882
|
|
|
7883
|
+
##### `fromName` <a name="org.cdk8s.plus32.Volume.fromName"></a>
|
|
7884
|
+
|
|
7885
|
+
```java
|
|
7886
|
+
import org.cdk8s.plus32.Volume;
|
|
7887
|
+
|
|
7888
|
+
Volume.fromName(Construct scope, java.lang.String id, java.lang.String name)
|
|
7889
|
+
```
|
|
7890
|
+
|
|
7891
|
+
###### `scope`<sup>Required</sup> <a name="org.cdk8s.plus32.Volume.parameter.scope"></a>
|
|
7892
|
+
|
|
7893
|
+
- *Type:* [`software.constructs.Construct`](#software.constructs.Construct)
|
|
7894
|
+
|
|
7895
|
+
---
|
|
7896
|
+
|
|
7897
|
+
###### `id`<sup>Required</sup> <a name="org.cdk8s.plus32.Volume.parameter.id"></a>
|
|
7898
|
+
|
|
7899
|
+
- *Type:* `java.lang.String`
|
|
7900
|
+
|
|
7901
|
+
---
|
|
7902
|
+
|
|
7903
|
+
###### `name`<sup>Required</sup> <a name="org.cdk8s.plus32.Volume.parameter.name"></a>
|
|
7904
|
+
|
|
7905
|
+
- *Type:* `java.lang.String`
|
|
7906
|
+
|
|
7907
|
+
---
|
|
7908
|
+
|
|
7846
7909
|
##### `fromNfs` <a name="org.cdk8s.plus32.Volume.fromNfs"></a>
|
|
7847
7910
|
|
|
7848
7911
|
```java
|
|
@@ -15366,6 +15429,140 @@ Defines what type of volume is required by the claim.
|
|
|
15366
15429
|
|
|
15367
15430
|
---
|
|
15368
15431
|
|
|
15432
|
+
### PersistentVolumeClaimTemplateProps <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps"></a>
|
|
15433
|
+
|
|
15434
|
+
A PersistentVolumeClaim template for StatefulSets.
|
|
15435
|
+
|
|
15436
|
+
#### Initializer <a name="[object Object].Initializer"></a>
|
|
15437
|
+
|
|
15438
|
+
```java
|
|
15439
|
+
import org.cdk8s.plus32.PersistentVolumeClaimTemplateProps;
|
|
15440
|
+
|
|
15441
|
+
PersistentVolumeClaimTemplateProps.builder()
|
|
15442
|
+
// .metadata(ApiObjectMetadata)
|
|
15443
|
+
// .accessModes(java.util.List<PersistentVolumeAccessMode>)
|
|
15444
|
+
// .storage(Size)
|
|
15445
|
+
// .storageClassName(java.lang.String)
|
|
15446
|
+
// .volume(IPersistentVolume)
|
|
15447
|
+
// .volumeMode(PersistentVolumeMode)
|
|
15448
|
+
.name(java.lang.String)
|
|
15449
|
+
.build();
|
|
15450
|
+
```
|
|
15451
|
+
|
|
15452
|
+
##### `metadata`<sup>Optional</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.metadata"></a>
|
|
15453
|
+
|
|
15454
|
+
```java
|
|
15455
|
+
public ApiObjectMetadata getMetadata();
|
|
15456
|
+
```
|
|
15457
|
+
|
|
15458
|
+
- *Type:* [`org.cdk8s.ApiObjectMetadata`](#org.cdk8s.ApiObjectMetadata)
|
|
15459
|
+
|
|
15460
|
+
Metadata that all persisted resources must have, which includes all objects users must create.
|
|
15461
|
+
|
|
15462
|
+
---
|
|
15463
|
+
|
|
15464
|
+
##### `accessModes`<sup>Optional</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.accessModes"></a>
|
|
15465
|
+
|
|
15466
|
+
```java
|
|
15467
|
+
public java.util.List<PersistentVolumeAccessMode> getAccessModes();
|
|
15468
|
+
```
|
|
15469
|
+
|
|
15470
|
+
- *Type:* java.util.List<[`org.cdk8s.plus32.PersistentVolumeAccessMode`](#org.cdk8s.plus32.PersistentVolumeAccessMode)>
|
|
15471
|
+
- *Default:* No access modes requirement.
|
|
15472
|
+
|
|
15473
|
+
Contains the access modes the volume should support.
|
|
15474
|
+
|
|
15475
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
|
|
15476
|
+
|
|
15477
|
+
---
|
|
15478
|
+
|
|
15479
|
+
##### `storage`<sup>Optional</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.storage"></a>
|
|
15480
|
+
|
|
15481
|
+
```java
|
|
15482
|
+
public Size getStorage();
|
|
15483
|
+
```
|
|
15484
|
+
|
|
15485
|
+
- *Type:* [`org.cdk8s.Size`](#org.cdk8s.Size)
|
|
15486
|
+
- *Default:* No storage requirement.
|
|
15487
|
+
|
|
15488
|
+
Minimum storage size the volume should have.
|
|
15489
|
+
|
|
15490
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
|
|
15491
|
+
|
|
15492
|
+
---
|
|
15493
|
+
|
|
15494
|
+
##### `storageClassName`<sup>Optional</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.storageClassName"></a>
|
|
15495
|
+
|
|
15496
|
+
```java
|
|
15497
|
+
public java.lang.String getStorageClassName();
|
|
15498
|
+
```
|
|
15499
|
+
|
|
15500
|
+
- *Type:* `java.lang.String`
|
|
15501
|
+
- *Default:* Not set.
|
|
15502
|
+
|
|
15503
|
+
Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:.
|
|
15504
|
+
|
|
15505
|
+
* If the admission plugin is turned on, the storage class marked as default will be used.
|
|
15506
|
+
* If the admission plugin is turned off, the pvc can only be bound to volumes without a storage class.
|
|
15507
|
+
|
|
15508
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
|
|
15509
|
+
|
|
15510
|
+
---
|
|
15511
|
+
|
|
15512
|
+
##### `volume`<sup>Optional</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.volume"></a>
|
|
15513
|
+
|
|
15514
|
+
```java
|
|
15515
|
+
public IPersistentVolume getVolume();
|
|
15516
|
+
```
|
|
15517
|
+
|
|
15518
|
+
- *Type:* [`org.cdk8s.plus32.IPersistentVolume`](#org.cdk8s.plus32.IPersistentVolume)
|
|
15519
|
+
- *Default:* No specific volume binding.
|
|
15520
|
+
|
|
15521
|
+
The PersistentVolume backing this claim.
|
|
15522
|
+
|
|
15523
|
+
The control plane still checks that storage class, access modes,
|
|
15524
|
+
and requested storage size on the volume are valid.
|
|
15525
|
+
|
|
15526
|
+
Note that in order to guarantee a proper binding, the volume should
|
|
15527
|
+
also define a `claimRef` referring to this claim. Otherwise, the volume may be
|
|
15528
|
+
claimed be other pvc's before it gets a chance to bind to this one.
|
|
15529
|
+
|
|
15530
|
+
If the volume is managed (i.e not imported), you can use `pv.claim()` to easily
|
|
15531
|
+
create a bi-directional bounded claim.
|
|
15532
|
+
|
|
15533
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding.
|
|
15534
|
+
|
|
15535
|
+
---
|
|
15536
|
+
|
|
15537
|
+
##### `volumeMode`<sup>Optional</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.volumeMode"></a>
|
|
15538
|
+
|
|
15539
|
+
```java
|
|
15540
|
+
public PersistentVolumeMode getVolumeMode();
|
|
15541
|
+
```
|
|
15542
|
+
|
|
15543
|
+
- *Type:* [`org.cdk8s.plus32.PersistentVolumeMode`](#org.cdk8s.plus32.PersistentVolumeMode)
|
|
15544
|
+
- *Default:* VolumeMode.FILE_SYSTEM
|
|
15545
|
+
|
|
15546
|
+
Defines what type of volume is required by the claim.
|
|
15547
|
+
|
|
15548
|
+
---
|
|
15549
|
+
|
|
15550
|
+
##### `name`<sup>Required</sup> <a name="org.cdk8s.plus32.PersistentVolumeClaimTemplateProps.property.name"></a>
|
|
15551
|
+
|
|
15552
|
+
```java
|
|
15553
|
+
public java.lang.String getName();
|
|
15554
|
+
```
|
|
15555
|
+
|
|
15556
|
+
- *Type:* `java.lang.String`
|
|
15557
|
+
|
|
15558
|
+
The name of the claim that the StatefulSet controller will create for each pod.
|
|
15559
|
+
|
|
15560
|
+
This will be used to name the created PVC in the format <claim-name>-<pod-name>
|
|
15561
|
+
|
|
15562
|
+
This name should match the name of a volume mount in one of the containers.
|
|
15563
|
+
|
|
15564
|
+
---
|
|
15565
|
+
|
|
15369
15566
|
### PersistentVolumeClaimVolumeOptions <a name="org.cdk8s.plus32.PersistentVolumeClaimVolumeOptions"></a>
|
|
15370
15567
|
|
|
15371
15568
|
Options for a PersistentVolumeClaim-based volume.
|
|
@@ -17624,6 +17821,7 @@ StatefulSetProps.builder()
|
|
|
17624
17821
|
// .replicas(java.lang.Number)
|
|
17625
17822
|
// .service(Service)
|
|
17626
17823
|
// .strategy(StatefulSetUpdateStrategy)
|
|
17824
|
+
// .volumeClaimTemplates(java.util.List<PersistentVolumeClaimTemplateProps>)
|
|
17627
17825
|
.build();
|
|
17628
17826
|
```
|
|
17629
17827
|
|
|
@@ -17992,6 +18190,24 @@ Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in
|
|
|
17992
18190
|
|
|
17993
18191
|
---
|
|
17994
18192
|
|
|
18193
|
+
##### `volumeClaimTemplates`<sup>Optional</sup> <a name="org.cdk8s.plus32.StatefulSetProps.property.volumeClaimTemplates"></a>
|
|
18194
|
+
|
|
18195
|
+
```java
|
|
18196
|
+
public java.util.List<PersistentVolumeClaimTemplateProps> getVolumeClaimTemplates();
|
|
18197
|
+
```
|
|
18198
|
+
|
|
18199
|
+
- *Type:* java.util.List<[`org.cdk8s.plus32.PersistentVolumeClaimTemplateProps`](#org.cdk8s.plus32.PersistentVolumeClaimTemplateProps)>
|
|
18200
|
+
- *Default:* No volume claim templates will be created.
|
|
18201
|
+
|
|
18202
|
+
A list of PersistentVolumeClaim templates that will be created for each pod in the StatefulSet.
|
|
18203
|
+
|
|
18204
|
+
The StatefulSet controller creates a PVC and a PV for each template based on the pod's ordinal index,
|
|
18205
|
+
ensuring stable storage across pod restarts and rescheduling.
|
|
18206
|
+
|
|
18207
|
+
Each claim in this list must have at least one matching (by name) volumeMount in one of the containers.
|
|
18208
|
+
|
|
18209
|
+
---
|
|
18210
|
+
|
|
17995
18211
|
### StatefulSetUpdateStrategyRollingUpdateOptions <a name="org.cdk8s.plus32.StatefulSetUpdateStrategyRollingUpdateOptions"></a>
|
|
17996
18212
|
|
|
17997
18213
|
Options for `StatefulSetUpdateStrategy.rollingUpdate`.
|
package/docs/plus/volume.md
CHANGED
|
@@ -36,3 +36,49 @@ const redis = pod.addContainer({
|
|
|
36
36
|
// mount to the redis container.
|
|
37
37
|
redis.mount('/var/lib/redis', data);
|
|
38
38
|
```
|
|
39
|
+
|
|
40
|
+
## Using PersistentVolumeClaim Templates with StatefulSets
|
|
41
|
+
|
|
42
|
+
When working with StatefulSets, you can use PersistentVolumeClaim templates to create stable storage for each pod in the StatefulSet. This allows each pod to have its own storage that persists even if the pod is rescheduled to a different node.
|
|
43
|
+
|
|
44
|
+
```typescript
|
|
45
|
+
import * as kplus from 'cdk8s-plus-32';
|
|
46
|
+
import { Size } from 'cdk8s';
|
|
47
|
+
|
|
48
|
+
const dataVolume = Volume.fromName(chart, "pvc-template-data", "data-volume")
|
|
49
|
+
|
|
50
|
+
// Create a StatefulSet with a PVC template
|
|
51
|
+
const statefulSet = new kplus.StatefulSet(this, 'StatefulSet', {
|
|
52
|
+
containers: [{
|
|
53
|
+
image: 'nginx',
|
|
54
|
+
volumeMounts: [{
|
|
55
|
+
volume: dataVolume,
|
|
56
|
+
path: '/data',
|
|
57
|
+
}, {
|
|
58
|
+
volume: Volume.fromName(chart, "pvc-template-temp", "temp-volume"),
|
|
59
|
+
path: '/data',
|
|
60
|
+
}],
|
|
61
|
+
}],
|
|
62
|
+
// Define PVC templates during initialization
|
|
63
|
+
volumeClaimTemplates: [{
|
|
64
|
+
name: dataVolume.name,
|
|
65
|
+
storage: Size.gibibytes(10),
|
|
66
|
+
accessModes: [kplus.PersistentVolumeAccessMode.READ_WRITE_ONCE],
|
|
67
|
+
storageClassName: 'standard', // Optional: Specify the storage class
|
|
68
|
+
}, {
|
|
69
|
+
name: 'temp-volume', // Must match a volume mount name in a container
|
|
70
|
+
storage: Size.gibibytes(10),
|
|
71
|
+
accessModes: [kplus.PersistentVolumeAccessMode.READ_WRITE_ONCE],
|
|
72
|
+
storageClassName: 'standard', // Optional: Specify the storage class
|
|
73
|
+
}],
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
// Or add PVC templates after creation
|
|
77
|
+
statefulSet.addVolumeClaimTemplate({
|
|
78
|
+
name: 'logs-volume',
|
|
79
|
+
storage: Size.gibibytes(5),
|
|
80
|
+
accessModes: [kplus.PersistentVolumeAccessMode.READ_WRITE_ONCE],
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
Each pod in the StatefulSet will get its own PVC instance based on these templates, with names like `data-volume-my-statefulset-0`, `data-volume-my-statefulset-1`, etc.
|
package/docs/python.md
CHANGED
|
@@ -7999,7 +7999,8 @@ cdk8s_plus_32.StatefulSet(
|
|
|
7999
7999
|
pod_management_policy: PodManagementPolicy = None,
|
|
8000
8000
|
replicas: typing.Union[int, float] = None,
|
|
8001
8001
|
service: Service = None,
|
|
8002
|
-
strategy: StatefulSetUpdateStrategy = None
|
|
8002
|
+
strategy: StatefulSetUpdateStrategy = None,
|
|
8003
|
+
volume_claim_templates: typing.List[PersistentVolumeClaimTemplateProps] = None
|
|
8003
8004
|
)
|
|
8004
8005
|
```
|
|
8005
8006
|
|
|
@@ -8284,8 +8285,122 @@ Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in
|
|
|
8284
8285
|
|
|
8285
8286
|
---
|
|
8286
8287
|
|
|
8288
|
+
##### `volume_claim_templates`<sup>Optional</sup> <a name="cdk8s_plus_32.StatefulSetProps.parameter.volume_claim_templates"></a>
|
|
8289
|
+
|
|
8290
|
+
- *Type:* typing.List[[`cdk8s_plus_32.PersistentVolumeClaimTemplateProps`](#cdk8s_plus_32.PersistentVolumeClaimTemplateProps)]
|
|
8291
|
+
- *Default:* No volume claim templates will be created.
|
|
8292
|
+
|
|
8293
|
+
A list of PersistentVolumeClaim templates that will be created for each pod in the StatefulSet.
|
|
8294
|
+
|
|
8295
|
+
The StatefulSet controller creates a PVC and a PV for each template based on the pod's ordinal index,
|
|
8296
|
+
ensuring stable storage across pod restarts and rescheduling.
|
|
8297
|
+
|
|
8298
|
+
Each claim in this list must have at least one matching (by name) volumeMount in one of the containers.
|
|
8299
|
+
|
|
8300
|
+
---
|
|
8301
|
+
|
|
8287
8302
|
#### Methods <a name="Methods"></a>
|
|
8288
8303
|
|
|
8304
|
+
##### `add_volume_claim_template` <a name="cdk8s_plus_32.StatefulSet.add_volume_claim_template"></a>
|
|
8305
|
+
|
|
8306
|
+
```python
|
|
8307
|
+
def add_volume_claim_template(
|
|
8308
|
+
metadata: ApiObjectMetadata = None,
|
|
8309
|
+
access_modes: typing.List[PersistentVolumeAccessMode] = None,
|
|
8310
|
+
storage: Size = None,
|
|
8311
|
+
storage_class_name: str = None,
|
|
8312
|
+
volume: IPersistentVolume = None,
|
|
8313
|
+
volume_mode: PersistentVolumeMode = None,
|
|
8314
|
+
name: str
|
|
8315
|
+
)
|
|
8316
|
+
```
|
|
8317
|
+
|
|
8318
|
+
###### `metadata`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.metadata"></a>
|
|
8319
|
+
|
|
8320
|
+
- *Type:* [`cdk8s.ApiObjectMetadata`](#cdk8s.ApiObjectMetadata)
|
|
8321
|
+
|
|
8322
|
+
Metadata that all persisted resources must have, which includes all objects users must create.
|
|
8323
|
+
|
|
8324
|
+
---
|
|
8325
|
+
|
|
8326
|
+
###### `access_modes`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.access_modes"></a>
|
|
8327
|
+
|
|
8328
|
+
- *Type:* typing.List[[`cdk8s_plus_32.PersistentVolumeAccessMode`](#cdk8s_plus_32.PersistentVolumeAccessMode)]
|
|
8329
|
+
- *Default:* No access modes requirement.
|
|
8330
|
+
|
|
8331
|
+
Contains the access modes the volume should support.
|
|
8332
|
+
|
|
8333
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
|
|
8334
|
+
|
|
8335
|
+
---
|
|
8336
|
+
|
|
8337
|
+
###### `storage`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.storage"></a>
|
|
8338
|
+
|
|
8339
|
+
- *Type:* [`cdk8s.Size`](#cdk8s.Size)
|
|
8340
|
+
- *Default:* No storage requirement.
|
|
8341
|
+
|
|
8342
|
+
Minimum storage size the volume should have.
|
|
8343
|
+
|
|
8344
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
|
|
8345
|
+
|
|
8346
|
+
---
|
|
8347
|
+
|
|
8348
|
+
###### `storage_class_name`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.storage_class_name"></a>
|
|
8349
|
+
|
|
8350
|
+
- *Type:* `str`
|
|
8351
|
+
- *Default:* Not set.
|
|
8352
|
+
|
|
8353
|
+
Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:.
|
|
8354
|
+
|
|
8355
|
+
* If the admission plugin is turned on, the storage class marked as default will be used.
|
|
8356
|
+
* If the admission plugin is turned off, the pvc can only be bound to volumes without a storage class.
|
|
8357
|
+
|
|
8358
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
|
|
8359
|
+
|
|
8360
|
+
---
|
|
8361
|
+
|
|
8362
|
+
###### `volume`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.volume"></a>
|
|
8363
|
+
|
|
8364
|
+
- *Type:* [`cdk8s_plus_32.IPersistentVolume`](#cdk8s_plus_32.IPersistentVolume)
|
|
8365
|
+
- *Default:* No specific volume binding.
|
|
8366
|
+
|
|
8367
|
+
The PersistentVolume backing this claim.
|
|
8368
|
+
|
|
8369
|
+
The control plane still checks that storage class, access modes,
|
|
8370
|
+
and requested storage size on the volume are valid.
|
|
8371
|
+
|
|
8372
|
+
Note that in order to guarantee a proper binding, the volume should
|
|
8373
|
+
also define a `claimRef` referring to this claim. Otherwise, the volume may be
|
|
8374
|
+
claimed be other pvc's before it gets a chance to bind to this one.
|
|
8375
|
+
|
|
8376
|
+
If the volume is managed (i.e not imported), you can use `pv.claim()` to easily
|
|
8377
|
+
create a bi-directional bounded claim.
|
|
8378
|
+
|
|
8379
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding.
|
|
8380
|
+
|
|
8381
|
+
---
|
|
8382
|
+
|
|
8383
|
+
###### `volume_mode`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.volume_mode"></a>
|
|
8384
|
+
|
|
8385
|
+
- *Type:* [`cdk8s_plus_32.PersistentVolumeMode`](#cdk8s_plus_32.PersistentVolumeMode)
|
|
8386
|
+
- *Default:* VolumeMode.FILE_SYSTEM
|
|
8387
|
+
|
|
8388
|
+
Defines what type of volume is required by the claim.
|
|
8389
|
+
|
|
8390
|
+
---
|
|
8391
|
+
|
|
8392
|
+
###### `name`<sup>Required</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.parameter.name"></a>
|
|
8393
|
+
|
|
8394
|
+
- *Type:* `str`
|
|
8395
|
+
|
|
8396
|
+
The name of the claim that the StatefulSet controller will create for each pod.
|
|
8397
|
+
|
|
8398
|
+
This will be used to name the created PVC in the format <claim-name>-<pod-name>
|
|
8399
|
+
|
|
8400
|
+
This name should match the name of a volume mount in one of the containers.
|
|
8401
|
+
|
|
8402
|
+
---
|
|
8403
|
+
|
|
8289
8404
|
##### `mark_has_autoscaler` <a name="cdk8s_plus_32.StatefulSet.mark_has_autoscaler"></a>
|
|
8290
8405
|
|
|
8291
8406
|
```python
|
|
@@ -8383,6 +8498,16 @@ If this is a target of an autoscaler.
|
|
|
8383
8498
|
|
|
8384
8499
|
---
|
|
8385
8500
|
|
|
8501
|
+
##### `volume_claim_templates`<sup>Optional</sup> <a name="cdk8s_plus_32.StatefulSet.property.volume_claim_templates"></a>
|
|
8502
|
+
|
|
8503
|
+
```python
|
|
8504
|
+
volume_claim_templates: typing.List[PersistentVolumeClaimTemplateProps]
|
|
8505
|
+
```
|
|
8506
|
+
|
|
8507
|
+
- *Type:* typing.List[[`cdk8s_plus_32.PersistentVolumeClaimTemplateProps`](#cdk8s_plus_32.PersistentVolumeClaimTemplateProps)]
|
|
8508
|
+
|
|
8509
|
+
---
|
|
8510
|
+
|
|
8386
8511
|
|
|
8387
8512
|
### TlsSecret <a name="cdk8s_plus_32.TlsSecret"></a>
|
|
8388
8513
|
|
|
@@ -9100,6 +9225,36 @@ The expected type of the path found on the host.
|
|
|
9100
9225
|
|
|
9101
9226
|
---
|
|
9102
9227
|
|
|
9228
|
+
##### `from_name` <a name="cdk8s_plus_32.Volume.from_name"></a>
|
|
9229
|
+
|
|
9230
|
+
```python
|
|
9231
|
+
import cdk8s_plus_32
|
|
9232
|
+
|
|
9233
|
+
cdk8s_plus_32.Volume.from_name(
|
|
9234
|
+
scope: Construct,
|
|
9235
|
+
id: str,
|
|
9236
|
+
name: str
|
|
9237
|
+
)
|
|
9238
|
+
```
|
|
9239
|
+
|
|
9240
|
+
###### `scope`<sup>Required</sup> <a name="cdk8s_plus_32.Volume.parameter.scope"></a>
|
|
9241
|
+
|
|
9242
|
+
- *Type:* [`constructs.Construct`](#constructs.Construct)
|
|
9243
|
+
|
|
9244
|
+
---
|
|
9245
|
+
|
|
9246
|
+
###### `id`<sup>Required</sup> <a name="cdk8s_plus_32.Volume.parameter.id"></a>
|
|
9247
|
+
|
|
9248
|
+
- *Type:* `str`
|
|
9249
|
+
|
|
9250
|
+
---
|
|
9251
|
+
|
|
9252
|
+
###### `name`<sup>Required</sup> <a name="cdk8s_plus_32.Volume.parameter.name"></a>
|
|
9253
|
+
|
|
9254
|
+
- *Type:* `str`
|
|
9255
|
+
|
|
9256
|
+
---
|
|
9257
|
+
|
|
9103
9258
|
##### `from_nfs` <a name="cdk8s_plus_32.Volume.from_nfs"></a>
|
|
9104
9259
|
|
|
9105
9260
|
```python
|
|
@@ -16718,6 +16873,140 @@ Defines what type of volume is required by the claim.
|
|
|
16718
16873
|
|
|
16719
16874
|
---
|
|
16720
16875
|
|
|
16876
|
+
### PersistentVolumeClaimTemplateProps <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps"></a>
|
|
16877
|
+
|
|
16878
|
+
A PersistentVolumeClaim template for StatefulSets.
|
|
16879
|
+
|
|
16880
|
+
#### Initializer <a name="[object Object].Initializer"></a>
|
|
16881
|
+
|
|
16882
|
+
```python
|
|
16883
|
+
import cdk8s_plus_32
|
|
16884
|
+
|
|
16885
|
+
cdk8s_plus_32.PersistentVolumeClaimTemplateProps(
|
|
16886
|
+
metadata: ApiObjectMetadata = None,
|
|
16887
|
+
access_modes: typing.List[PersistentVolumeAccessMode] = None,
|
|
16888
|
+
storage: Size = None,
|
|
16889
|
+
storage_class_name: str = None,
|
|
16890
|
+
volume: IPersistentVolume = None,
|
|
16891
|
+
volume_mode: PersistentVolumeMode = None,
|
|
16892
|
+
name: str
|
|
16893
|
+
)
|
|
16894
|
+
```
|
|
16895
|
+
|
|
16896
|
+
##### `metadata`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.metadata"></a>
|
|
16897
|
+
|
|
16898
|
+
```python
|
|
16899
|
+
metadata: ApiObjectMetadata
|
|
16900
|
+
```
|
|
16901
|
+
|
|
16902
|
+
- *Type:* [`cdk8s.ApiObjectMetadata`](#cdk8s.ApiObjectMetadata)
|
|
16903
|
+
|
|
16904
|
+
Metadata that all persisted resources must have, which includes all objects users must create.
|
|
16905
|
+
|
|
16906
|
+
---
|
|
16907
|
+
|
|
16908
|
+
##### `access_modes`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.access_modes"></a>
|
|
16909
|
+
|
|
16910
|
+
```python
|
|
16911
|
+
access_modes: typing.List[PersistentVolumeAccessMode]
|
|
16912
|
+
```
|
|
16913
|
+
|
|
16914
|
+
- *Type:* typing.List[[`cdk8s_plus_32.PersistentVolumeAccessMode`](#cdk8s_plus_32.PersistentVolumeAccessMode)]
|
|
16915
|
+
- *Default:* No access modes requirement.
|
|
16916
|
+
|
|
16917
|
+
Contains the access modes the volume should support.
|
|
16918
|
+
|
|
16919
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes-1
|
|
16920
|
+
|
|
16921
|
+
---
|
|
16922
|
+
|
|
16923
|
+
##### `storage`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.storage"></a>
|
|
16924
|
+
|
|
16925
|
+
```python
|
|
16926
|
+
storage: Size
|
|
16927
|
+
```
|
|
16928
|
+
|
|
16929
|
+
- *Type:* [`cdk8s.Size`](#cdk8s.Size)
|
|
16930
|
+
- *Default:* No storage requirement.
|
|
16931
|
+
|
|
16932
|
+
Minimum storage size the volume should have.
|
|
16933
|
+
|
|
16934
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
|
|
16935
|
+
|
|
16936
|
+
---
|
|
16937
|
+
|
|
16938
|
+
##### `storage_class_name`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.storage_class_name"></a>
|
|
16939
|
+
|
|
16940
|
+
```python
|
|
16941
|
+
storage_class_name: str
|
|
16942
|
+
```
|
|
16943
|
+
|
|
16944
|
+
- *Type:* `str`
|
|
16945
|
+
- *Default:* Not set.
|
|
16946
|
+
|
|
16947
|
+
Name of the StorageClass required by the claim. When this property is not set, the behavior is as follows:.
|
|
16948
|
+
|
|
16949
|
+
* If the admission plugin is turned on, the storage class marked as default will be used.
|
|
16950
|
+
* If the admission plugin is turned off, the pvc can only be bound to volumes without a storage class.
|
|
16951
|
+
|
|
16952
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes#class-1
|
|
16953
|
+
|
|
16954
|
+
---
|
|
16955
|
+
|
|
16956
|
+
##### `volume`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.volume"></a>
|
|
16957
|
+
|
|
16958
|
+
```python
|
|
16959
|
+
volume: IPersistentVolume
|
|
16960
|
+
```
|
|
16961
|
+
|
|
16962
|
+
- *Type:* [`cdk8s_plus_32.IPersistentVolume`](#cdk8s_plus_32.IPersistentVolume)
|
|
16963
|
+
- *Default:* No specific volume binding.
|
|
16964
|
+
|
|
16965
|
+
The PersistentVolume backing this claim.
|
|
16966
|
+
|
|
16967
|
+
The control plane still checks that storage class, access modes,
|
|
16968
|
+
and requested storage size on the volume are valid.
|
|
16969
|
+
|
|
16970
|
+
Note that in order to guarantee a proper binding, the volume should
|
|
16971
|
+
also define a `claimRef` referring to this claim. Otherwise, the volume may be
|
|
16972
|
+
claimed be other pvc's before it gets a chance to bind to this one.
|
|
16973
|
+
|
|
16974
|
+
If the volume is managed (i.e not imported), you can use `pv.claim()` to easily
|
|
16975
|
+
create a bi-directional bounded claim.
|
|
16976
|
+
|
|
16977
|
+
> https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding.
|
|
16978
|
+
|
|
16979
|
+
---
|
|
16980
|
+
|
|
16981
|
+
##### `volume_mode`<sup>Optional</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.volume_mode"></a>
|
|
16982
|
+
|
|
16983
|
+
```python
|
|
16984
|
+
volume_mode: PersistentVolumeMode
|
|
16985
|
+
```
|
|
16986
|
+
|
|
16987
|
+
- *Type:* [`cdk8s_plus_32.PersistentVolumeMode`](#cdk8s_plus_32.PersistentVolumeMode)
|
|
16988
|
+
- *Default:* VolumeMode.FILE_SYSTEM
|
|
16989
|
+
|
|
16990
|
+
Defines what type of volume is required by the claim.
|
|
16991
|
+
|
|
16992
|
+
---
|
|
16993
|
+
|
|
16994
|
+
##### `name`<sup>Required</sup> <a name="cdk8s_plus_32.PersistentVolumeClaimTemplateProps.property.name"></a>
|
|
16995
|
+
|
|
16996
|
+
```python
|
|
16997
|
+
name: str
|
|
16998
|
+
```
|
|
16999
|
+
|
|
17000
|
+
- *Type:* `str`
|
|
17001
|
+
|
|
17002
|
+
The name of the claim that the StatefulSet controller will create for each pod.
|
|
17003
|
+
|
|
17004
|
+
This will be used to name the created PVC in the format <claim-name>-<pod-name>
|
|
17005
|
+
|
|
17006
|
+
This name should match the name of a volume mount in one of the containers.
|
|
17007
|
+
|
|
17008
|
+
---
|
|
17009
|
+
|
|
16721
17010
|
### PersistentVolumeClaimVolumeOptions <a name="cdk8s_plus_32.PersistentVolumeClaimVolumeOptions"></a>
|
|
16722
17011
|
|
|
16723
17012
|
Options for a PersistentVolumeClaim-based volume.
|
|
@@ -18975,7 +19264,8 @@ cdk8s_plus_32.StatefulSetProps(
|
|
|
18975
19264
|
pod_management_policy: PodManagementPolicy = None,
|
|
18976
19265
|
replicas: typing.Union[int, float] = None,
|
|
18977
19266
|
service: Service = None,
|
|
18978
|
-
strategy: StatefulSetUpdateStrategy = None
|
|
19267
|
+
strategy: StatefulSetUpdateStrategy = None,
|
|
19268
|
+
volume_claim_templates: typing.List[PersistentVolumeClaimTemplateProps] = None
|
|
18979
19269
|
)
|
|
18980
19270
|
```
|
|
18981
19271
|
|
|
@@ -19344,6 +19634,24 @@ Indicates the StatefulSetUpdateStrategy that will be employed to update Pods in
|
|
|
19344
19634
|
|
|
19345
19635
|
---
|
|
19346
19636
|
|
|
19637
|
+
##### `volume_claim_templates`<sup>Optional</sup> <a name="cdk8s_plus_32.StatefulSetProps.property.volume_claim_templates"></a>
|
|
19638
|
+
|
|
19639
|
+
```python
|
|
19640
|
+
volume_claim_templates: typing.List[PersistentVolumeClaimTemplateProps]
|
|
19641
|
+
```
|
|
19642
|
+
|
|
19643
|
+
- *Type:* typing.List[[`cdk8s_plus_32.PersistentVolumeClaimTemplateProps`](#cdk8s_plus_32.PersistentVolumeClaimTemplateProps)]
|
|
19644
|
+
- *Default:* No volume claim templates will be created.
|
|
19645
|
+
|
|
19646
|
+
A list of PersistentVolumeClaim templates that will be created for each pod in the StatefulSet.
|
|
19647
|
+
|
|
19648
|
+
The StatefulSet controller creates a PVC and a PV for each template based on the pod's ordinal index,
|
|
19649
|
+
ensuring stable storage across pod restarts and rescheduling.
|
|
19650
|
+
|
|
19651
|
+
Each claim in this list must have at least one matching (by name) volumeMount in one of the containers.
|
|
19652
|
+
|
|
19653
|
+
---
|
|
19654
|
+
|
|
19347
19655
|
### StatefulSetUpdateStrategyRollingUpdateOptions <a name="cdk8s_plus_32.StatefulSetUpdateStrategyRollingUpdateOptions"></a>
|
|
19348
19656
|
|
|
19349
19657
|
Options for `StatefulSetUpdateStrategy.rollingUpdate`.
|