Path: blob/main/install/installer/pkg/components/registry-facade/certificate.go
2506 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 registryfacade56import (7"fmt"89certmanagerv1 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"10cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"1112"github.com/gitpod-io/gitpod/installer/pkg/common"13metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"14"k8s.io/apimachinery/pkg/runtime"15)1617func certificate(ctx *common.RenderContext) ([]runtime.Object, error) {18return []runtime.Object{&certmanagerv1.Certificate{19TypeMeta: common.TypeMetaCertificate,20ObjectMeta: metav1.ObjectMeta{21Name: common.RegistryFacadeTLSCertSecret,22Namespace: ctx.Namespace,23Labels: common.DefaultLabels(Component),24},25Spec: certmanagerv1.CertificateSpec{26Duration: common.InternalCertDuration,27SecretName: common.RegistryFacadeTLSCertSecret,28IssuerRef: cmmeta.ObjectReference{29Name: common.CertManagerCAIssuer,30Kind: certmanagerv1.ClusterIssuerKind,31Group: "cert-manager.io",32},33DNSNames: []string{34fmt.Sprintf("reg.%s", ctx.Config.Domain),35},36SecretTemplate: &certmanagerv1.CertificateSecretTemplate{37Labels: common.DefaultLabels(Component),38},39},40}}, nil41}424344