Setup profile_list
¶
After login, each user will be provided with a list of profile
s to choose from.
Each profile can point to a different kubernetes cluster, as well as other
customizations such as image to use, amount of RAM / CPU, GPU use, etc.
Each item in the list is a python dictionary, with the following keys recognized:
display_name
: Name to display to the user in the profile selection screendescription
: Description to display to the user in the profile selection screenspawner_override
: Dictionary of spawner options for this profile, determining where the user pod is spawned and other properties of it.
The following properties are supported under spawner_override
.
kubernetes_context
: Name of the kubernetes context to use when connecting to this cluster. You can usekubectl config get-contexts
to get a list of contexts available in yourKUBECONFIG
file.ingress_public_url
: URL to the public endpoint of the Ingress controller you setup earlier. This should be formatted as a URL, so don’t forget thehttp://
. For production systems, you should also setup HTTPS for your ingress controller, and provide thehttps://<domain-name>
here.patches
: A list of patches (as passed tokubectl patch
). Described in more detail below. This is the primary method of customizing the user pod, although some convenience methods are also offered (detailed below).environment
: A dictionary of extra environment variables to set for the user pod.image
: The image to use for the user pod. Defaults topangeo/pangeo-notebook:latest
.mem_limit
andmem_guarantee
, as understood by JupyterHubcpu_limit
andcpu_guarantee
, as understood by JupyterHub
Here is a simple example:
c.MultiClusterKubeSpawner.profile_list = [
{
"display_name": "Google Cloud in us-central1",
"description": "Compute paid for by funder A, closest to dataset X",
"spawner_override": {
"kubernetes_context": "<kubernetes-context-name-for-this-cluster">,
"ingress_public_url": "http://<ingress-public-ip-for-this-cluster>"
}
},
{
"display_name": "AWS on us-east-1",
"description": "Compute paid for by funder B, closest to dataset Y",
"spawner_override": {
"kubernetes_context": "<kubernetes-context-name-for-this-cluster">,
"ingress_public_url": "http://<ingress-public-ip-for-this-cluster>",
"patches": {
"01-memory": """
kind: Pod
metadata:
name: {{key}}
spec:
containers:
- name: notebook
resources:
requests:
memory: 16Mi
""",
}
}
},
]