Skip to content

Commit afb11a6

Browse files
author
Simon Emms
committed
[installer]: set secretTemplate for certs
This allows them to be picked up by the KOTS support bundle
1 parent 6a4936a commit afb11a6

File tree

6 files changed

+25
-0
lines changed

6 files changed

+25
-0
lines changed

install/installer/pkg/components/cluster/certmanager.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ func certmanager(ctx *common.RenderContext) ([]runtime.Object, error) {
5353
Kind: "Issuer",
5454
Group: "cert-manager.io",
5555
},
56+
SecretTemplate: &v1.CertificateSecretTemplate{
57+
Labels: common.DefaultLabels(Component),
58+
},
5659
},
5760
},
5861
// Set the CA to our issuer

install/installer/pkg/components/docker-registry/certificate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package dockerregistry
66

77
import (
88
"fmt"
9+
910
certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
1011
cmmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1"
1112
"github.com/gitpod-io/gitpod/installer/pkg/common"
@@ -37,6 +38,9 @@ func certificate(ctx *common.RenderContext) ([]runtime.Object, error) {
3738
DNSNames: []string{
3839
fmt.Sprintf("registry.%s.svc.cluster.local", ctx.Namespace),
3940
},
41+
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
42+
Labels: common.DefaultLabels(Component),
43+
},
4044
},
4145
}}, nil
4246
}

install/installer/pkg/components/registry-facade/certificate.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package registryfacade
66

77
import (
88
"fmt"
9+
910
certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
1011
cmmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1"
1112

@@ -33,6 +34,9 @@ func certificate(ctx *common.RenderContext) ([]runtime.Object, error) {
3334
DNSNames: []string{
3435
fmt.Sprintf("reg.%s", ctx.Config.Domain),
3536
},
37+
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
38+
Labels: common.DefaultLabels(Component),
39+
},
3640
},
3741
}}, nil
3842
}

install/installer/pkg/components/ws-daemon/tlssecret.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ package wsdaemon
66

77
import (
88
"fmt"
9+
910
certmanagerv1 "github.com/cert-manager/cert-manager/pkg/apis/certmanager/v1"
1011
cmmeta "github.com/cert-manager/cert-manager/pkg/apis/meta/v1"
1112
"github.com/gitpod-io/gitpod/installer/pkg/common"
@@ -36,6 +37,9 @@ func tlssecret(ctx *common.RenderContext) ([]runtime.Object, error) {
3637
Kind: "Issuer",
3738
Group: "cert-manager.io",
3839
},
40+
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
41+
Labels: common.DefaultLabels(Component),
42+
},
3943
},
4044
},
4145
}, nil

install/installer/pkg/components/ws-manager/tlssecret.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ func tlssecret(ctx *common.RenderContext) ([]runtime.Object, error) {
4949
Kind: "Issuer",
5050
Group: "cert-manager.io",
5151
},
52+
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
53+
Labels: common.DefaultLabels(Component),
54+
},
5255
},
5356
},
5457
&certmanagerv1.Certificate{
@@ -67,6 +70,9 @@ func tlssecret(ctx *common.RenderContext) ([]runtime.Object, error) {
6770
Kind: "Issuer",
6871
Group: "cert-manager.io",
6972
},
73+
SecretTemplate: &certmanagerv1.CertificateSecretTemplate{
74+
Labels: common.DefaultLabels(Component),
75+
},
7076
},
7177
},
7278
}, nil

install/kots/manifests/gitpod-certificate.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,3 +19,7 @@ spec:
1919
- '{{repl ConfigOption "domain" }}'
2020
- '*.{{repl ConfigOption "domain" }}'
2121
- '*.ws.{{repl ConfigOption "domain" }}'
22+
secretTemplate:
23+
labels:
24+
app: gitpod
25+
component: gitpod-installer

0 commit comments

Comments
 (0)