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" } ], "title": "Source of volume" } }, "$defs": { "HostPathVolumeSource": { "additionalProperties": false, "description": "Path on Kubernetes node to mount in the container.", "properties": { "type": { "const": "hostPath", "enum": [ "hostPath" ], "title": "Type of volume to mount", "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" }, "NFSVolumeSource": { "additionalProperties": false, "description": "NFS volume to mount in the container.", "properties": { "type": { "const": "nfs", "enum": [ "nfs" ], "title": "Type of volume to mount", "type": "string" }, "server": { "description": "Name or IP address of the server providing 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", "enum": [ "persistentVolumeClaim" ], "title": "Type of volume to mount", "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": "If set to true, forces 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: str [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: HostPathVolumeSource | NFSVolumeSource | PVCVolumeSource [Required]¶