Class EksVolume
A Volume that can be mounted to a container supported by EKS.
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public abstract class EksVolume : DeputyBase
Syntax (vb)
Public MustInherit Class EksVolume Inherits DeputyBase
Remarks
ExampleMetadata: infused
Examples
var jobDefn = new EksJobDefinition(this, "eksf2", new EksJobDefinitionProps {
Container = new EksContainerDefinition(this, "container", new EksContainerDefinitionProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
Volumes = new [] { EksVolume.EmptyDir(new EmptyDirVolumeOptions {
Name = "myEmptyDirVolume",
MountPath = "/mount/path",
Medium = EmptyDirMediumType.MEMORY,
Readonly = true,
SizeLimit = Size.Mebibytes(2048)
}) }
})
});
Synopsis
Constructors
| EksVolume(IEksVolumeOptions) | A Volume that can be mounted to a container supported by EKS. |
Properties
| ContainerPath | The path on the container where the container is mounted. |
| Name | The name of this volume. |
| Readonly | If specified, the container has readonly access to the volume. |
Methods
| EmptyDir(IEmptyDirVolumeOptions) | Creates a Kubernetes EmptyDir volume. |
| HostPath(IHostPathVolumeOptions) | Creates a Kubernetes HostPath volume. |
| Secret(ISecretPathVolumeOptions) | Creates a Kubernetes Secret volume. |
Constructors
EksVolume(IEksVolumeOptions)
A Volume that can be mounted to a container supported by EKS.
protected EksVolume(IEksVolumeOptions options)
Parameters
- options IEksVolumeOptions
Remarks
ExampleMetadata: infused
Examples
var jobDefn = new EksJobDefinition(this, "eksf2", new EksJobDefinitionProps {
Container = new EksContainerDefinition(this, "container", new EksContainerDefinitionProps {
Image = ContainerImage.FromRegistry("amazon/amazon-ecs-sample"),
Volumes = new [] { EksVolume.EmptyDir(new EmptyDirVolumeOptions {
Name = "myEmptyDirVolume",
MountPath = "/mount/path",
Medium = EmptyDirMediumType.MEMORY,
Readonly = true,
SizeLimit = Size.Mebibytes(2048)
}) }
})
});
Properties
ContainerPath
The path on the container where the container is mounted.
public virtual string? ContainerPath { get; }
Property Value
Remarks
Default: - the container is not mounted
Name
The name of this volume.
public virtual string Name { get; }
Property Value
Remarks
The name must be a valid DNS subdomain name.
See: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
Readonly
If specified, the container has readonly access to the volume.
public virtual bool? Readonly { get; }
Property Value
bool?
Remarks
Otherwise, the container has read/write access.
Default: false
Methods
EmptyDir(IEmptyDirVolumeOptions)
Creates a Kubernetes EmptyDir volume.
public static EmptyDirVolume EmptyDir(IEmptyDirVolumeOptions options)
Parameters
- options IEmptyDirVolumeOptions
Returns
Remarks
HostPath(IHostPathVolumeOptions)
Creates a Kubernetes HostPath volume.
public static HostPathVolume HostPath(IHostPathVolumeOptions options)
Parameters
- options IHostPathVolumeOptions
Returns
Remarks
Secret(ISecretPathVolumeOptions)
Creates a Kubernetes Secret volume.
public static SecretPathVolume Secret(ISecretPathVolumeOptions options)
Parameters
- options ISecretPathVolumeOptions