Path: blob/main/install/installer/pkg/components/openvsx-proxy/service.go
2501 views
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.1// Licensed under the GNU Affero General Public License (AGPL).2// See License.AGPL.txt in the project root for license information.34package openvsx_proxy56import (7"github.com/gitpod-io/gitpod/common-go/baseserver"8"github.com/gitpod-io/gitpod/installer/pkg/common"910corev1 "k8s.io/api/core/v1"11"k8s.io/apimachinery/pkg/runtime"12)1314func service(ctx *common.RenderContext) ([]runtime.Object, error) {15var annotations map[string]string1617if ctx.Config.OpenVSX.Proxy != nil {18annotations = ctx.Config.OpenVSX.Proxy.ServiceAnnotations19}2021ports := []common.ServicePort{22{23Name: PortName,24ContainerPort: ContainerPort,25ServicePort: ServicePort,26},27{28Name: baseserver.BuiltinMetricsPortName,29ContainerPort: baseserver.BuiltinMetricsPort,30ServicePort: baseserver.BuiltinMetricsPort,31},32}3334return common.GenerateService(Component, ports, func(service *corev1.Service) {35for k, v := range annotations {36service.Annotations[k] = v37}38})(ctx)39}404142