notebooks/components/pvcviewer-controller
Eder Ignatowicz f1f441c89b chore: migrate docker images to ghcr (kubeflow/kubeflow#7706)
* chore: migrate docker images to ghcr

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>

* adding dash for central dashboard

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>

* update the spawner images

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>

* try to fix qemu

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>

* fix notebook-servers GHCR image path

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

* update example-notebook-servers README

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

* fix missed `IMG` updates

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

* remove remaining cases of `kubeflownotebookswg`

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

* fix typos

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

* remove `DOCKER_USER` env-var from workflows

Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>

---------

Signed-off-by: Eder Ignatowicz <ignatowicz@gmail.com>
Signed-off-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
Co-authored-by: Mathew Wicks <5735406+thesuperzapper@users.noreply.github.com>
2025-03-18 02:12:20 +00:00
..
api/v1alpha1 chore: update pvcviewer dependencies (kubeflow/kubeflow#7561) 2024-05-21 17:21:24 +00:00
config chore: migrate docker images to ghcr (kubeflow/kubeflow#7706) 2025-03-18 02:12:20 +00:00
controllers chore: update pvcviewer dependencies (kubeflow/kubeflow#7561) 2024-05-21 17:21:24 +00:00
hack Re-Introducing the Volumes Viewer (kubeflow/kubeflow#6876) 2023-06-14 07:33:34 +00:00
.dockerignore Re-Introducing the Volumes Viewer (kubeflow/kubeflow#6876) 2023-06-14 07:33:34 +00:00
.gitignore fix: pvcviewer tests (kubeflow/kubeflow#7292) 2023-09-21 09:04:37 +00:00
Dockerfile chore: update pvcviewer dependencies (kubeflow/kubeflow#7561) 2024-05-21 17:21:24 +00:00
Makefile chore: migrate docker images to ghcr (kubeflow/kubeflow#7706) 2025-03-18 02:12:20 +00:00
OWNERS Re-Introducing the Volumes Viewer (kubeflow/kubeflow#6876) 2023-06-14 07:33:34 +00:00
PROJECT Re-Introducing the Volumes Viewer (kubeflow/kubeflow#6876) 2023-06-14 07:33:34 +00:00
README.md fix: viewer-spec.yaml and trigger build (kubeflow/kubeflow#7230) 2023-08-16 18:56:03 +00:00
go.mod chore: update pvcviewer dependencies (kubeflow/kubeflow#7561) 2024-05-21 17:21:24 +00:00
go.sum chore: update pvcviewer dependencies (kubeflow/kubeflow#7561) 2024-05-21 17:21:24 +00:00
main.go chore: update pvcviewer dependencies (kubeflow/kubeflow#7561) 2024-05-21 17:21:24 +00:00

README.md

PVCViewer

Using this component, PVCViewers can easily be created. PVCViewers enable users to open a filebrowser on arbitrary persistent volume claims, letting them inspect, download, upload and manipulate data.

The PVCViewer API is meant to be extensible and can easily be user for other use-cases, such as launching user-tailored apps (e.g. tensorboards or notebooks).

Find the Pull Request for more info here.

Description

The component is meant to be used in interaction with other components, such as the volumes web app. These are to create an instance of the custom resource. The controller will then generate deployments, services and virtualservices base on the spec.

A resource starting a filebrowser might look like this:

apiVersion: kubeflow.org/v1alpha1
kind: PVCViewer
metadata:
  name: pvcviewer-sample
  namespace: kubeflow-user-example-com
spec:
  # The PVC we are watching
  pvc: pvcviewer-sample
  # The podSpec is applied to the deployment.Spec.Template.Spec
  # and thus, represents the core viewer's application
  # Gets set to a default PodSpec, if not specified
  # podSpec: {}
  # If defined, the viewer will be exposed via a Service and a VirtualService
  networking:
    # Specifies the application's target port used by the Service
    targetPort: 8080
    # The base prefix is suffixed by '/namespace/name' to create the
    # VirtualService's prefix and a unique URL for each started viewer
    basePrefix: "/pvcviewer"
    # You may specify the VirtualService's rewrite.
    # If not set, the prefix's value is used
    rewrite: "/"
    # By default, no timeout is set
    # timeout: 30s
  # If set to true, the controller detects RWO-Volumes referred to by the
  # podSpec and uses affinities to schedule the viewer to nodes
  # where the volume is currently mounted. This enables the viewer to
  # access RWO-Volumes, even though they might already be mounted.
  rwoScheduling: true

Configuring Default values

You may set a spec.podSpec to gain control over the started filebrowser.

In case the podSpec is omitted, a default podSpec is inferred. You may change the defaults by having the manager mount a config file with defaults and setting the env-variable DEFAULT_POD_SPEC_PATH.

This is especially useful, when you can't control the creation of the PVCViewer object, e.g. since it's automatically created by another component such as the volumes UI.

How it works

This project aims to follow the Kubernetes Operator pattern.

It uses controllers to watch all changes to viewer objects and react accordingly. Technically, this is implemented by the reconcile loop: it syncs resources until the desired state is reached on the cluster.

Modifying the API definitions

If you are editing the API definitions, generate the manifests such as CRs or CRDs using:

make manifests

Testing

In order to test the controller, simply execute:

make test

Installing the Controller

Youll need a Kubernetes cluster to run against.

Also, Istio and Cert-Manager need to be installed. We recommend installing Kubeflow as it bundles all required components.

  1. Install the default config using Kustomize:
kubectl apply -k config/default
  1. Build the controller image:
docker build -t kubeflow-pvc-viewer:test .
  1. Set the controller to use the image:
kubectl -n kubeflow set image deployment pvc-viewer-controller-manager manager=kubeflow-pvc-viewer:test
  1. Deploy the example:
kubectl apply -k config/samples

After the viewer has been launched, you should be able to open the filebrowser in your browser at /pvcviewer/kubeflow-user-example-com/pvcviewer-sample/files/.