Class HostPathVolumeOptions
Options for a kubernetes HostPath volume.
Inheritance
Namespace: Amazon.CDK.AWS.Batch
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class HostPathVolumeOptions : Object, IHostPathVolumeOptions, IEksVolumeOptions
Syntax (vb)
Public Class HostPathVolumeOptions
Inherits Object
Implements IHostPathVolumeOptions, IEksVolumeOptions
Remarks
See: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
ExampleMetadata: infused
Examples
EksJobDefinition jobDefn;
jobDefn.Container.AddVolume(EksVolume.EmptyDir(new EmptyDirVolumeOptions {
Name = "emptyDir",
MountPath = "/Volumes/emptyDir"
}));
jobDefn.Container.AddVolume(EksVolume.HostPath(new HostPathVolumeOptions {
Name = "hostPath",
HostPath = "/sys",
MountPath = "/Volumes/hostPath"
}));
jobDefn.Container.AddVolume(EksVolume.Secret(new SecretPathVolumeOptions {
Name = "secret",
Optional = true,
MountPath = "/Volumes/secret",
SecretName = "mySecret"
}));
Synopsis
Constructors
HostPathVolumeOptions() |
Properties
HostPath | The path of the file or directory on the host to mount into containers on the pod. |
MountPath | The path on the container where the volume is mounted. |
Name | The name of this volume. |
Readonly | If specified, the container has readonly access to the volume. |
Constructors
HostPathVolumeOptions()
public HostPathVolumeOptions()
Properties
HostPath
The path of the file or directory on the host to mount into containers on the pod.
public string HostPath { get; set; }
Property Value
System.String
Remarks
Note: HothPath Volumes present many security risks, and should be avoided when possible.
See: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
MountPath
The path on the container where the volume is mounted.
public string MountPath { get; set; }
Property Value
System.String
Remarks
Default: - the volume is not mounted
Name
The name of this volume.
public string Name { get; set; }
Property Value
System.String
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 Nullable<bool> Readonly { get; set; }
Property Value
System.Nullable<System.Boolean>
Remarks
Otherwise, the container has read/write access.
Default: false