gpu-jupyter/.staroid/k8s.yaml

69 lines
1.8 KiB
YAML
Raw Permalink Normal View History

2020-08-03 22:36:59 +00:00
apiVersion: apps/v1
kind: Deployment
metadata:
name: jupyter-deployment
spec:
replicas: 1
strategy:
type: "Recreate"
selector:
matchLabels:
app: jupyter
template:
metadata:
labels:
app: jupyter
2020-08-05 19:16:54 +00:00
pod.staroid.com/isolation: dedicated # see https://docs.staroid.com/ske/pod.html#pod for more available options
2020-08-03 22:36:59 +00:00
pod.staroid.com/spot: "false"
pod.staroid.com/instance-type: gpu-1
2020-08-03 22:36:59 +00:00
spec:
automountServiceAccountToken: true
securityContext:
2020-08-05 19:16:54 +00:00
runAsUser: 1000 # staroid requires non-root container
2020-08-03 22:36:59 +00:00
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:
2020-08-05 19:16:54 +00:00
storage.staroid.com/scope: Instance # see https://docs.staroid.com/ske/storage.html for available scope
storage.staroid.com/file-manager: "1000:100" # <uid:gid> of file manager pod. This will display file manager button on staroid management console
2020-08-03 22:36:59 +00:00
spec:
storageClassName: nfs
accessModes:
- ReadWriteMany
volumeMode: Filesystem
resources:
requests:
storage: 1Gi