Skip to content

Commit

Permalink
feat: allow to customize service name
Browse files Browse the repository at this point in the history
  • Loading branch information
tinyzimmer committed Oct 20, 2023
1 parent 8c24423 commit 3c5bd39
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions apis/app/v1/vdicluster_app_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ import (

// GetAppName returns the name of the kVDI app deployment for this VDICluster.
func (c *VDICluster) GetAppName() string {
if c.Spec.App != nil && c.Spec.App.ServiceName != "" {
return c.Spec.App.ServiceName
}
return fmt.Sprintf("%s-app", c.GetName())
}

Expand Down
3 changes: 3 additions & 0 deletions apis/app/v1/vdicluster_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,9 @@ type AppConfig struct {
AuditLog bool `json:"auditLog,omitempty"`
// The number of app replicas to run
Replicas int32 `json:"replicas,omitempty"`
// ServiceName is the name of the service to create for the app instance.
// Defaults to `{vdi-name}-app`.
ServiceName string `json:"serviceName,omitempty"`
// The type of service to create in front of the app instance.
// Defaults to `LoadBalancer`.
ServiceType corev1.ServiceType `json:"serviceType,omitempty"`
Expand Down
4 changes: 4 additions & 0 deletions config/crd/bases/app.kvdi.io_vdiclusters.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,10 @@ spec:
type: string
description: Extra annotations to apply to the app service.
type: object
serviceName:
description: ServiceName is the name of the service to create
for the app instance. Defaults to `{vdi-name}-app`.
type: string
serviceType:
description: The type of service to create in front of the app
instance. Defaults to `LoadBalancer`.
Expand Down
3 changes: 3 additions & 0 deletions deploy/bundle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1523,6 +1523,9 @@ spec:
type: string
description: Extra annotations to apply to the app service.
type: object
serviceName:
description: ServiceName is the name of the service to create for the app instance. Defaults to `{vdi-name}-app`.
type: string
serviceType:
description: The type of service to create in front of the app instance. Defaults to `LoadBalancer`.
type: string
Expand Down

0 comments on commit 3c5bd39

Please sign in to comment.