Skip to main content

volume

Source: base/pkg/kusion_models/kube/frontend/volume/volume.k

Schema Volume

Volume represents a named volume and corresponding mounts in containers.

Attributes

Name and DescriptionTypeDefault ValueRequired
name
Volume's name. Must be a DNS_LABEL and unique within the pod.
More info: https://kubernetes.io/docs/concepts/overview/working-with-objects/names/\#names
strUndefinedrequired
volumeSource
VolumeSource represents the location and type of the mounted volume.
volume.EmptyDir | volume.Secret | volume.ConfigMap | volume.FlexVolume | volume.HostPath | volume.DownwardAPI | volume.CSIUndefinedrequired
mounts
Volumes to mount into the container's filesystem.
[volume.Mount]Undefinedoptional

Examples

volume = v.Volume {
name = "kubeconfig"
volumeSource = v.Secret {
secretName = "kubeconfig"
defaultMode = 420
}
mounts = [
v.Mount {
path = "/etc/kubernetes/kubeconfig"
readOnly = true
}
]
}

Schema Mount

Mount represents a mounting of a Volume within a container.

Attributes

Name and DescriptionTypeDefault ValueRequired
container
A Pod-level attribute.
Name of container to mount, * represents all containers.
str*required
path
A Container-level attribute.
Path within the container at which the volume should be mounted.
strUndefinedrequired
subPath
A Container-level attribute.
Path within the volume from which the container's volume should be mounted.
strUndefinedoptional
readOnly
A Container-level attribute.
Mounted read-only if true, read-write otherwise.
boolFalseoptional

Schema EmptyDir

EmptyDir represents a temporary directory that shares a pod's lifetime.

Attributes

Name and DescriptionTypeDefault ValueRequired
medium
A Pod-level attribute.
What type of storage medium should back this directory.
"" | "Memory"""required
sizeLimit
A Pod-level attribute.
Total amount of local storage required for this EmptyDir volume.
strUndefinedoptional

Schema Secret

Secret represents a secret that should populate this volume.

Attributes

Name and DescriptionTypeDefault ValueRequired
secretName
A Pod-level attribute.
Name of the secret in the pod's namespace to use.
strUndefinedrequired
items
A Pod-level attribute.
Key-value pairs projected into the volume.
[{str: str}]Undefinedoptional
defaultMode
A Pod-level attribute.
Mode bits used to set permissions on created files by default.
intUndefinedoptional

Schema ConfigMap

ConfigMap represents a secret that should populate this volume.

Attributes

Name and DescriptionTypeDefault ValueRequired
name
A Pod-level attribute.
Name of the configMap in the pod's namespace to use.
strUndefinedrequired
items
A Pod-level attribute.
Key-value pairs projected into the volume.
[{str: str}]Undefinedoptional
defaultMode
A Pod-level attribute.
Mode bits used to set permissions on created files by default.
intUndefinedoptional

Schema FlexVolume

FlexVolume represents a secret that should populate this volume.

Attributes

Name and DescriptionTypeDefault ValueRequired
driver
A Pod-level attribute.
Driver is the name of the driver to use for this volume.
strUndefinedrequired
fsType
A Pod-level attribute.
Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs".
The default filesystem depends on FlexVolume script.
strUndefinedoptional
options
A Pod-level attribute.
Extra command options if any.
{str: str}Undefinedoptional
readOnly
A Pod-level attribute.
Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.
boolFalseoptional

Schema HostPath

HostPath represents a secret that should populate this volume.

Attributes

Name and DescriptionTypeDefault ValueRequired
path
A Pod-level attribute.
Path of the directory on the host. If the path is a symlink, it will follow the link to the real path.
More info: https://kubernetes.io/docs/concepts/storage/volumes\#hostpath
strUndefinedrequired
type
A Pod-level attribute.
Type for HostPath Volume Defaults to ""
More info: https://kubernetes.io/docs/concepts/storage/volumes\#hostpath
strUndefinedoptional

Schema DownwardAPI

DownwardAPI represents a secret that should populate this volume.

Attributes

Name and DescriptionTypeDefault ValueRequired
defaultMode
A Pod-level attribute.
Mode bits used to set permissions on created files by default.
intUndefinedoptional
items
A Pod-level attribute.
Items is a list of downward API volume file
[{str: any}]Undefinedoptional

Schema CSI

CSI (Container Storage Interface) represents ephemeral storage that is handled by certain external CSI drivers (Beta feature).

Attributes

Name and DescriptionTypeDefault ValueRequired
driver
A Pod-level attribute.
Driver is the name of the driver to use for this volume.
strUndefinedoptional
fsType
A Pod-level attribute.
Filesystem type to mount. Must be a filesystem type supported by the host operating system. Ex. "ext4", "xfs", "ntfs".
The default filesystem depends on FlexVolume script.
strUndefinedoptional
readOnly
A Pod-level attribute.
Optional: Defaults to false (read/write). ReadOnly here will force the ReadOnly setting in VolumeMounts.
boolFalseoptional
volumeAttributes
A Pod-level attribute.
Extra command options if any.
{str: str}Undefinedoptional