Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
gitpod-io
GitHub Repository: gitpod-io/gitpod
Path: blob/main/install/installer/pkg/components/ws-daemon/tlssecret.go
2501 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 wsdaemon
6
7
import (
8
"fmt"
9
10
"github.com/gitpod-io/gitpod/installer/pkg/common"
11
certmanagerv1 "github.com/jetstack/cert-manager/pkg/apis/certmanager/v1"
12
cmmeta "github.com/jetstack/cert-manager/pkg/apis/meta/v1"
13
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
14
"k8s.io/apimachinery/pkg/runtime"
15
)
16
17
func tlssecret(ctx *common.RenderContext) ([]runtime.Object, error) {
18
return []runtime.Object{
19
&certmanagerv1.Certificate{
20
TypeMeta: common.TypeMetaCertificate,
21
ObjectMeta: metav1.ObjectMeta{
22
Name: TLSSecretName,
23
Namespace: ctx.Namespace,
24
Labels: common.DefaultLabels(Component),
25
},
26
Spec: certmanagerv1.CertificateSpec{
27
Duration: common.InternalCertDuration,
28
SecretName: TLSSecretName,
29
DNSNames: []string{
30
fmt.Sprintf("gitpod.%s", ctx.Namespace),
31
fmt.Sprintf("%s.%s.svc", Component, ctx.Namespace),
32
Component,
33
"wsdaemon", // Seems this is hardcoded in WSManager
34
},
35
IssuerRef: cmmeta.ObjectReference{
36
Name: common.CertManagerCAIssuer,
37
Kind: certmanagerv1.ClusterIssuerKind,
38
Group: "cert-manager.io",
39
},
40
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
41
Labels: common.DefaultLabels(Component),
42
},
43
},
44
},
45
}, nil
46
}
47
48