Path: blob/main/install/installer/pkg/components/ws-manager-mk2/tlssecret.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 wsmanagermk256import (7"fmt"89"github.com/gitpod-io/gitpod/installer/pkg/common"1011certmanagerv1 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"12cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"13metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"14"k8s.io/apimachinery/pkg/runtime"15)1617func tlssecret(ctx *common.RenderContext) ([]runtime.Object, error) {18serverAltNames := []string{19fmt.Sprintf("gitpod.%s", ctx.Namespace),20fmt.Sprintf("%s.%s.svc", Component, ctx.Namespace),21Component,22fmt.Sprintf("%s-dev", Component),23fmt.Sprintf("%s.%s.svc", "ws-manager", ctx.Namespace),24"ws-manager",25fmt.Sprintf("%s-dev", "ws-manager"),26}27clientAltNames := []string{28common.RegistryFacadeComponent,29common.ServerComponent,30common.WSManagerBridgeComponent,31common.ImageBuilderComponent,32common.WSProxyComponent,33Component,34}3536issuer := common.CertManagerCAIssuer3738return []runtime.Object{39&certmanagerv1.Certificate{40TypeMeta: common.TypeMetaCertificate,41ObjectMeta: metav1.ObjectMeta{42Name: TLSSecretNameSecret,43Namespace: ctx.Namespace,44Labels: common.DefaultLabels(Component),45},46Spec: certmanagerv1.CertificateSpec{47Duration: common.InternalCertDuration,48SecretName: TLSSecretNameSecret,49DNSNames: serverAltNames,50IssuerRef: cmmeta.ObjectReference{51Name: issuer,52Kind: certmanagerv1.ClusterIssuerKind,53Group: "cert-manager.io",54},55},56},57&certmanagerv1.Certificate{58TypeMeta: common.TypeMetaCertificate,59ObjectMeta: metav1.ObjectMeta{60Name: Component,61Namespace: ctx.Namespace,62Labels: common.DefaultLabels(Component),63},64Spec: certmanagerv1.CertificateSpec{65Duration: common.InternalCertDuration,66SecretName: TLSSecretNameClient,67DNSNames: clientAltNames,68IssuerRef: cmmeta.ObjectReference{69Name: issuer,70Kind: certmanagerv1.ClusterIssuerKind,71Group: "cert-manager.io",72},73},74},75}, nil76}777879