interface HostPathVolumeOptions
Language | Type name |
---|---|
![]() | Amazon.CDK.AWS.Batch.HostPathVolumeOptions |
![]() | github.com/aws/aws-cdk-go/awscdk/v2/awsbatch#HostPathVolumeOptions |
![]() | software.amazon.awscdk.services.batch.HostPathVolumeOptions |
![]() | aws_cdk.aws_batch.HostPathVolumeOptions |
![]() | aws-cdk-lib » aws_batch » HostPathVolumeOptions |
Options for a kubernetes HostPath volume.
See also: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
Example
declare const jobDefn: batch.EksJobDefinition;
jobDefn.container.addVolume(batch.EksVolume.emptyDir({
name: 'emptyDir',
mountPath: '/Volumes/emptyDir',
}));
jobDefn.container.addVolume(batch.EksVolume.hostPath({
name: 'hostPath',
hostPath: '/sys',
mountPath: '/Volumes/hostPath',
}));
jobDefn.container.addVolume(batch.EksVolume.secret({
name: 'secret',
optional: true,
mountPath: '/Volumes/secret',
secretName: 'mySecret',
}));
Properties
Name | Type | Description |
---|---|---|
host | string | The path of the file or directory on the host to mount into containers on the pod. |
name | string | The name of this volume. |
mount | string | The path on the container where the volume is mounted. |
readonly? | boolean | If specified, the container has readonly access to the volume. |
hostPath
Type:
string
The path of the file or directory on the host to mount into containers on the pod.
Note: HothPath Volumes present many security risks, and should be avoided when possible.
See also: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath
name
Type:
string
The name of this volume.
The name must be a valid DNS subdomain name.
See also: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/#dns-subdomain-names
mountPath?
Type:
string
(optional, default: the volume is not mounted)
The path on the container where the volume is mounted.
readonly?
Type:
boolean
(optional, default: false)
If specified, the container has readonly access to the volume.
Otherwise, the container has read/write access.