Skip to content

Commit

Permalink
chore(fmt): format code
Browse files Browse the repository at this point in the history
Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

feat:devbox controller support websocket

docs: change blog url (labring#5251)

Signed-off-by: Carson Yang <yangchuansheng33@gmail.com>

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

chore(fmt): format code

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

feat:devbox controller support websocket

chore(fmt): format code

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

feat:websocket auto shutdown

feat:websocket auto shutdown

chore(fmt): format code

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

chore(fmt): format code

Signed-off-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

feat:websocket auto shutdown

Delete tencent9825051126872297210.txt
  • Loading branch information
bearslyricattack committed Dec 20, 2024
1 parent 7369a80 commit 676a495
Show file tree
Hide file tree
Showing 4 changed files with 262 additions and 81 deletions.
15 changes: 13 additions & 2 deletions controllers/devbox/api/v1alpha1/devbox_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,20 @@ type RuntimeRef struct {

type NetworkSpec struct {
// +kubebuilder:validation:Required
// +kubebuilder:validation:Enum=NodePort;Tailnet
// +kubebuilder:validation:Enum=NodePort;Tailnet;WebSocket
Type NetworkType `json:"type"`
// +kubebuilder:validation:Optional
ExtraPorts []corev1.ContainerPort `json:"extraPorts"`
}

type AutoShutdownSpec struct {
// +kubebuilder:validation:Optional
// +kubebuilder:default=false
Enable bool `json:"type"`
// +kubebuilder:validation:Optional
Time string `json:"time"`
}

// DevboxSpec defines the desired state of Devbox
type DevboxSpec struct {
// +kubebuilder:validation:Required
Expand All @@ -88,6 +96,9 @@ type DevboxSpec struct {
// +kubebuilder:validation:Required
NetworkSpec NetworkSpec `json:"network,omitempty"`

// +kubebuilder:validation:Optional
AutoShutdownSpec AutoShutdownSpec `json:"autoShutdown,omitempty"`

// todo add rewrite labels and annotations...
// +kubebuilder:validation:Optional
ExtraLabels map[string]string `json:"extraLabels,omitempty"`
Expand Down Expand Up @@ -118,7 +129,7 @@ type DevboxSpec struct {

type NetworkStatus struct {
// +kubebuilder:default=NodePort
// +kubebuilder:validation:Enum=NodePort;Tailnet
// +kubebuilder:validation:Enum=NodePort;Tailnet;WebSocket
Type NetworkType `json:"type"`

// +kubebuilder:validation:Optional
Expand Down
18 changes: 18 additions & 0 deletions controllers/devbox/cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,12 @@ func main() {
var requestEphemeralStorage string
var limitEphemeralStorage string
var debugMode bool
var webSocketImage string
var websocketProxyDomain string
var ingressClass string
var enableAutoShutdown bool
var shutdownServerKey string
var shutdownServerAddr string
flag.StringVar(&registryAddr, "registry-addr", "sealos.hub:5000", "The address of the registry")
flag.StringVar(&registryUser, "registry-user", "admin", "The user of the registry")
flag.StringVar(&registryPassword, "registry-password", "passw0rd", "The password of the registry")
Expand All @@ -93,6 +99,12 @@ func main() {
flag.Float64Var(&requestMemoryRate, "request-memory-rate", 10, "The request rate of memory limit in devbox.")
flag.StringVar(&requestEphemeralStorage, "request-ephemeral-storage", "500Mi", "The request value of ephemeral storage in devbox.")
flag.StringVar(&limitEphemeralStorage, "limit-ephemeral-storage", "10Gi", "The limit value of ephemeral storage in devbox.")
flag.StringVar(&webSocketImage, "websocket-image", "cbluebird/wst:v0.0.4", "The image name of devbox websocket proxy pod.")
flag.StringVar(&websocketProxyDomain, "websocket-proxy-domain", "sealoshzh.site", "The websocket proxy domain of devbox ingress.")
flag.StringVar(&ingressClass, "ingress-class", "nginx", "The ingress class name.")
flag.BoolVar(&enableAutoShutdown, "enable-auto-shutdown", true, "If set, Devbox auto shutdown will be enabled.")
flag.StringVar(&shutdownServerKey, "shutdown-server-key", "sealos-devbox-shutdown", "The server key used to shutdown the server.")
flag.StringVar(&shutdownServerAddr, "shutdown-server-addr", "http://shutdown-service:8082", "The shutdown server address.")
opts := zap.Options{
Development: true,
}
Expand Down Expand Up @@ -192,6 +204,12 @@ func main() {
RequestEphemeralStorage: requestEphemeralStorage,
LimitEphemeralStorage: limitEphemeralStorage,
DebugMode: debugMode,
WebSocketImage: webSocketImage,
WebsocketProxyDomain: websocketProxyDomain,
IngressClass: ingressClass,
EnableAutoShutdown: enableAutoShutdown,
ShutdownServerKey: shutdownServerKey,
ShutdownServerAddr: shutdownServerAddr,
}).SetupWithManager(mgr); err != nil {
setupLog.Error(err, "unable to create controller", "controller", "Devbox")
os.Exit(1)
Expand Down
Loading

0 comments on commit 676a495

Please sign in to comment.