-
Notifications
You must be signed in to change notification settings - Fork 65
feat(ws): add spec.podTemplate.ports[]
to WorkspaceKind
#507
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ws): add spec.podTemplate.ports[]
to WorkspaceKind
#507
Conversation
/ok-to-test |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we need to update the samples/
workspacekind.yaml
to reflect these changes.
workspaces/controller/config/crd/bases/kubeflow.org_workspacekinds.yaml
Outdated
Show resolved
Hide resolved
// ports that the container listens on | ||
// +kubebuilder:validation:Optional | ||
HTTPProxy *HTTPProxy `json:"httpProxy,omitempty"` | ||
Ports []WorkspaceKindPort `json:"ports,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Out of curiosity - what is the practical purpose of defining a WorkspaceKind with no Ports
? Why would someone want to do that ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a great question , we should rethink this 🤔
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should require at least one port, just so that the frontend does not have to deal with the possibility of a workspace with no ports.
+kubebuilder:validation:MinItems:=1
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
5170f6e
to
438e485
Compare
438e485
to
3239dde
Compare
/ok-to-test |
/lgtm testing these changes on a cluster and was able to:
|
9532f2f
to
c8382d8
Compare
/lgtm Testing Methodology
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @harshad16 here are comments.
// ports that the container listens on | ||
// +kubebuilder:validation:Optional | ||
HTTPProxy *HTTPProxy `json:"httpProxy,omitempty"` | ||
Ports []WorkspaceKindPort `json:"ports,omitempty"` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should require at least one port, just so that the frontend does not have to deal with the possibility of a workspace with no ports.
+kubebuilder:validation:MinItems:=1
workspaces/controller/internal/controller/workspace_controller.go
Outdated
Show resolved
Hide resolved
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
5d88a27
to
30d1fac
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A couple (minor) last tweaks being suggested here. However, none of them are really functionality impacting - so I will note that I also tested this code against a kind
cluster (making sure I updated both the controller
AND backend
deployments - and I can happily confirm:
- creating workspace kinds + workspaces through
kubectl
works - creating workspace kinds + workspaces through
frontend
UI also work
Additionally confirmed common negative scenarios as well as ensuring "falling back" to the DefaultDisplayName
is handled appropriately.
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
30d1fac
to
689e7bc
Compare
- moved protocal from imageconfig.spec.ports to podtemplates.ports - included the podtemplates.ports with defaultdisplayname - add validation webhook for podtemplate.ports - update the sample workspacekind with ports reference - referencing same id for portid in imageconfig and podtemplate.ports Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
689e7bc
to
dffa3a7
Compare
/lgtm |
workspaces/controller/config/samples/jupyterlab_v1beta1_workspacekind.yaml
Outdated
Show resolved
Hide resolved
workspaces/controller/config/samples/jupyterlab_v1beta1_workspacekind.yaml
Outdated
Show resolved
Hide resolved
workspaces/controller/config/samples/jupyterlab_v1beta1_workspacekind.yaml
Show resolved
Hide resolved
workspaces/controller/config/samples/jupyterlab_v1beta1_workspacekind.yaml
Outdated
Show resolved
Hide resolved
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
- adjusted method buildService with details from ports Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small changes, then good to go.
workspaces/controller/internal/webhook/workspacekind_webhook.go
Outdated
Show resolved
Hide resolved
Signed-off-by: Harshad Reddy Nalla <hnalla@redhat.com>
spec.podTemplate.ports[]
to WorkspaceKind
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@harshad16 thanks for bearing with us while we went back and forward on these reviews, great to have this merged.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: thesuperzapper The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
related: #37
This PR adds
spec.podTemplate.ports[]
to workspaceKind CRD, which lets users include ports httpproxy setting for their workspaces.WorkspaceKind CRD changes
Following changes are included:
These changes would be consider while setting the routing for proper traffic controller/routing to the pods.