Path: blob/main/install/installer/pkg/components/ws-manager-bridge/configmap.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 wsmanagerbridge56import (7"fmt"89"github.com/gitpod-io/gitpod/installer/pkg/common"10"github.com/gitpod-io/gitpod/installer/pkg/components/redis"1112corev1 "k8s.io/api/core/v1"13metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"14"k8s.io/apimachinery/pkg/runtime"15)1617func configmap(ctx *common.RenderContext) ([]runtime.Object, error) {18wsmbcfg := Configuration{19Installation: ctx.Config.Metadata.InstallationShortname,20WSClusterDBReconcileIntervalSeconds: 60,21ControllerIntervalSeconds: 60,22ControllerMaxDisconnectSeconds: 150,23ClusterService: ClusterService{24Port: 8080, // todo(sje) where does this value come from?25Host: "localhost",26},27Timeouts: Timeouts{28PreparingPhaseSeconds: 3600,29BuildingPhaseSeconds: 3600,30UnknownPhaseSeconds: 600,31PendingPhaseSeconds: 3600,32StoppingPhaseSeconds: 3600,33},34EmulatePreparingIntervalSeconds: 10,35StaticBridges: WSManagerList(ctx),36ClusterSyncIntervalSeconds: 60,37Redis: redis.GetConfiguration(ctx),38}3940fc, err := common.ToJSONString(wsmbcfg)41if err != nil {42return nil, fmt.Errorf("failed to marshal ws-manager-bridge config: %w", err)43}4445return []runtime.Object{46&corev1.ConfigMap{47TypeMeta: common.TypeMetaConfigmap,48ObjectMeta: metav1.ObjectMeta{49Name: fmt.Sprintf("%s-config", Component),50Namespace: ctx.Namespace,51Labels: common.CustomizeLabel(ctx, Component, common.TypeMetaConfigmap),52Annotations: common.CustomizeAnnotation(ctx, Component, common.TypeMetaConfigmap),53},54Data: map[string]string{55"ws-manager-bridge.json": string(fc),56},57},58}, nil59}606162