-
Notifications
You must be signed in to change notification settings - Fork 54
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
base: notebooks-v2
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
@@ -29,6 +29,16 @@ import ( | |||||||||
=============================================================================== | ||||||||||
*/ | ||||||||||
|
||||||||||
// PortId represents a port identifier | ||||||||||
// - this is NOT used as the Container or Service port name, but as part of the HTTP path | ||||||||||
// - this is used to reference the port in the `imageconfig` ports.[].id | ||||||||||
// - this is also used to reference the port in the podtemplate ports.[].portId | ||||||||||
// | ||||||||||
// +kubebuilder:validation:MinLength:=1 | ||||||||||
// +kubebuilder:validation:MaxLength:=32 | ||||||||||
// +kubebuilder:validation:Pattern:=^[a-z0-9][a-z0-9_-]*[a-z0-9]$ | ||||||||||
type PortId string | ||||||||||
|
||||||||||
// WorkspaceKindSpec defines the desired state of WorkspaceKind | ||||||||||
type WorkspaceKindSpec struct { | ||||||||||
|
||||||||||
|
@@ -115,9 +125,9 @@ type WorkspaceKindPodTemplate struct { | |||||||||
// volume mount paths | ||||||||||
VolumeMounts WorkspaceKindVolumeMounts `json:"volumeMounts"` | ||||||||||
|
||||||||||
// http proxy configs (MUTABLE) | ||||||||||
// ports that the container listens on | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||
// +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 commentThe 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 |
||||||||||
|
||||||||||
// environment variables for Workspace Pods (MUTABLE) | ||||||||||
// - the following go template functions are available: | ||||||||||
|
@@ -151,6 +161,17 @@ type WorkspaceKindPodTemplate struct { | |||||||||
Options WorkspaceKindPodOptions `json:"options"` | ||||||||||
} | ||||||||||
|
||||||||||
type WorkspaceKindPort struct { | ||||||||||
// the id of the port | ||||||||||
// - identifier for the port in `imageconfig` ports.[].id | ||||||||||
// +kubebuilder:example="jupyterlab" | ||||||||||
PortId PortId `json:"portId"` | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably lets just make this |
||||||||||
|
||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Because all ports of the same ID should have the same protocol, we should remove the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should add a DefaultDisplayName field here, and make the one in imageConfigValue optional (pointer) so that people can override it for a specific image config option. |
||||||||||
// the http proxy config for the port (MUTABLE) | ||||||||||
// +kubebuilder:validation:Optional | ||||||||||
HTTPProxy *HTTPProxy `json:"httpProxy,omitempty"` | ||||||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Out of curiosity - what is the practical purpose of defining a |
||||||||||
} | ||||||||||
|
||||||||||
type WorkspaceKindPodMetadata struct { | ||||||||||
// labels to be applied to the Pod resource | ||||||||||
// +kubebuilder:validation:Optional | ||||||||||
|
@@ -339,11 +360,8 @@ type ImageConfigSpec struct { | |||||||||
type ImagePort struct { | ||||||||||
// the id of the port | ||||||||||
// - this is NOT used as the Container or Service port name, but as part of the HTTP path | ||||||||||
// +kubebuilder:validation:MinLength:=1 | ||||||||||
// +kubebuilder:validation:MaxLength:=32 | ||||||||||
// +kubebuilder:validation:Pattern:=^[a-z0-9][a-z0-9_-]*[a-z0-9]$ | ||||||||||
// +kubebuilder:example="jupyterlab" | ||||||||||
Id string `json:"id"` | ||||||||||
Id PortId `json:"id"` | ||||||||||
|
||||||||||
// the port number | ||||||||||
// +kubebuilder:validation:Minimum:=1 | ||||||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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.