Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/registry-facade/certificate.go
2506 views
1
// Copyright (c) 2021 Gitpod GmbH. All rights reserved.
2
// Licensed under the GNU Affero General Public License (AGPL).
3
// See License.AGPL.txt in the project root for license information.
4
5
package registryfacade
6
7
import (
8
"fmt"
9
10
certmanagerv1 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
11
cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"
12
13
"github.com/gitpod-io/gitpod/installer/pkg/common"
14
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
15
"k8s.io/apimachinery/pkg/runtime"
16
)
17
18
func certificate(ctx *common.RenderContext) ([]runtime.Object, error) {
19
return []runtime.Object{&certmanagerv1.Certificate{
20
TypeMeta: common.TypeMetaCertificate,
21
ObjectMeta: metav1.ObjectMeta{
22
Name: common.RegistryFacadeTLSCertSecret,
23
Namespace: ctx.Namespace,
24
Labels: common.DefaultLabels(Component),
25
},
26
Spec: certmanagerv1.CertificateSpec{
27
Duration: common.InternalCertDuration,
28
SecretName: common.RegistryFacadeTLSCertSecret,
29
IssuerRef: cmmeta.ObjectReference{
30
Name: common.CertManagerCAIssuer,
31
Kind: certmanagerv1.ClusterIssuerKind,
32
Group: "cert-manager.io",
33
},
34
DNSNames: []string{
35
fmt.Sprintf("reg.%s", ctx.Config.Domain),
36
},
37
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
38
Labels: common.DefaultLabels(Component),
39
},
40
},
41
}}, nil
42
}
43
44