Commit Graph

9 Commits

Author SHA1 Message Date
apoger d2c76a0739 Implement a culling controller for Notebooks (kubeflow/kubeflow#6807)
* Implement a culling controller for notebooks

Changes:

 * Move the idleness/culling logic into a separate controller
   as part of the Notebooks Controller/Operator.

 * Introduce an "notebooks.kubeflow.org/last_activity_check_timestamp".
   annotation in each Notebook CR to keep the timestamp of the last
   performed idleness check

The controller can then compare this timestamp with the current time to
ensure that notebooks will get reconciled every IDLENESS_CHECK_PERIOD
minutes.

The culling-controller will:

* reconcile only notebooks CRs
* set/update culling annotations
  - 'notebooks.kubeflow.org/last_activity'
  - 'notebooks.kubeflow.org/last_activity_check_timestamp'
* perform idleness checks every 'IDLENESS_CHECK_PERIOD' minutes
  and set the 'kubeflow-resource-stopped' annotation, if a notebook
  needs to be culled.

Refs: kubeflow/kubeflow#6767

Signed-off-by: Apostolos Gerakaris <apoger@arrikto.com>

* review: Remove culling annotations when Pod is not found

Signed-off-by: Apostolos Gerakaris <apoger@arrikto.com>

* review: Improve logs

Add a log message at the beginning of the reconciliation loop
to make it clear that a Reconcile was called for a notebook.

Signed-off-by: Apostolos Gerakaris <apoger@arrikto.com>

* Run the controller locally

* Introduce make rule for running the controller locally with
  culling enabled

* Introduce a dev_culling_authorization_policy which must be
  applied when testing the culling-controller locally

Signed-off-by: Apostolos Gerakaris <apoger@arrikto.com>

* Update README instructions

Signed-off-by: Apostolos Gerakaris <apoger@arrikto.com>

Signed-off-by: Apostolos Gerakaris <apoger@arrikto.com>
2023-01-26 13:32:10 +00:00
mofanke f41667515e notebooks: notebook controller config RESTClient QPS and Burst in com… (kubeflow/kubeflow#6453) 2022-05-13 18:52:35 +00:00
Samu 0215857aa9 Support K8s 1.22 in notebook controller (kubeflow/kubeflow#6374)
Fix https://github.com/kubeflow/kubeflow/issues/6366

Migrating to Kubebuilder v3 leads to the following changes:
- Add .dockerignore file.
- Upgrade Go version from v1.15 to v1.17.
- Adapt Makefile.
- Add image (build + push) target to makefile.
- Upgrade EnvTest to use K8s v1.22.
- Update PROJECT template.
- Migrate CRD apiVersion from v1beta to v1.
- Add livenessProbe and readinessProbe to controller manager.
- Upgrade controller-runtime from v0.2.0 to v0.11.0.

Other changes:
- Build image using public.ecr.aws registry instead of gcr.io.
- Update README.md documentation.
- Update 3rd party licences.
- Fix notebook.spec description.
- Add 3 sample notebooks (v1, v1alpha1 and v1beta1).

Signed-off-by: Samuel Veloso <svelosol@redhat.com>
2022-05-03 15:49:01 +00:00
Naveen 396ace7a83 Fixes the default leader election ID (kubeflow/kubeflow#5374)
The default leader election  ID is controller-leader-election-helper which could conflict when multiple controllers run within the same namespace. This is a required field in later versions of controller-runtime.
2020-11-02 23:22:17 -08:00
Zhenghui Wang 89acff862c Add Notebook Controller v1 spec (kubeflow/kubeflow#4649)
* add v1 spec

* change kubeflow.org_nootebooks.yaml
2020-01-13 19:43:08 -08:00
Fernando Diaz 1ff2f7a880 Reissue pod and sts events as notebook events (kubeflow/kubeflow#4139) 2019-11-21 12:07:29 -08:00
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
Lun-Kai Hsu 2f2938bead Notebook v1beta1 (kubeflow/kubeflow#4105)
* add v1beta1

* add storage version

* wip

* add conversion

* setup webhook

* fix

* fix manifest

* webhook wip

* no webhook
2019-09-13 07:04:29 -07:00
Lun-Kai Hsu 8cad496a13 Migrate notebook CR to kubebuilder V2 (kubeflow/kubeflow#4013)
* wip

* can build

* tested: able to control notebook

* fix
2019-09-04 17:06:22 -07:00