cdk8s-plus-31 2.0.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/.backportrc.json +17 -0
- package/.jsii +90235 -0
- package/CODE_OF_CONDUCT.md +3 -0
- package/CONTRIBUTING.md +185 -0
- package/DCO +34 -0
- package/LICENSE +202 -0
- package/NOTICE +1 -0
- package/OWNERS.md +5 -0
- package/README.md +32 -0
- package/SECURITY.md +5 -0
- package/cdk8s.yaml +8 -0
- package/docs/java.md +23855 -0
- package/docs/plus/config-map.md +98 -0
- package/docs/plus/container.md +133 -0
- package/docs/plus/cronjob.md +67 -0
- package/docs/plus/deployment.md +232 -0
- package/docs/plus/horizontal-pod-autoscaler.md +226 -0
- package/docs/plus/ingress.md +68 -0
- package/docs/plus/job.md +48 -0
- package/docs/plus/namespace.md +58 -0
- package/docs/plus/network-policy.md +341 -0
- package/docs/plus/pod.md +455 -0
- package/docs/plus/pv.md +82 -0
- package/docs/plus/pvc.md +77 -0
- package/docs/plus/rbac.md +104 -0
- package/docs/plus/secret.md +32 -0
- package/docs/plus/service-account.md +35 -0
- package/docs/plus/service.md +41 -0
- package/docs/plus/volume.md +38 -0
- package/docs/python.md +26079 -0
- package/docs/typescript.md +19565 -0
- package/git-hooks/README.md +9 -0
- package/git-hooks/prepare-commit-msg +18 -0
- package/git-hooks/setup.sh +10 -0
- package/lib/_action.d.ts +21 -0
- package/lib/_action.js +32 -0
- package/lib/api-resource.d.ts +298 -0
- package/lib/api-resource.js +430 -0
- package/lib/base.d.ts +79 -0
- package/lib/base.js +92 -0
- package/lib/config-map.d.ts +126 -0
- package/lib/config-map.js +159 -0
- package/lib/container.d.ts +1057 -0
- package/lib/container.js +845 -0
- package/lib/cron-job.d.ts +138 -0
- package/lib/cron-job.js +103 -0
- package/lib/daemon-set.d.ts +45 -0
- package/lib/daemon-set.js +55 -0
- package/lib/deployment.d.ts +223 -0
- package/lib/deployment.js +214 -0
- package/lib/handler.d.ts +62 -0
- package/lib/handler.js +54 -0
- package/lib/horizontal-pod-autoscaler.d.ts +500 -0
- package/lib/horizontal-pod-autoscaler.js +569 -0
- package/lib/imports/k8s.d.ts +21534 -0
- package/lib/imports/k8s.js +16496 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.js +39 -0
- package/lib/ingress.d.ts +230 -0
- package/lib/ingress.js +246 -0
- package/lib/job.d.ts +64 -0
- package/lib/job.js +54 -0
- package/lib/namespace.d.ts +128 -0
- package/lib/namespace.js +109 -0
- package/lib/network-policy.d.ts +311 -0
- package/lib/network-policy.js +344 -0
- package/lib/pod.d.ts +1080 -0
- package/lib/pod.js +1139 -0
- package/lib/probe.d.ts +141 -0
- package/lib/probe.js +77 -0
- package/lib/pv.d.ts +375 -0
- package/lib/pv.js +273 -0
- package/lib/pvc.d.ts +163 -0
- package/lib/pvc.js +152 -0
- package/lib/role-binding.d.ts +138 -0
- package/lib/role-binding.js +165 -0
- package/lib/role.d.ts +268 -0
- package/lib/role.js +401 -0
- package/lib/secret.d.ts +195 -0
- package/lib/secret.js +185 -0
- package/lib/service-account.d.ts +83 -0
- package/lib/service-account.js +105 -0
- package/lib/service.d.ts +289 -0
- package/lib/service.js +182 -0
- package/lib/stateful-set.d.ts +169 -0
- package/lib/stateful-set.js +174 -0
- package/lib/utils.d.ts +4 -0
- package/lib/utils.js +34 -0
- package/lib/volume.d.ts +573 -0
- package/lib/volume.js +371 -0
- package/lib/workload.d.ts +121 -0
- package/lib/workload.js +122 -0
- package/node_modules/balanced-match/.github/FUNDING.yml +2 -0
- package/node_modules/balanced-match/LICENSE.md +21 -0
- package/node_modules/balanced-match/README.md +97 -0
- package/node_modules/balanced-match/index.js +62 -0
- package/node_modules/balanced-match/package.json +48 -0
- package/node_modules/concat-map/.travis.yml +4 -0
- package/node_modules/concat-map/LICENSE +18 -0
- package/node_modules/concat-map/README.markdown +62 -0
- package/node_modules/concat-map/example/map.js +6 -0
- package/node_modules/concat-map/index.js +13 -0
- package/node_modules/concat-map/package.json +43 -0
- package/node_modules/concat-map/test/map.js +39 -0
- package/node_modules/minimatch/LICENSE +15 -0
- package/node_modules/minimatch/README.md +230 -0
- package/node_modules/minimatch/minimatch.js +947 -0
- package/node_modules/minimatch/node_modules/brace-expansion/LICENSE +21 -0
- package/node_modules/minimatch/node_modules/brace-expansion/README.md +129 -0
- package/node_modules/minimatch/node_modules/brace-expansion/index.js +201 -0
- package/node_modules/minimatch/node_modules/brace-expansion/package.json +47 -0
- package/node_modules/minimatch/package.json +33 -0
- package/package.json +186 -0
- package/rotate.md +84 -0
package/lib/probe.d.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
import { Duration } from 'cdk8s';
|
|
2
|
+
import * as container from './container';
|
|
3
|
+
import * as k8s from './imports/k8s';
|
|
4
|
+
/**
|
|
5
|
+
* Probe options.
|
|
6
|
+
*/
|
|
7
|
+
export interface ProbeOptions {
|
|
8
|
+
/**
|
|
9
|
+
* Minimum consecutive failures for the probe to be considered failed after
|
|
10
|
+
* having succeeded.
|
|
11
|
+
*
|
|
12
|
+
* Defaults to 3. Minimum value is 1.
|
|
13
|
+
*
|
|
14
|
+
* @default 3
|
|
15
|
+
*/
|
|
16
|
+
readonly failureThreshold?: number;
|
|
17
|
+
/**
|
|
18
|
+
* Number of seconds after the container has started before liveness probes
|
|
19
|
+
* are initiated.
|
|
20
|
+
*
|
|
21
|
+
* @see https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
|
|
22
|
+
* @default - immediate
|
|
23
|
+
*/
|
|
24
|
+
readonly initialDelaySeconds?: Duration;
|
|
25
|
+
/**
|
|
26
|
+
* How often (in seconds) to perform the probe.
|
|
27
|
+
*
|
|
28
|
+
* Default to 10 seconds. Minimum value is 1.
|
|
29
|
+
*
|
|
30
|
+
* @default Duration.seconds(10) Minimum value is 1.
|
|
31
|
+
*/
|
|
32
|
+
readonly periodSeconds?: Duration;
|
|
33
|
+
/**
|
|
34
|
+
* Minimum consecutive successes for the probe to be considered successful
|
|
35
|
+
* after having failed. Defaults to 1.
|
|
36
|
+
*
|
|
37
|
+
* Must be 1 for liveness and startup. Minimum value is 1.
|
|
38
|
+
*
|
|
39
|
+
* @default 1 Must be 1 for liveness and startup. Minimum value is 1.
|
|
40
|
+
*/
|
|
41
|
+
readonly successThreshold?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Number of seconds after which the probe times out.
|
|
44
|
+
*
|
|
45
|
+
* Defaults to 1 second. Minimum value is 1.
|
|
46
|
+
*
|
|
47
|
+
* @see https://kubernetes.io/docs/concepts/workloads/pods/pod-lifecycle#container-probes
|
|
48
|
+
* @default Duration.seconds(1)
|
|
49
|
+
*/
|
|
50
|
+
readonly timeoutSeconds?: Duration;
|
|
51
|
+
}
|
|
52
|
+
export declare enum ConnectionScheme {
|
|
53
|
+
/**
|
|
54
|
+
* Use HTTP request for connecting to host.
|
|
55
|
+
*/
|
|
56
|
+
HTTP = "HTTP",
|
|
57
|
+
/**
|
|
58
|
+
* Use HTTPS request for connecting to host.
|
|
59
|
+
*/
|
|
60
|
+
HTTPS = "HTTPS"
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Options for `Probe.fromHttpGet()`.
|
|
64
|
+
*/
|
|
65
|
+
export interface HttpGetProbeOptions extends ProbeOptions {
|
|
66
|
+
/**
|
|
67
|
+
* The TCP port to use when sending the GET request.
|
|
68
|
+
*
|
|
69
|
+
* @default - defaults to `container.port`.
|
|
70
|
+
*/
|
|
71
|
+
readonly port?: number;
|
|
72
|
+
/**
|
|
73
|
+
* Scheme to use for connecting to the host (HTTP or HTTPS).
|
|
74
|
+
*
|
|
75
|
+
* @default ConnectionScheme.HTTP
|
|
76
|
+
*/
|
|
77
|
+
readonly scheme?: ConnectionScheme;
|
|
78
|
+
/**
|
|
79
|
+
* The host name to connect to on the container.
|
|
80
|
+
*
|
|
81
|
+
* @default - defaults to the pod IP
|
|
82
|
+
*/
|
|
83
|
+
readonly host?: string;
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Options for `Probe.fromCommand()`.
|
|
87
|
+
*/
|
|
88
|
+
export interface CommandProbeOptions extends ProbeOptions {
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Options for `Probe.fromTcpSocket()`.
|
|
92
|
+
*/
|
|
93
|
+
export interface TcpSocketProbeOptions extends ProbeOptions {
|
|
94
|
+
/**
|
|
95
|
+
* The TCP port to connect to on the container.
|
|
96
|
+
*
|
|
97
|
+
* @default - defaults to `container.port`.
|
|
98
|
+
*/
|
|
99
|
+
readonly port?: number;
|
|
100
|
+
/**
|
|
101
|
+
* The host name to connect to on the container.
|
|
102
|
+
*
|
|
103
|
+
* @default - defaults to the pod IP
|
|
104
|
+
*/
|
|
105
|
+
readonly host?: string;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Probe describes a health check to be performed against a container to
|
|
109
|
+
* determine whether it is alive or ready to receive traffic.
|
|
110
|
+
*/
|
|
111
|
+
export declare class Probe {
|
|
112
|
+
private readonly probeOptions;
|
|
113
|
+
private readonly tcpSocketOptions?;
|
|
114
|
+
private readonly commandOptions?;
|
|
115
|
+
private readonly httpGetOptions?;
|
|
116
|
+
/**
|
|
117
|
+
* Defines a probe based on an HTTP GET request to the IP address of the container.
|
|
118
|
+
*
|
|
119
|
+
* @param path The URL path to hit
|
|
120
|
+
* @param options Options
|
|
121
|
+
*/
|
|
122
|
+
static fromHttpGet(path: string, options?: HttpGetProbeOptions): Probe;
|
|
123
|
+
/**
|
|
124
|
+
* Defines a probe based on a command which is executed within the container.
|
|
125
|
+
*
|
|
126
|
+
* @param command The command to execute
|
|
127
|
+
* @param options Options
|
|
128
|
+
*/
|
|
129
|
+
static fromCommand(command: string[], options?: CommandProbeOptions): Probe;
|
|
130
|
+
/**
|
|
131
|
+
* Defines a probe based opening a connection to a TCP socket on the container.
|
|
132
|
+
*
|
|
133
|
+
* @param options Options
|
|
134
|
+
*/
|
|
135
|
+
static fromTcpSocket(options?: TcpSocketProbeOptions): Probe;
|
|
136
|
+
private constructor();
|
|
137
|
+
/**
|
|
138
|
+
* @internal
|
|
139
|
+
*/
|
|
140
|
+
_toKube(cont: container.Container): k8s.Probe;
|
|
141
|
+
}
|
package/lib/probe.js
ADDED
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.Probe = exports.ConnectionScheme = void 0;
|
|
5
|
+
const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
|
6
|
+
const _action = require("./_action");
|
|
7
|
+
var ConnectionScheme;
|
|
8
|
+
(function (ConnectionScheme) {
|
|
9
|
+
/**
|
|
10
|
+
* Use HTTP request for connecting to host.
|
|
11
|
+
*/
|
|
12
|
+
ConnectionScheme["HTTP"] = "HTTP";
|
|
13
|
+
/**
|
|
14
|
+
* Use HTTPS request for connecting to host.
|
|
15
|
+
*/
|
|
16
|
+
ConnectionScheme["HTTPS"] = "HTTPS";
|
|
17
|
+
})(ConnectionScheme = exports.ConnectionScheme || (exports.ConnectionScheme = {}));
|
|
18
|
+
/**
|
|
19
|
+
* Probe describes a health check to be performed against a container to
|
|
20
|
+
* determine whether it is alive or ready to receive traffic.
|
|
21
|
+
*/
|
|
22
|
+
class Probe {
|
|
23
|
+
constructor(probeOptions, tcpSocketOptions, commandOptions, httpGetOptions) {
|
|
24
|
+
this.probeOptions = probeOptions;
|
|
25
|
+
this.tcpSocketOptions = tcpSocketOptions;
|
|
26
|
+
this.commandOptions = commandOptions;
|
|
27
|
+
this.httpGetOptions = httpGetOptions;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Defines a probe based on an HTTP GET request to the IP address of the container.
|
|
31
|
+
*
|
|
32
|
+
* @param path The URL path to hit
|
|
33
|
+
* @param options Options
|
|
34
|
+
*/
|
|
35
|
+
static fromHttpGet(path, options = {}) {
|
|
36
|
+
return new Probe(options, undefined, undefined, { path, ...options });
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Defines a probe based on a command which is executed within the container.
|
|
40
|
+
*
|
|
41
|
+
* @param command The command to execute
|
|
42
|
+
* @param options Options
|
|
43
|
+
*/
|
|
44
|
+
static fromCommand(command, options = {}) {
|
|
45
|
+
return new Probe(options, undefined, { command, ...options }, undefined);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Defines a probe based opening a connection to a TCP socket on the container.
|
|
49
|
+
*
|
|
50
|
+
* @param options Options
|
|
51
|
+
*/
|
|
52
|
+
static fromTcpSocket(options = {}) {
|
|
53
|
+
return new Probe(options, options, undefined, undefined);
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* @internal
|
|
57
|
+
*/
|
|
58
|
+
_toKube(cont) {
|
|
59
|
+
const exec = this.commandOptions ? _action.Action.fromCommand(this.commandOptions.command) : undefined;
|
|
60
|
+
const httpGet = this.httpGetOptions ? _action.Action.fromHttpGet(cont, this.httpGetOptions.path, this.httpGetOptions) : undefined;
|
|
61
|
+
const tcpSocket = this.tcpSocketOptions ? _action.Action.fromTcpSocket(cont, this.tcpSocketOptions) : undefined;
|
|
62
|
+
return {
|
|
63
|
+
failureThreshold: this.probeOptions.failureThreshold ?? 3,
|
|
64
|
+
initialDelaySeconds: this.probeOptions.initialDelaySeconds ? this.probeOptions.initialDelaySeconds.toSeconds() : undefined,
|
|
65
|
+
periodSeconds: this.probeOptions.periodSeconds ? this.probeOptions.periodSeconds.toSeconds() : undefined,
|
|
66
|
+
successThreshold: this.probeOptions.successThreshold,
|
|
67
|
+
timeoutSeconds: this.probeOptions.timeoutSeconds ? this.probeOptions.timeoutSeconds.toSeconds() : undefined,
|
|
68
|
+
exec: exec,
|
|
69
|
+
httpGet,
|
|
70
|
+
tcpSocket,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
exports.Probe = Probe;
|
|
75
|
+
_a = JSII_RTTI_SY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MucHJvYmVPcHRpb25zLnRpbWVvdXRTZWNvbmRzLnRvU2Vjb25kcygpIDogdW5kZWZpbmVkLFxuICAgICAgZXhlYzogZXhlYyxcbiAgICAgIGh0dHBHZXQsXG4gICAgICB0Y3BTb2NrZXQsXG4gICAgfTtcbiAgfVxufVxuIl19
|
package/lib/pv.d.ts
ADDED
|
@@ -0,0 +1,375 @@
|
|
|
1
|
+
import { ApiObject, Size } from 'cdk8s';
|
|
2
|
+
import { Construct } from 'constructs';
|
|
3
|
+
import * as base from './base';
|
|
4
|
+
import * as k8s from './imports/k8s';
|
|
5
|
+
import * as pvc from './pvc';
|
|
6
|
+
import * as volume from './volume';
|
|
7
|
+
/**
|
|
8
|
+
* Contract of a `PersistentVolumeClaim`.
|
|
9
|
+
*/
|
|
10
|
+
export interface IPersistentVolume extends base.IResource {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Properties for `PersistentVolume`.
|
|
14
|
+
*/
|
|
15
|
+
export interface PersistentVolumeProps extends base.ResourceProps {
|
|
16
|
+
/**
|
|
17
|
+
* Contains all ways the volume can be mounted.
|
|
18
|
+
*
|
|
19
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes#access-modes
|
|
20
|
+
* @default - No access modes.
|
|
21
|
+
*/
|
|
22
|
+
readonly accessModes?: pvc.PersistentVolumeAccessMode[];
|
|
23
|
+
/**
|
|
24
|
+
* What is the storage capacity of this volume.
|
|
25
|
+
*
|
|
26
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes#resources
|
|
27
|
+
* @default - No specified.
|
|
28
|
+
*/
|
|
29
|
+
readonly storage?: Size;
|
|
30
|
+
/**
|
|
31
|
+
* Part of a bi-directional binding between PersistentVolume and PersistentVolumeClaim.
|
|
32
|
+
* Expected to be non-nil when bound.
|
|
33
|
+
*
|
|
34
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes#binding
|
|
35
|
+
* @default - Not bound to a specific claim.
|
|
36
|
+
*/
|
|
37
|
+
readonly claim?: pvc.IPersistentVolumeClaim;
|
|
38
|
+
/**
|
|
39
|
+
* A list of mount options, e.g. ["ro", "soft"]. Not validated - mount will simply fail if one is invalid.
|
|
40
|
+
*
|
|
41
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes/#mount-options
|
|
42
|
+
* @default - No options.
|
|
43
|
+
*/
|
|
44
|
+
readonly mountOptions?: string[];
|
|
45
|
+
/**
|
|
46
|
+
* When a user is done with their volume, they can delete the PVC objects from the API that
|
|
47
|
+
* allows reclamation of the resource. The reclaim policy tells the cluster what to do with
|
|
48
|
+
* the volume after it has been released of its claim.
|
|
49
|
+
*
|
|
50
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes#reclaiming
|
|
51
|
+
* @default PersistentVolumeReclaimPolicy.RETAIN
|
|
52
|
+
*/
|
|
53
|
+
readonly reclaimPolicy?: PersistentVolumeReclaimPolicy;
|
|
54
|
+
/**
|
|
55
|
+
* Name of StorageClass to which this persistent volume belongs.
|
|
56
|
+
*
|
|
57
|
+
* @default - Volume does not belong to any storage class.
|
|
58
|
+
*/
|
|
59
|
+
readonly storageClassName?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Defines what type of volume is required by the claim.
|
|
62
|
+
*
|
|
63
|
+
* @default VolumeMode.FILE_SYSTEM
|
|
64
|
+
*/
|
|
65
|
+
readonly volumeMode?: pvc.PersistentVolumeMode;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A PersistentVolume (PV) is a piece of storage in the cluster that has been
|
|
69
|
+
* provisioned by an administrator or dynamically provisioned using Storage Classes.
|
|
70
|
+
* It is a resource in the cluster just like a node is a cluster resource.
|
|
71
|
+
* PVs are volume plugins like Volumes, but have a lifecycle independent of any
|
|
72
|
+
* individual Pod that uses the PV. This API object captures the details of the
|
|
73
|
+
* implementation of the storage, be that NFS, iSCSI, or a
|
|
74
|
+
* cloud-provider-specific storage system.
|
|
75
|
+
*/
|
|
76
|
+
export declare class PersistentVolume extends base.Resource implements IPersistentVolume, volume.IStorage {
|
|
77
|
+
/**
|
|
78
|
+
* Imports a pv from the cluster as a reference.
|
|
79
|
+
*/
|
|
80
|
+
static fromPersistentVolumeName(scope: Construct, id: string, volumeName: string): IPersistentVolume;
|
|
81
|
+
/**
|
|
82
|
+
* @see base.Resource.apiObject
|
|
83
|
+
*/
|
|
84
|
+
protected readonly apiObject: ApiObject;
|
|
85
|
+
readonly resourceType = "persistentvolumes";
|
|
86
|
+
private _claim?;
|
|
87
|
+
/**
|
|
88
|
+
* Storage size of this volume.
|
|
89
|
+
*/
|
|
90
|
+
readonly storage?: Size;
|
|
91
|
+
/**
|
|
92
|
+
* Volume mode of this volume.
|
|
93
|
+
*/
|
|
94
|
+
readonly mode: pvc.PersistentVolumeMode;
|
|
95
|
+
/**
|
|
96
|
+
* Storage class this volume belongs to.
|
|
97
|
+
*/
|
|
98
|
+
readonly storageClassName?: string;
|
|
99
|
+
/**
|
|
100
|
+
* Access modes requirement of this claim.
|
|
101
|
+
*/
|
|
102
|
+
private readonly _accessModes?;
|
|
103
|
+
/**
|
|
104
|
+
* Mount options of this volume.
|
|
105
|
+
*/
|
|
106
|
+
readonly mountOptions?: string[];
|
|
107
|
+
/**
|
|
108
|
+
* Reclaim policy of this volume.
|
|
109
|
+
*/
|
|
110
|
+
readonly reclaimPolicy: PersistentVolumeReclaimPolicy;
|
|
111
|
+
protected constructor(scope: Construct, id: string, props?: PersistentVolumeProps);
|
|
112
|
+
/**
|
|
113
|
+
* Access modes requirement of this claim.
|
|
114
|
+
*/
|
|
115
|
+
get accessModes(): pvc.PersistentVolumeAccessMode[] | undefined;
|
|
116
|
+
/**
|
|
117
|
+
* PVC this volume is bound to. Undefined means this volume is not yet
|
|
118
|
+
* claimed by any PVC.
|
|
119
|
+
*/
|
|
120
|
+
get claim(): pvc.IPersistentVolumeClaim | undefined;
|
|
121
|
+
/**
|
|
122
|
+
* Reserve a `PersistentVolume` by creating a `PersistentVolumeClaim`
|
|
123
|
+
* that is wired to claim this volume.
|
|
124
|
+
*
|
|
125
|
+
* Note that this method will throw in case the volume is already claimed.
|
|
126
|
+
*
|
|
127
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes/#reserving-a-persistentvolume
|
|
128
|
+
*/
|
|
129
|
+
reserve(): pvc.PersistentVolumeClaim;
|
|
130
|
+
/**
|
|
131
|
+
* Bind a volume to a specific claim.
|
|
132
|
+
* Note that you must also bind the claim to the volume.
|
|
133
|
+
*
|
|
134
|
+
* @see https://kubernetes.io/docs/concepts/storage/persistent-volumes/#binding
|
|
135
|
+
*
|
|
136
|
+
* @param claim The PVC to bind to.
|
|
137
|
+
*/
|
|
138
|
+
bind(claim: pvc.IPersistentVolumeClaim): void;
|
|
139
|
+
asVolume(): volume.Volume;
|
|
140
|
+
/**
|
|
141
|
+
* @internal
|
|
142
|
+
*/
|
|
143
|
+
_toKube(): k8s.PersistentVolumeSpec;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Reclaim Policies.
|
|
147
|
+
*/
|
|
148
|
+
export declare enum PersistentVolumeReclaimPolicy {
|
|
149
|
+
/**
|
|
150
|
+
* The Retain reclaim policy allows for manual reclamation of the resource.
|
|
151
|
+
* When the PersistentVolumeClaim is deleted, the PersistentVolume still exists and the
|
|
152
|
+
* volume is considered "released". But it is not yet available for another claim
|
|
153
|
+
* because the previous claimant's data remains on the volume.
|
|
154
|
+
* An administrator can manually reclaim the volume with the following steps:
|
|
155
|
+
*
|
|
156
|
+
* 1. Delete the PersistentVolume. The associated storage asset in external
|
|
157
|
+
* infrastructure (such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume) still exists after the PV is deleted.
|
|
158
|
+
* 2. Manually clean up the data on the associated storage asset accordingly.
|
|
159
|
+
* 3. Manually delete the associated storage asset.
|
|
160
|
+
*
|
|
161
|
+
* If you want to reuse the same storage asset, create a new PersistentVolume
|
|
162
|
+
* with the same storage asset definition.
|
|
163
|
+
*/
|
|
164
|
+
RETAIN = "Retain",
|
|
165
|
+
/**
|
|
166
|
+
* For volume plugins that support the Delete reclaim policy, deletion removes both the
|
|
167
|
+
* PersistentVolume object from Kubernetes, as well as the associated storage asset in
|
|
168
|
+
* the external infrastructure, such as an AWS EBS, GCE PD, Azure Disk, or Cinder volume.
|
|
169
|
+
* Volumes that were dynamically provisioned inherit the reclaim policy of their StorageClass, which defaults to Delete.
|
|
170
|
+
* The administrator should configure the StorageClass according to users' expectations; otherwise,
|
|
171
|
+
* the PV must be edited or patched after it is created
|
|
172
|
+
*/
|
|
173
|
+
DELETE = "Delete"
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* Properties for `AwsElasticBlockStorePersistentVolume`.
|
|
177
|
+
*/
|
|
178
|
+
export interface AwsElasticBlockStorePersistentVolumeProps extends PersistentVolumeProps {
|
|
179
|
+
/**
|
|
180
|
+
* Unique ID of the persistent disk resource in AWS (Amazon EBS volume). More info: https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
181
|
+
*
|
|
182
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
183
|
+
*/
|
|
184
|
+
readonly volumeId: string;
|
|
185
|
+
/**
|
|
186
|
+
* Filesystem type of the volume that you want to mount.
|
|
187
|
+
* Tip: Ensure that the filesystem type is supported by the host operating system.
|
|
188
|
+
*
|
|
189
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
190
|
+
* @default 'ext4'
|
|
191
|
+
*/
|
|
192
|
+
readonly fsType?: string;
|
|
193
|
+
/**
|
|
194
|
+
* The partition in the volume that you want to mount. If omitted, the default is to mount by volume name.
|
|
195
|
+
* Examples: For volume /dev/sda1, you specify the partition as "1".
|
|
196
|
+
* Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
|
|
197
|
+
*
|
|
198
|
+
* @default - No partition.
|
|
199
|
+
*/
|
|
200
|
+
readonly partition?: number;
|
|
201
|
+
/**
|
|
202
|
+
* Specify "true" to force and set the ReadOnly property in VolumeMounts to "true".
|
|
203
|
+
*
|
|
204
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
205
|
+
* @default false
|
|
206
|
+
*/
|
|
207
|
+
readonly readOnly?: boolean;
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Represents an AWS Disk resource that is attached to a kubelet's host machine and
|
|
211
|
+
* then exposed to the pod.
|
|
212
|
+
*
|
|
213
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
214
|
+
*/
|
|
215
|
+
export declare class AwsElasticBlockStorePersistentVolume extends PersistentVolume {
|
|
216
|
+
/**
|
|
217
|
+
* Volume id of this volume.
|
|
218
|
+
*/
|
|
219
|
+
readonly volumeId: string;
|
|
220
|
+
/**
|
|
221
|
+
* Whether or not it is mounted as a read-only volume.
|
|
222
|
+
*/
|
|
223
|
+
readonly readOnly: boolean;
|
|
224
|
+
/**
|
|
225
|
+
* File system type of this volume.
|
|
226
|
+
*/
|
|
227
|
+
readonly fsType: string;
|
|
228
|
+
/**
|
|
229
|
+
* Partition of this volume.
|
|
230
|
+
*/
|
|
231
|
+
readonly partition?: number;
|
|
232
|
+
constructor(scope: Construct, id: string, props: AwsElasticBlockStorePersistentVolumeProps);
|
|
233
|
+
/**
|
|
234
|
+
* @internal
|
|
235
|
+
*/
|
|
236
|
+
_toKube(): k8s.PersistentVolumeSpec;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Properties for `AzureDiskPersistentVolume`.
|
|
240
|
+
*/
|
|
241
|
+
export interface AzureDiskPersistentVolumeProps extends PersistentVolumeProps {
|
|
242
|
+
/**
|
|
243
|
+
* The Name of the data disk in the blob storage
|
|
244
|
+
*/
|
|
245
|
+
readonly diskName: string;
|
|
246
|
+
/**
|
|
247
|
+
* The URI the data disk in the blob storage
|
|
248
|
+
*/
|
|
249
|
+
readonly diskUri: string;
|
|
250
|
+
/**
|
|
251
|
+
* Host Caching mode.
|
|
252
|
+
*
|
|
253
|
+
* @default - AzureDiskPersistentVolumeCachingMode.NONE.
|
|
254
|
+
*/
|
|
255
|
+
readonly cachingMode?: volume.AzureDiskPersistentVolumeCachingMode;
|
|
256
|
+
/**
|
|
257
|
+
* Filesystem type to mount. Must be a filesystem type supported by the host operating system.
|
|
258
|
+
*
|
|
259
|
+
* @default 'ext4'
|
|
260
|
+
*/
|
|
261
|
+
readonly fsType?: string;
|
|
262
|
+
/**
|
|
263
|
+
* Kind of disk.
|
|
264
|
+
*
|
|
265
|
+
* @default AzureDiskPersistentVolumeKind.SHARED
|
|
266
|
+
*/
|
|
267
|
+
readonly kind?: volume.AzureDiskPersistentVolumeKind;
|
|
268
|
+
/**
|
|
269
|
+
* Force the ReadOnly setting in VolumeMounts.
|
|
270
|
+
*
|
|
271
|
+
* @default false
|
|
272
|
+
*/
|
|
273
|
+
readonly readOnly?: boolean;
|
|
274
|
+
}
|
|
275
|
+
/**
|
|
276
|
+
* AzureDisk represents an Azure Data Disk mount on the host and bind mount to the pod.
|
|
277
|
+
*/
|
|
278
|
+
export declare class AzureDiskPersistentVolume extends PersistentVolume {
|
|
279
|
+
/**
|
|
280
|
+
* Disk name of this volume.
|
|
281
|
+
*/
|
|
282
|
+
readonly diskName: string;
|
|
283
|
+
/**
|
|
284
|
+
* Disk URI of this volume.
|
|
285
|
+
*/
|
|
286
|
+
readonly diskUri: string;
|
|
287
|
+
/**
|
|
288
|
+
* Whether or not it is mounted as a read-only volume.
|
|
289
|
+
*/
|
|
290
|
+
readonly readOnly: boolean;
|
|
291
|
+
/**
|
|
292
|
+
* Caching mode of this volume.
|
|
293
|
+
*/
|
|
294
|
+
readonly cachingMode: volume.AzureDiskPersistentVolumeCachingMode;
|
|
295
|
+
/**
|
|
296
|
+
* File system type of this volume.
|
|
297
|
+
*/
|
|
298
|
+
readonly fsType: string;
|
|
299
|
+
/**
|
|
300
|
+
* Azure kind of this volume.
|
|
301
|
+
*/
|
|
302
|
+
readonly azureKind: volume.AzureDiskPersistentVolumeKind;
|
|
303
|
+
constructor(scope: Construct, id: string, props: AzureDiskPersistentVolumeProps);
|
|
304
|
+
/**
|
|
305
|
+
* @internal
|
|
306
|
+
*
|
|
307
|
+
* @see https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_disk/README.md
|
|
308
|
+
*/
|
|
309
|
+
_toKube(): k8s.PersistentVolumeSpec;
|
|
310
|
+
}
|
|
311
|
+
/**
|
|
312
|
+
* Properties for `GCEPersistentDiskPersistentVolume`.
|
|
313
|
+
*/
|
|
314
|
+
export interface GCEPersistentDiskPersistentVolumeProps extends PersistentVolumeProps {
|
|
315
|
+
/**
|
|
316
|
+
* Unique name of the PD resource in GCE. Used to identify the disk in GCE.
|
|
317
|
+
*
|
|
318
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
|
|
319
|
+
*/
|
|
320
|
+
readonly pdName: string;
|
|
321
|
+
/**
|
|
322
|
+
* Filesystem type of the volume that you want to mount.
|
|
323
|
+
* Tip: Ensure that the filesystem type is supported by the host operating system.
|
|
324
|
+
*
|
|
325
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
326
|
+
* @default 'ext4'
|
|
327
|
+
*/
|
|
328
|
+
readonly fsType?: string;
|
|
329
|
+
/**
|
|
330
|
+
* The partition in the volume that you want to mount. If omitted, the default is to mount by volume name.
|
|
331
|
+
* Examples: For volume /dev/sda1, you specify the partition as "1".
|
|
332
|
+
* Similarly, the volume partition for /dev/sda is "0" (or you can leave the property empty).
|
|
333
|
+
*
|
|
334
|
+
* @default - No partition.
|
|
335
|
+
*/
|
|
336
|
+
readonly partition?: number;
|
|
337
|
+
/**
|
|
338
|
+
* Specify "true" to force and set the ReadOnly property in VolumeMounts to "true".
|
|
339
|
+
*
|
|
340
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#awselasticblockstore
|
|
341
|
+
* @default false
|
|
342
|
+
*/
|
|
343
|
+
readonly readOnly?: boolean;
|
|
344
|
+
}
|
|
345
|
+
/**
|
|
346
|
+
* GCEPersistentDisk represents a GCE Disk resource that is attached to a kubelet's host machine
|
|
347
|
+
* and then exposed to the pod. Provisioned by an admin.
|
|
348
|
+
*
|
|
349
|
+
* @see https://kubernetes.io/docs/concepts/storage/volumes#gcepersistentdisk
|
|
350
|
+
*/
|
|
351
|
+
export declare class GCEPersistentDiskPersistentVolume extends PersistentVolume {
|
|
352
|
+
/**
|
|
353
|
+
* PD resource in GCE of this volume.
|
|
354
|
+
*/
|
|
355
|
+
readonly pdName: string;
|
|
356
|
+
/**
|
|
357
|
+
* Whether or not it is mounted as a read-only volume.
|
|
358
|
+
*/
|
|
359
|
+
readonly readOnly: boolean;
|
|
360
|
+
/**
|
|
361
|
+
* File system type of this volume.
|
|
362
|
+
*/
|
|
363
|
+
readonly fsType: string;
|
|
364
|
+
/**
|
|
365
|
+
* Partition of this volume.
|
|
366
|
+
*/
|
|
367
|
+
readonly partition?: number;
|
|
368
|
+
constructor(scope: Construct, id: string, props: GCEPersistentDiskPersistentVolumeProps);
|
|
369
|
+
/**
|
|
370
|
+
* @internal
|
|
371
|
+
*
|
|
372
|
+
* @see https://github.com/kubernetes/examples/blob/master/staging/volumes/azure_disk/README.md
|
|
373
|
+
*/
|
|
374
|
+
_toKube(): k8s.PersistentVolumeSpec;
|
|
375
|
+
}
|