gpu-jupyter/.staroid/k8s.yaml
2020-08-03 16:38:32 -07:00

69 lines
1.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: jupyter-deployment
spec:
replicas: 1
strategy:
type: "Recreate"
selector:
matchLabels:
app: jupyter
template:
metadata:
labels:
app: jupyter
pod.staroid.com/isolation: dedicated
pod.staroid.com/spot: "false"
pod.staroid.com/instance-type: gpu-1
spec:
automountServiceAccountToken: true
securityContext:
runAsUser: 1000 # will be overrided by staroid
runAsGroup: 100 # writable directories are accessible with GID 100. see https://github.com/jupyter/docker-stacks/blob/master/base-notebook/Dockerfile
containers:
- name: jupyter
image: jupyter
command:
- "bash"
- "-c"
- >-
jupyter-lab --ip='*' --NotebookApp.token='' --NotebookApp.password='' --NotebookApp.allow_origin='*'
env:
- name: JUPYTER_ENABLE_LAB
value: "yes"
volumeMounts:
- name: work-volume
mountPath: /home/jovyan/work
volumes:
- name: work-volume
persistentVolumeClaim:
claimName: work
---
kind: Service
apiVersion: v1
metadata:
name: jupyter
spec:
ports:
- name: http
port: 8888
selector:
app: jupyter
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: work
annotations:
storage.staroid.com/scope: Instance
storage.staroid.com/file-manager: "1000:100"
spec:
storageClassName: nfs
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 1Gi