diff --git a/installer/pkg/common/objects.go b/installer/pkg/common/objects.go index e369a71227d99d..b71b5bf006be51 100644 --- a/installer/pkg/common/objects.go +++ b/installer/pkg/common/objects.go @@ -65,12 +65,18 @@ func GenerateServiceWithServiceType(component string, ports map[string]ServicePo spec.ClusterIP = "None" } + var annotations map[string]string + if componentConfig, found := cfg.Config.Workspace.Components[component]; found != false { + annotations = componentConfig.ServiceAnnotations + } + return []runtime.Object{&corev1.Service{ TypeMeta: TypeMetaService, ObjectMeta: metav1.ObjectMeta{ - Name: component, - Namespace: cfg.Namespace, - Labels: labels, + Name: component, + Namespace: cfg.Namespace, + Labels: labels, + Annotations: annotations, }, Spec: spec, }}, nil diff --git a/installer/pkg/config/v1/config.go b/installer/pkg/config/v1/config.go index a744b3fee5d0f7..841ca390020f6e 100644 --- a/installer/pkg/config/v1/config.go +++ b/installer/pkg/config/v1/config.go @@ -198,10 +198,15 @@ type WorkspaceTemplates struct { Probe *corev1.Pod `json:"probe"` } +type WorkspaceComponent struct { + ServiceAnnotations map[string]string `json:"serviceAnnotations,omitempty"` +} + type Workspace struct { - Runtime WorkspaceRuntime `json:"runtime" validate:"required"` - Resources Resources `json:"resources" validate:"required"` - Templates *WorkspaceTemplates `json:"templates,omitempty"` + Runtime WorkspaceRuntime `json:"runtime" validate:"required"` + Resources Resources `json:"resources" validate:"required"` + Templates *WorkspaceTemplates `json:"templates,omitempty"` + Components map[string]WorkspaceComponent `json:"components,omitempty"` } type FSShiftMethod string