kubespawner/objects.py
def make_pvc(
    name,
    storage_class,
    access_modes,
    storage,
    labels,
    annotations={}
    ):
    """
    Make a k8s pvc specification for running a user notebook.

    Parameters
    ----------
    name:
        Name of persistent volume claim. Must be unique within the namespace the object is
        going to be created in. Must be a valid DNS label.
    storage_class:
        String of the name of the k8s Storage Class to use.
    access_modes:
        A list of specifying what access mode the pod should have towards the pvc
    storage:
        The ammount of storage needed for the pvc

    """
    pvc = V1PersistentVolumeClaim()
    pvc.kind = "PersistentVolumeClaim"
    pvc.api_version = "v1"
    pvc.metadata = V1ObjectMeta()
    pvc.metadata.name = name
    pvc.metadata.annotations = annotations
    pvc.metadata.labels = {}
    pvc.metadata.labels.update(labels)
    pvc.spec = V1PersistentVolumeClaimSpec()
    pvc.spec.access_modes = access_modes
    pvc.spec.resources = V1ResourceRequirements()
    pvc.spec.resources.requests = {"storage": storage}

    if storage_class:
        pvc.metadata.annotations.update({"volume.beta.kubernetes.io/storage-class": storage_class})
        pvc.spec.storage_class_name = storage_class

    return pvc

    Make a k8s pvc specification for running a user notebook.

    Parameters
    ----------
    name:
        Name of persistent volume claim. Must be unique within the namespace the object is
        going to be created in. Must be a valid DNS label.
    storage_class:
        String of the name of the k8s Storage Class to use.
    access_modes:
        A list of specifying what access mode the pod should have towards the pvc
    storage:
        The ammount of storage needed for the pvc

    
Make a k8s pvc specification for running a user notebook.
Parameters

Name of persistent volume claim. Must be unique within the namespace the object is
going to be created in. Must be a valid DNS label.
storage_class:
String of the name of the k8s Storage Class to use.
access_modes:
A list of specifying what access mode the pod should have towards the pvc
storage:
The ammount of storage needed for the pvc
Make a k8s pvc specification for running a user notebook . Parameters Name of persistent volume claim . Must be unique within the namespace the object is going to be created in . Must be a valid DNS label . storage_class : String of the name of the k8s Storage Class to use . access_modes : A list of specifying what access mode the pod should have towards the pvc storage : The ammount of storage needed for the pvc
def make_pvc(
    name,
    storage_class,
    access_modes,
    storage,
    labels,
    annotations={}
    ):
    pvc = V1PersistentVolumeClaim()
    pvc.kind = "PersistentVolumeClaim"
    pvc.api_version = "v1"
    pvc.metadata = V1ObjectMeta()
    pvc.metadata.name = name
    pvc.metadata.annotations = annotations
    pvc.metadata.labels = {}
    pvc.metadata.labels.update(labels)
    pvc.spec = V1PersistentVolumeClaimSpec()
    pvc.spec.access_modes = access_modes
    pvc.spec.resources = V1ResourceRequirements()
    pvc.spec.resources.requests = {"storage": storage}
    if storage_class:
        pvc.metadata.annotations.update({"volume.beta.kubernetes.io/storage-class": storage_class})
        pvc.spec.storage_class_name = storage_class
    return pvc
def make_pvc ( name , storage_class , access_modes , storage , labels , annotations = { } ) : pvc = V1PersistentVolumeClaim ( ) pvc . kind = "PersistentVolumeClaim" pvc . api_version = "v1" pvc . metadata = V1ObjectMeta ( ) pvc . metadata . name = name pvc . metadata . annotations = annotations pvc . metadata . labels = { } pvc . metadata . labels . update ( labels ) pvc . spec = V1PersistentVolumeClaimSpec ( ) pvc . spec . access_modes = access_modes pvc . spec . resources = V1ResourceRequirements ( ) pvc . spec . resources . requests = { "storage" : storage } if storage_class : pvc . metadata . annotations . update ( { "volume.beta.kubernetes.io/storage-class" : storage_class } ) pvc . spec . storage_class_name = storage_class return pvc
Make a k8s pvc specification for running a user notebook.
Make a k8s pvc specification for running a user notebook .
"""
    Make a k8s pvc specification for running a user notebook.

    Parameters
    ----------
    name:
        Name of persistent volume claim. Must be unique within the namespace the object is
        going to be created in. Must be a valid DNS label.
    storage_class:
        String of the name of the k8s Storage Class to use.
    access_modes:
        A list of specifying what access mode the pod should have towards the pvc
    storage:
        The ammount of storage needed for the pvc

    """
name
storage_class
access_modes
storage
labels
annotations