diff --git a/apis/app/v1/vdicluster_app_util.go b/apis/app/v1/vdicluster_app_util.go index f0c0732..210240c 100644 --- a/apis/app/v1/vdicluster_app_util.go +++ b/apis/app/v1/vdicluster_app_util.go @@ -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()) } diff --git a/apis/app/v1/vdicluster_types.go b/apis/app/v1/vdicluster_types.go index 07e4e98..b0f229f 100644 --- a/apis/app/v1/vdicluster_types.go +++ b/apis/app/v1/vdicluster_types.go @@ -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"` diff --git a/config/crd/bases/app.kvdi.io_vdiclusters.yaml b/config/crd/bases/app.kvdi.io_vdiclusters.yaml index d9a092c..52484e9 100644 --- a/config/crd/bases/app.kvdi.io_vdiclusters.yaml +++ b/config/crd/bases/app.kvdi.io_vdiclusters.yaml @@ -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`. diff --git a/deploy/bundle.yaml b/deploy/bundle.yaml index 4178e63..b51ca35 100644 --- a/deploy/bundle.yaml +++ b/deploy/bundle.yaml @@ -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