JupyterHub User Home Data on NFS mount

Hi Team,

Unable to fulfil the requirement of storage getting error:
“[Warning] pod has unbound immediate PersistentVolumeClaims”

ENV Details:
Bare Metal Cluster
Ubuntu OS
Juypterhub deployed “https://zero-to-jupyterhub.readthedocs.io/en/latest/

Description
root@server11:~/locuz# kubectl get pods -n jhub
NAME READY STATUS RESTARTS AGE
hub-7fc98799f4-4cz45 1/1 Running 0 9m20s
jupyter-user1 0/1 Pending 0 60m
jupyter-user3 0/1 Pending 0 55m
proxy-d7c9758bc-x9wjs 1/1 Running 0 9m30s
root@server11:~/locuz#

root@server11:~/locuz# kubectl --namespace=jhub describe pod jupyter-user2
Name: jupyter-user2
Namespace: jhub
Priority: 0
Node:
Labels: app=jupyterhub
chart=jupyterhub-0.8.2
component=singleuser-server
heritage=jupyterhub
hub.jupyter.org/network-access-hub=true
release=jhub
Annotations: hub.jupyter.org/username: user2
Status: Pending
IP:
Init Containers:
block-cloud-metadata:
Image: jupyterhub/k8s-network-tools:0.8.2
Port:
Host Port:
Command:
iptables
-A
OUTPUT
-d
169.254.169.254
-j
DROP
Environment:
Mounts:
Containers:
notebook:
Image: jupyter/base-notebook:latest
Port: 8888/TCP
Host Port: 0/TCP
Args:
start-singleuser.sh
–ip=“0.0.0.0”
–port=8888
–NotebookApp.default_url="/lab"
–debug
Requests:
memory: 1073741824
Environment:
CHOWN_HOME: yes
JUPYTERHUB_API_TOKEN: a9abb8c56b9c4e5eb581cf2708bd58ef
JPY_API_TOKEN: a9abb8c56b9c4e5eb581cf2708bd58ef
JUPYTERHUB_ADMIN_ACCESS: 1
JUPYTERHUB_CLIENT_ID: jupyterhub-user-user2
JUPYTERHUB_HOST:
JUPYTERHUB_OAUTH_CALLBACK_URL: /user/user2/oauth_callback
JUPYTERHUB_USER: user2
JUPYTERHUB_API_URL: http://10.98.141.80:8081/hub/api
JUPYTERHUB_BASE_URL: /
JUPYTERHUB_SERVICE_PREFIX: /user/user2/
MEM_GUARANTEE: 1073741824
JUPYTER_IMAGE_SPEC: jupyter/base-notebook:latest
JUPYTER_IMAGE: jupyter/base-notebook:latest
Mounts:
/home/jovyan from home (rw,path=“home/user2”)
Conditions:
Type Status
PodScheduled False
Volumes:
home:
Type: PersistentVolumeClaim (a reference to a PersistentVolumeClaim in the same namespace)
ClaimName: nfs-home-pvc
ReadOnly: false
QoS Class: Burstable
Node-Selectors:
Tolerations: hub.jupyter.org/dedicated=user:NoSchedule
hub.jupyter.org_dedicated=user:NoSchedule
node.kubernetes.io/not-ready:NoExecute for 300s
node.kubernetes.io/unreachable:NoExecute for 300s
Events:
Type Reason Age From Message


Warning FailedScheduling 14s default-scheduler pod has unbound immediate PersistentVolumeClaims (repeated 2 times)
root@server11:~/locuz#
root@server11:~/locuz# kubectl get sc
No resources found.
root@server11:~/locuz# kubectl get pvc,pv
NAME STATUS VOLUME CAPACITY ACCESS MODES STORAGECLASS AGE
persistentvolumeclaim/nfs-home-pvc Bound nfs-home-pv 50Gi RWX 158m

NAME CAPACITY ACCESS MODES RECLAIM POLICY STATUS CLAIM STORAGECLASS REASON AGE
persistentvolume/nfs-home-pv 50Gi RWX Retain Bound default/nfs-home-pvc 158m
root@server11:~/locuz#
root@server11:~/locuz# kubectl describe pvc,pv
Name: nfs-home-pvc
Namespace: default
StorageClass:
Status: Bound
Volume: nfs-home-pv
Labels: app=mission-control
type=nfs-volume
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{“apiVersion”:“v1”,“kind”:“PersistentVolumeClaim”,“metadata”:{“annotations”:{},“labels”:{“app”:“mission-control”,“type”:“nfs-volume”},"nam…
pv.kubernetes.io/bind-completed: yes
pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pvc-protection]
Capacity: 50Gi
Access Modes: RWX
VolumeMode: Filesystem
Mounted By:
Events:

Name: nfs-home-pv
Labels: app=mission-control
id=jfmc-es-pv
type=nfs-volume
Annotations: kubectl.kubernetes.io/last-applied-configuration:
{“apiVersion”:“v1”,“kind”:“PersistentVolume”,“metadata”:{“annotations”:{},“labels”:{“app”:“mission-control”,“id”:“jfmc-es-pv”,“type”:"nfs-…
pv.kubernetes.io/bound-by-controller: yes
Finalizers: [kubernetes.io/pv-protection]
StorageClass:
Status: Bound
Claim: default/nfs-home-pvc
Reclaim Policy: Retain
Access Modes: RWX
VolumeMode: Filesystem
Capacity: 50Gi
Node Affinity:
Message:
Source:
Type: NFS (an NFS mount that lasts the lifetime of a pod)
Server: 192.168.126.151
Path: /home/
ReadOnly: false
Events:
root@server11:~/locuz#
root@server11:~/locuz# cat config.yaml
proxy:
secretToken: 97141abb55ea5321867979cb57bb2e6a86a2f4d6bb166fca45aedb07c212c42d
service:
type: NodePort
nodePorts:
http: 30080
https: 30443
networkPolicy:
enabled: true

hub:
cookieSecret: 1470700e01f77171c2c67b12130c25081dfbdf2697af8c2f2bd05621b31100bf
db:
type: sqlite-memory

debug:
enabled: true

singleuser:
defaultUrl: “/lab”
image:
name: jupyter/base-notebook
tag: latest
storage:
type: “static”
static:
pvcName: “nfs-home-pvc”
subPath: ‘home/{username}’
extraEnv:
CHOWN_HOME: ‘yes’
uid: 0
fsGid: 0
cmd: “start-singleuser.sh”

Thank You
Atul Yadav

Create the nfs pv for fulfilling the requirement.

PV

kind: PersistentVolume
metadata:
  name: nfs-home-pv
  labels:
    app: mission-control
    id: jfmc-es-pv
    type: nfs-volume
spec:
  capacity:
    storage: 50Gi
  accessModes:
  - ReadWriteMany
  persistentVolumeReclaimPolicy: Retain
  nfs:
    ####################################
    # MUST SET ACTUAL NFS SERVER IP HERE
    server: 192.168.126.151
    ####################################
    path: "/home"
    readOnly: false
---

### PVC
kind: PersistentVolumeClaim
apiVersion: v1
metadata:
  name: nfs-home-pvc
  labels:
    app: mission-control
    type: nfs-volume
spec:
  accessModes:
  - ReadWriteMany
  storageClassName: ""
  resources:
    requests:
      storage: 50Gi
  selector:
    matchLabels:
      app: mission-control
      id: jfmc-es-pv


Thank You
Atul Yadav