NFSPVCVolumeSource

pydantic model controller.config.NFSPVCVolumeSource

NFS+PVC volume to mount in the container.

This is the only within-kubernetes way to specify mount options for an NFS mount (if you have access to the host, /etc/nfsmount.conf works as well). The default mount_options are opinionated and reflect reasonable NFSv4 defaults in the GKE environment.

PVs and PVCs exist in a one-to-one mapping; hence mounting this volume requires a PV per PVC, even though many clients can use a single NFS server. Note also that PVs are cluster-scoped, not namespace-scoped, which complicates resource naming.

The presence of this type will trigger the creation of the PV in the pod resources.

Parameters:

data (Any)

Show JSON schema
{
   "title": "NFSPVCVolumeSource",
   "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.",
   "type": "object",
   "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"
      }
   },
   "$defs": {
      "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"
      },
      "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": [
      "type",
      "server",
      "serverPath",
      "accessModes",
      "storageClassName",
      "resources"
   ]
}

Fields:
field accessModes: Annotated[list[VolumeAccessMode], Field(title='Access mode')] [Required] (name 'access_modes')
field mountOptions: Annotated[list[str], Field(title='NFS Mount Options', description='Mount options for NFS.  Note that if you really wanted to, you could use this to turn it back into an NFSv3 server.')] = ['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'] (name 'mount_options')

Mount options for NFS. Note that if you really wanted to, you could use this to turn it back into an NFSv3 server.

field readOnly: Annotated[bool, Field(title='Is read-only', 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.')] = False (name 'read_only')

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.

field resources: Annotated[PVCVolumeResources, Field(title='Resources for volume')] [Required]
field server: Annotated[str, Field(title='NFS server', description='Name or IP address of the NFS server for the volume', examples=['10.13.105.122'])] [Required]

Name or IP address of the NFS server for the volume

field serverPath: Annotated[str, Field(title='Export path', description='Absolute path of NFS server export of the volume', examples=['/share1/home'], pattern='^/.*')] [Required] (name 'server_path')

Absolute path of NFS server export of the volume

Constraints:
  • pattern = ^/.*

field storageClassName: Annotated[str, Field(title='Storage class')] [Required] (name 'storage_class_name')
field type: Literal['nfsPvc'] [Required]
to_kubernetes_spec()

Convert to the Kubernetes representation.

Returns:

Corresponding persistent volume claim spec.

Return type:

kubernetes_asyncio.client.models.V1PersistentVolumeClaimSpec

to_kubernetes_volume_spec()

Convert to the Kubernetes representation for the matching Volume.

Returns:

Corresponding persistent volume spec.

Return type:

kubernetes_asyncio.client.models.V1PersistentVolumeSpec