[installer] Use mk2 tls certificates for server (#17317)

This commit is contained in:
Thomas Schubart 2023-04-24 13:19:45 +02:00 committed by GitHub
parent 233ec9457a
commit 09bb1b218c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import (
"github.com/gitpod-io/gitpod/installer/pkg/components/spicedb" "github.com/gitpod-io/gitpod/installer/pkg/components/spicedb"
"github.com/gitpod-io/gitpod/installer/pkg/components/usage" "github.com/gitpod-io/gitpod/installer/pkg/components/usage"
wsmanager "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager" wsmanager "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager"
wsmanagermk2 "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager-mk2"
"github.com/gitpod-io/gitpod/installer/pkg/common" "github.com/gitpod-io/gitpod/installer/pkg/common"
wsmanagerbridge "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager-bridge" wsmanagerbridge "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager-bridge"
@ -240,11 +241,19 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
addWsManagerTls := common.WithLocalWsManager(ctx) addWsManagerTls := common.WithLocalWsManager(ctx)
if addWsManagerTls { if addWsManagerTls {
secretName := wsmanager.TLSSecretNameClient
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
if cfg.Workspace != nil && cfg.Workspace.UseWsmanagerMk2 {
secretName = wsmanagermk2.TLSSecretNameClient
}
return nil
})
volumes = append(volumes, corev1.Volume{ volumes = append(volumes, corev1.Volume{
Name: "ws-manager-client-tls-certs", Name: "ws-manager-client-tls-certs",
VolumeSource: corev1.VolumeSource{ VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{ Secret: &corev1.SecretVolumeSource{
SecretName: wsmanager.TLSSecretNameClient, SecretName: secretName,
}, },
}, },
}) })

View File

@ -11,6 +11,8 @@ import (
"github.com/gitpod-io/gitpod/installer/pkg/cluster" "github.com/gitpod-io/gitpod/installer/pkg/cluster"
"github.com/gitpod-io/gitpod/installer/pkg/common" "github.com/gitpod-io/gitpod/installer/pkg/common"
wsmanager "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager" wsmanager "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager"
wsmanagermk2 "github.com/gitpod-io/gitpod/installer/pkg/components/ws-manager-mk2"
"github.com/gitpod-io/gitpod/installer/pkg/config/v1/experimental"
appsv1 "k8s.io/api/apps/v1" appsv1 "k8s.io/api/apps/v1"
corev1 "k8s.io/api/core/v1" corev1 "k8s.io/api/core/v1"
@ -35,11 +37,19 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
addWsManagerTls := common.WithLocalWsManager(ctx) addWsManagerTls := common.WithLocalWsManager(ctx)
if addWsManagerTls { if addWsManagerTls {
secretName := wsmanager.TLSSecretNameClient
_ = ctx.WithExperimental(func(cfg *experimental.Config) error {
if cfg.Workspace != nil && cfg.Workspace.UseWsmanagerMk2 {
secretName = wsmanagermk2.TLSSecretNameClient
}
return nil
})
volumes = append(volumes, corev1.Volume{ volumes = append(volumes, corev1.Volume{
Name: "ws-manager-client-tls-certs", Name: "ws-manager-client-tls-certs",
VolumeSource: corev1.VolumeSource{ VolumeSource: corev1.VolumeSource{
Secret: &corev1.SecretVolumeSource{ Secret: &corev1.SecretVolumeSource{
SecretName: wsmanager.TLSSecretNameClient, SecretName: secretName,
}, },
}, },
}) })