notebooks/components/notebook-controller
Ben Ye d14f6ac07f support metrics in notebook-controller (kubeflow/kubeflow#4123)
Signed-off-by: yeya24 <yb532204897@gmail.com>
2019-10-16 00:15:40 -07:00
..
api Notebook v1beta1 (kubeflow/kubeflow#4105) 2019-09-13 07:04:29 -07:00
ci Ci for components (kubeflow/kubeflow#4238) 2019-10-15 08:31:53 -07:00
config Migrate kustomize.go to Kustomize3 (kubeflow/kubeflow#4055) 2019-09-20 21:21:25 -07:00
controllers support metrics in notebook-controller (kubeflow/kubeflow#4123) 2019-10-16 00:15:40 -07:00
hack Migrate notebook CR to kubebuilder V2 (kubeflow/kubeflow#4013) 2019-09-04 17:06:22 -07:00
pkg support metrics in notebook-controller (kubeflow/kubeflow#4123) 2019-10-16 00:15:40 -07:00
.gitignore Culling of Idle Jupyter Notebooks (kubeflow/kubeflow#3856) 2019-08-26 04:40:21 -07:00
Dockerfile Migrate notebook CR to kubebuilder V2 (kubeflow/kubeflow#4013) 2019-09-04 17:06:22 -07:00
Makefile Notebook v1beta1 (kubeflow/kubeflow#4105) 2019-09-13 07:04:29 -07:00
PROJECT Notebook v1beta1 (kubeflow/kubeflow#4105) 2019-09-13 07:04:29 -07:00
README.md Migrate notebook CR to kubebuilder V2 (kubeflow/kubeflow#4013) 2019-09-04 17:06:22 -07:00
gcb_build.jsonnet Migrate notebook CR to kubebuilder V2 (kubeflow/kubeflow#4013) 2019-09-04 17:06:22 -07:00
go.mod support metrics in notebook-controller (kubeflow/kubeflow#4123) 2019-10-16 00:15:40 -07:00
go.sum support metrics in notebook-controller (kubeflow/kubeflow#4123) 2019-10-16 00:15:40 -07:00
main.go support metrics in notebook-controller (kubeflow/kubeflow#4123) 2019-10-16 00:15:40 -07:00

README.md

Notebook Controller

The controller allows users to create a custom resource "Notebook" (jupyter notebook). We originally wrote the controller using jsonnet and metacontroller, but are migrating to golang and Kubebuilder here. See discussion.

Spec

The user needs to specify the PodSpec for the jupyter notebook. For example:

apiVersion: kubeflow.org/v1alpha1
kind: Notebook
metadata:
  name: my-notebook
  namespace: test
spec:
  template:
    spec:  # Your PodSpec here
      containers:
      - image: gcr.io/kubeflow-images-public/tensorflow-1.10.1-notebook-cpu:v0.3.0
        args: ["start.sh", "lab", "--LabApp.token=''", "--LabApp.allow_remote_access='True'",
               "--LabApp.allow_root='True'", "--LabApp.ip='*'",
               "--LabApp.base_url=/test/my-notebook/",
               "--port=8888", "--no-browser"]
        name: notebook
      ...

The required fields are containers[0].image and (containers[0].command and/or containers[0].args). That is, the user should specify what and how to run.

All other fields will be filled in with default value if not specified.

Implementation detail

This part is WIP as we are still developing.

Under the hood, the controller creates a StatefulSet to run the notebook instance, and a Service for it.

TODO

  • e2e test (we have one testing the jsonnet-metacontroller one, we should make it run on this one)
  • status field should reflect the error if there is any. See #2269.
  • Istio integration (controller will generate istio resources to secure each user's notebook)
  • CRD validation
  • ttlSecondsAfterFinished: This is in the original jsonnet controller spec, but not being used yet. I think we want to cleanup the notebook after idle?