org.cdk8s.plus.Volume Maven / Gradle / Ivy
Show all versions of cdk8s-plus Show documentation
package org.cdk8s.plus;
/**
* Volume represents a named volume in a pod that may be accessed by any container in the pod.
*
* Docker also has a concept of volumes, though it is somewhat looser and less
* managed. In Docker, a volume is simply a directory on disk or in another
* Container. Lifetimes are not managed and until very recently there were only
* local-disk-backed volumes. Docker now provides volume drivers, but the
* functionality is very limited for now (e.g. as of Docker 1.7 only one volume
* driver is allowed per Container and there is no way to pass parameters to
* volumes).
*
* A Kubernetes volume, on the other hand, has an explicit lifetime - the same
* as the Pod that encloses it. Consequently, a volume outlives any Containers
* that run within the Pod, and data is preserved across Container restarts. Of
* course, when a Pod ceases to exist, the volume will cease to exist, too.
* Perhaps more importantly than this, Kubernetes supports many types of
* volumes, and a Pod can use any number of them simultaneously.
*
* At its core, a volume is just a directory, possibly with some data in it,
* which is accessible to the Containers in a Pod. How that directory comes to
* be, the medium that backs it, and the contents of it are determined by the
* particular volume type used.
*
* To use a volume, a Pod specifies what volumes to provide for the Pod (the
* .spec.volumes field) and where to mount those into Containers (the
* .spec.containers[*].volumeMounts field).
*
* A process in a container sees a filesystem view composed from their Docker
* image and volumes. The Docker image is at the root of the filesystem
* hierarchy, and any volumes are mounted at the specified paths within the
* image. Volumes can not mount onto other volumes
*
* EXPERIMENTAL
*/
@javax.annotation.Generated(value = "jsii-pacmak/1.7.0 (build 179a3a5)", date = "2020-06-29T13:29:38.544Z")
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
@software.amazon.jsii.Jsii(module = org.cdk8s.plus.$Module.class, fqn = "cdk8s-plus.Volume")
public class Volume extends software.amazon.jsii.JsiiObject {
protected Volume(final software.amazon.jsii.JsiiObjectRef objRef) {
super(objRef);
}
protected Volume(final software.amazon.jsii.JsiiObject.InitializationMode initializationMode) {
super(initializationMode);
}
/**
* EXPERIMENTAL
*
* @param name This parameter is required.
* @param config This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
protected Volume(final @org.jetbrains.annotations.NotNull java.lang.String name, final @org.jetbrains.annotations.NotNull java.lang.Object config) {
super(software.amazon.jsii.JsiiObject.InitializationMode.JSII);
software.amazon.jsii.JsiiEngine.getInstance().createNewObject(this, new Object[] { java.util.Objects.requireNonNull(name, "name is required"), config });
}
/**
* Populate the volume from a ConfigMap.
*
* The configMap resource provides a way to inject configuration data into
* Pods. The data stored in a ConfigMap object can be referenced in a volume
* of type configMap and then consumed by containerized applications running
* in a Pod.
*
* When referencing a configMap object, you can simply provide its name in the
* volume to reference it. You can also customize the path to use for a
* specific entry in the ConfigMap.
*
* EXPERIMENTAL
*
* @param configMap The config map to use to populate the volume. This parameter is required.
* @param options Options.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull org.cdk8s.plus.Volume fromConfigMap(final @org.jetbrains.annotations.NotNull org.cdk8s.plus.IConfigMap configMap, final @org.jetbrains.annotations.Nullable org.cdk8s.plus.ConfigMapVolumeOptions options) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus.Volume.class, "fromConfigMap", org.cdk8s.plus.Volume.class, new Object[] { java.util.Objects.requireNonNull(configMap, "configMap is required"), options });
}
/**
* Populate the volume from a ConfigMap.
*
* The configMap resource provides a way to inject configuration data into
* Pods. The data stored in a ConfigMap object can be referenced in a volume
* of type configMap and then consumed by containerized applications running
* in a Pod.
*
* When referencing a configMap object, you can simply provide its name in the
* volume to reference it. You can also customize the path to use for a
* specific entry in the ConfigMap.
*
* EXPERIMENTAL
*
* @param configMap The config map to use to populate the volume. This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull org.cdk8s.plus.Volume fromConfigMap(final @org.jetbrains.annotations.NotNull org.cdk8s.plus.IConfigMap configMap) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus.Volume.class, "fromConfigMap", org.cdk8s.plus.Volume.class, new Object[] { java.util.Objects.requireNonNull(configMap, "configMap is required") });
}
/**
* An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node.
*
* As the name says, it is
* initially empty. Containers in the Pod can all read and write the same
* files in the emptyDir volume, though that volume can be mounted at the same
* or different paths in each Container. When a Pod is removed from a node for
* any reason, the data in the emptyDir is deleted forever.
*
* EXPERIMENTAL
*
* @see http://kubernetes.io/docs/user-guide/volumes#emptydir
* @param name This parameter is required.
* @param options - Additional options.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull org.cdk8s.plus.Volume fromEmptyDir(final @org.jetbrains.annotations.NotNull java.lang.String name, final @org.jetbrains.annotations.Nullable org.cdk8s.plus.EmptyDirVolumeOptions options) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus.Volume.class, "fromEmptyDir", org.cdk8s.plus.Volume.class, new Object[] { java.util.Objects.requireNonNull(name, "name is required"), options });
}
/**
* An emptyDir volume is first created when a Pod is assigned to a Node, and exists as long as that Pod is running on that node.
*
* As the name says, it is
* initially empty. Containers in the Pod can all read and write the same
* files in the emptyDir volume, though that volume can be mounted at the same
* or different paths in each Container. When a Pod is removed from a node for
* any reason, the data in the emptyDir is deleted forever.
*
* EXPERIMENTAL
*
* @see http://kubernetes.io/docs/user-guide/volumes#emptydir
* @param name This parameter is required.
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public static @org.jetbrains.annotations.NotNull org.cdk8s.plus.Volume fromEmptyDir(final @org.jetbrains.annotations.NotNull java.lang.String name) {
return software.amazon.jsii.JsiiObject.jsiiStaticCall(org.cdk8s.plus.Volume.class, "fromEmptyDir", org.cdk8s.plus.Volume.class, new Object[] { java.util.Objects.requireNonNull(name, "name is required") });
}
/**
* EXPERIMENTAL
*/
@software.amazon.jsii.Stability(software.amazon.jsii.Stability.Level.Experimental)
public @org.jetbrains.annotations.NotNull java.lang.String getName() {
return this.jsiiGet("name", java.lang.String.class);
}
}