Open thesuperzapper opened 2 weeks ago
@jiridanek @Adembc, @kimwnasptd, or @ederign you might be interested in picking this up.
@jiridanek as discussed in the Notebook WG meeting, I have added some better examples of what the VirtualService should look like.
I have also realized that we will need to change a few things about the WorkspaceKind CRD spec, namely that the spec.podTemplate.httpProxy
map needs to be replaced with spec.podTemplate.ports
list, so different proxy configs can be applied to each port. (See above issue for more info).
Hi @thesuperzapper could you assign it to me?
I'll be on vacation for the next week, so, all the best to @mcruzdev!
Thank you @jiridanek, good vacaction for you :)
related https://github.com/kubeflow/kubeflow/issues/7156
Now that https://github.com/kubeflow/notebooks/pull/34 is merged, there are only a small number of remaining tasks for the "Kubeflow Workspaces Controller to be finished.
One task to finish the workspace controller loop, so it also reconciles the Istio VirtualServices required to make the Workspace Pods accessible on the Istio mesh
Implementation
Here is the TODO in the code:
https://github.com/kubeflow/notebooks/blob/bc4e4454bc1c921549cb9df5865e52a61fe07946/workspaces/controller/internal/controller/workspace_controller.go#L345-L348
VirtualService Definition
The structure of the HTTP paths exposed by each Workspace should be:
/workspace/<NAMESPACE_NAME>/<WORKSPACE_NAME>/<PORT_ID>/
Where
PORT_ID
is the id of a port defined in the currently selectedspec.podTemplate.options.imageConfig
, which is defined in the WorkspaceKind underspec.podTemplate.options.imageConfig.values[].spec.ports
Note, this path structure is already reflected in the
httpPathPrefix
function for thespec.podTemplate.extraEnv[0].value
go templates (which should probably be factored into a helper):https://github.com/kubeflow/notebooks/blob/bc4e4454bc1c921549cb9df5865e52a61fe07946/workspaces/controller/internal/controller/workspace_controller.go#L594-L604
Example VirtualService
Here is a templated example of the VirtualService we should reconcile:
CRDs
Besides making the Pod available, the VirtualService will also implement the
spec.podTemplate.ports[].httpProxy
part of the WorkspaceKind spec:Changes from current CRDs
After designing and discussing this implementation, we figured that we need to make some small additions to the existing Notebooks 2.0 CRDs:
spec.podTemplate.httpProxy
map, and replace it withspec.podTemplate.ports
list.spec.podTemplate.ports
will be a map with the following keys:portId
: the map-index of this array and determines which port the configs are applied tohttpProxy
: the same as the old ones, but now scoped to a specific port.