VolumeConfig¶
- pydantic model controller.config.VolumeConfig¶
A volume that may be mounted inside a container.
- Parameters:
data (
Any
)
Show JSON schema
{ "title": "VolumeConfig", "description": "A volume that may be mounted inside a container.", "type": "object", "properties": { "name": { "description": "Used as the Kubernetes volume name and therefore must be a valid Kubernetes name", "pattern": "^[a-z0-9]([-a-z0-9]*[a-z0-9])?$", "title": "Name of volume", "type": "string" }, "source": { "anyOf": [ { "$ref": "#/$defs/HostPathVolumeSource" }, { "$ref": "#/$defs/NFSVolumeSource" }, { "$ref": "#/$defs/PVCVolumeSource" }, { "$ref": "#/$defs/NFSPVCVolumeSource" } ], "title": "Source of volume" } }, "$defs": { "HostPathVolumeSource": { "additionalProperties": false, "description": "Path on Kubernetes node to mount in the container.", "properties": { "type": { "const": "hostPath", "title": "Type", "type": "string" }, "path": { "description": "Absolute host path to mount in the container", "examples": [ "/home" ], "pattern": "^/.*", "title": "Host path", "type": "string" } }, "required": [ "type", "path" ], "title": "HostPathVolumeSource", "type": "object" }, "NFSPVCVolumeSource": { "additionalProperties": false, "description": "NFS+PVC volume to mount in the container.\n\nThis is the only within-kubernetes way to specify mount options for an\nNFS mount (if you have access to the host, /etc/nfsmount.conf\nworks as well). The default mount_options are opinionated and reflect\nreasonable NFSv4 defaults in the GKE environment.\n\nPVs and PVCs exist in a one-to-one mapping; hence mounting this volume\nrequires a PV per PVC, even though many clients can use a single NFS\nserver. Note also that PVs are cluster-scoped, not namespace-scoped,\nwhich complicates resource naming.\n\nThe presence of this type will trigger the creation of the PV in the pod\nresources.", "properties": { "type": { "const": "nfsPvc", "title": "Type", "type": "string" }, "server": { "description": "Name or IP address of the NFS server for the volume", "examples": [ "10.13.105.122" ], "title": "NFS server", "type": "string" }, "serverPath": { "description": "Absolute path of NFS server export of the volume", "examples": [ "/share1/home" ], "pattern": "^/.*", "title": "Export path", "type": "string" }, "readOnly": { "default": false, "description": "Whether to mount the NFS volume read-only. If this is true, any mount of this volume will be read-only even if the mount is not marked as such.", "title": "Is read-only", "type": "boolean" }, "mountOptions": { "default": [ "rw", "relatime", "vers=4.1", "rsize=1048576", "wsize=1048576", "namlen=255", "hard", "proto=tcp", "timeo=600", "retrans=2", "sec=sys", "mountproto=tcp", "local_lock=none" ], "description": "Mount options for NFS. Note that if you really wanted to, you could use this to turn it back into an NFSv3 server.", "items": { "type": "string" }, "title": "NFS Mount Options", "type": "array" }, "accessModes": { "items": { "$ref": "#/$defs/VolumeAccessMode" }, "title": "Access mode", "type": "array" }, "storageClassName": { "title": "Storage class", "type": "string" }, "resources": { "$ref": "#/$defs/PVCVolumeResources", "title": "Resources for volume" } }, "required": [ "type", "server", "serverPath", "accessModes", "storageClassName", "resources" ], "title": "NFSPVCVolumeSource", "type": "object" }, "NFSVolumeSource": { "additionalProperties": false, "description": "NFS volume to mount in the container.", "properties": { "type": { "const": "nfs", "title": "Type", "type": "string" }, "server": { "description": "Name or IP address of the NFS server for the volume", "examples": [ "10.13.105.122" ], "title": "NFS server", "type": "string" }, "serverPath": { "description": "Absolute path of NFS server export of the volume", "examples": [ "/share1/home" ], "pattern": "^/.*", "title": "Export path", "type": "string" }, "readOnly": { "default": false, "description": "Whether to mount the NFS volume read-only. If this is true, any mount of this volume will be read-only even if the mount is not marked as such.", "title": "Is read-only", "type": "boolean" } }, "required": [ "type", "server", "serverPath" ], "title": "NFSVolumeSource", "type": "object" }, "PVCVolumeResources": { "additionalProperties": false, "description": "Resources for a persistent volume claim.", "properties": { "requests": { "additionalProperties": { "type": "string" }, "title": "Resource requests", "type": "object" } }, "required": [ "requests" ], "title": "PVCVolumeResources", "type": "object" }, "PVCVolumeSource": { "additionalProperties": false, "description": "A PVC to create to materialize the volume to mount in the container.", "properties": { "type": { "const": "persistentVolumeClaim", "title": "Type", "type": "string" }, "accessModes": { "items": { "$ref": "#/$defs/VolumeAccessMode" }, "title": "Access mode", "type": "array" }, "storageClassName": { "title": "Storage class", "type": "string" }, "resources": { "$ref": "#/$defs/PVCVolumeResources", "title": "Resources for volume" }, "readOnly": { "default": false, "description": "Whether to force all mounts of this volume to read-only", "title": "Is read-only", "type": "boolean" } }, "required": [ "type", "accessModes", "storageClassName", "resources" ], "title": "PVCVolumeSource", "type": "object" }, "VolumeAccessMode": { "description": "Access mode for a persistent volume.\n\nThe access modes ``ReadWriteOnce`` and ``ReadWriteOncePod`` are valid\naccess modes in Kubernetes but are intentionally not listed here because\nthey cannot work with user labs or file servers and therefore should be\nrejected by configuration parsing. This should change in the future if\naccess modes are used in other contexts where those access modes may make\nsense.", "enum": [ "ReadOnlyMany", "ReadWriteMany" ], "title": "VolumeAccessMode", "type": "string" } }, "additionalProperties": false, "required": [ "name", "source" ] }
- Fields:
- field name: Annotated[str, Field(title='Name of volume', description='Used as the Kubernetes volume name and therefore must be a valid Kubernetes name', pattern=KUBERNETES_NAME_PATTERN)] [Required]¶
Used as the Kubernetes volume name and therefore must be a valid Kubernetes name
- Constraints:
pattern = ^[a-z0-9]([-a-z0-9]*[a-z0-9])?$
- field source: Annotated[HostPathVolumeSource | NFSVolumeSource | PVCVolumeSource | NFSPVCVolumeSource, Field(title='Source of volume')] [Required]¶