7
7
"github.com/gitpod-io/gitpod/common-go/baseserver"
8
8
"github.com/gitpod-io/gitpod/installer/pkg/cluster"
9
9
"github.com/gitpod-io/gitpod/installer/pkg/common"
10
+ "github.com/gitpod-io/gitpod/installer/pkg/config/v1/experimental"
10
11
appsv1 "k8s.io/api/apps/v1"
11
12
corev1 "k8s.io/api/core/v1"
12
13
"k8s.io/apimachinery/pkg/api/resource"
@@ -19,6 +20,31 @@ import (
19
20
func deployment (ctx * common.RenderContext ) ([]runtime.Object , error ) {
20
21
labels := common .DefaultLabels (Component )
21
22
23
+ var volumes []corev1.Volume
24
+ var volumeMounts []corev1.VolumeMount
25
+ _ = ctx .WithExperimental (func (cfg * experimental.Config ) error {
26
+ if cfg .WebApp != nil && cfg .WebApp .Server != nil && cfg .WebApp .Server .StripeSecret != "" {
27
+ stripeSecret := cfg .WebApp .Server .StripeSecret
28
+
29
+ volumes = append (volumes ,
30
+ corev1.Volume {
31
+ Name : "stripe-secret" ,
32
+ VolumeSource : corev1.VolumeSource {
33
+ Secret : & corev1.SecretVolumeSource {
34
+ SecretName : stripeSecret ,
35
+ },
36
+ },
37
+ })
38
+
39
+ volumeMounts = append (volumeMounts , corev1.VolumeMount {
40
+ Name : "stripe-secret" ,
41
+ MountPath : stripeSecretMountPath ,
42
+ ReadOnly : true ,
43
+ })
44
+ }
45
+ return nil
46
+ })
47
+
22
48
return []runtime.Object {
23
49
& appsv1.Deployment {
24
50
TypeMeta : common .TypeMetaDeployment ,
@@ -45,6 +71,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
45
71
RestartPolicy : "Always" ,
46
72
TerminationGracePeriodSeconds : pointer .Int64 (30 ),
47
73
InitContainers : []corev1.Container {* common .DatabaseWaiterContainer (ctx )},
74
+ Volumes : volumes ,
48
75
Containers : []corev1.Container {{
49
76
Name : Component ,
50
77
Image : ctx .ImageName (ctx .Config .Repository , Component , ctx .VersionManifest .Components .Usage .Version ),
@@ -66,6 +93,7 @@ func deployment(ctx *common.RenderContext) ([]runtime.Object, error) {
66
93
common .DefaultEnv (& ctx .Config ),
67
94
common .DatabaseEnv (& ctx .Config ),
68
95
),
96
+ VolumeMounts : volumeMounts ,
69
97
LivenessProbe : & corev1.Probe {
70
98
ProbeHandler : corev1.ProbeHandler {
71
99
HTTPGet : & corev1.HTTPGetAction {
0 commit comments