@@ -6,6 +6,17 @@ import { Database } from './database';
6
6
import { Registry } from './registry' ;
7
7
import { importCluster } from './charts/cluster-utils' ;
8
8
9
+ var createNestedObject = function ( base : any , names : any , value : any ) {
10
+ var lastName = arguments . length === 3 ? names . pop ( ) : false ;
11
+ for ( var i = 0 ; i < names . length ; i ++ ) {
12
+ base = base [ names [ i ] ] = base [ names [ i ] ] || { } ;
13
+ }
14
+
15
+ if ( lastName ) {
16
+ base = base [ lastName ] = value ;
17
+ }
18
+ } ;
19
+
9
20
// TODO: switch to official gitpod.io build.
10
21
const version = "aledbf-mk3.29" ;
11
22
@@ -42,14 +53,22 @@ export class GitpodStack extends cdk.Stack {
42
53
43
54
replace ( / { { issuerName} } / g, 'ca-issuer' ) ;
44
55
56
+ const values = loadYaml ( doc ) ;
57
+ if ( process . env . IMAGE_PULL_SECRET ) {
58
+ createNestedObject ( values , [ "components" , "workspace" , "templates" , "default" , "spec" , "imagePullSecrets" ] , [ ] ) ;
59
+ createNestedObject ( values , [ "components" , "imageBuilderMk3" , "registry" ] , { } ) ;
60
+ values . components . workspace . templates . default . spec . imagePullSecrets . push ( { "name" : `${ process . env . IMAGE_PULL_SECRET } ` } ) ;
61
+ values . components . imageBuilderMk3 . registry . secretName = `${ process . env . IMAGE_PULL_SECRET } ` ;
62
+ }
63
+
45
64
const helmChart = cluster . addHelmChart ( 'GitpodChart' , {
46
65
chart : 'gitpod' ,
47
66
release : 'gitpod' ,
48
67
repository : 'https://aledbf.github.io/gitpod-chart-cleanup/' ,
49
68
namespace : 'default' ,
50
- version : '1.2.14 ' ,
69
+ version : '1.2.15 ' ,
51
70
wait : true ,
52
- values : loadYaml ( doc ) ,
71
+ values,
53
72
} ) ;
54
73
55
74
doc = readYamlDocument ( __dirname + '/charts/assets/ingress.yaml' ) ;
@@ -61,11 +80,19 @@ export class GitpodStack extends cdk.Stack {
61
80
manifest . metadata . annotations [ "alb.ingress.kubernetes.io/ssl-policy" ] = "ELBSecurityPolicy-FS-1-2-Res-2020-10" ;
62
81
}
63
82
83
+ manifest . metadata . annotations [ "alb.ingress.kubernetes.io/load-balancer-name" ] = `${ process . env . CLUSTER_NAME } -${ props . env ?. region } ` ;
84
+
64
85
// if we have a route53 zone ID, enable external-dns.
65
86
if ( process . env . ROUTE53_ZONEID ) {
66
87
manifest . metadata . annotations [ "external-dns.alpha.kubernetes.io/hostname" ] = `${ props . domain } , *.${ props . domain } , *.ws.${ props . domain } ` ;
67
88
}
68
89
90
+ if ( process . env . USE_INTERNAL_ALB && process . env . USE_INTERNAL_ALB . toLowerCase ( ) === 'true' ) {
91
+ manifest . metadata . annotations [ "alb.ingress.kubernetes.io/scheme" ] = 'internal' ;
92
+ } else {
93
+ manifest . metadata . annotations [ "alb.ingress.kubernetes.io/scheme" ] = 'internet-facing' ;
94
+ }
95
+
69
96
const gitpodIngress = new KubernetesManifest ( this , "gitpod-ingress" , {
70
97
cluster,
71
98
overwrite : true ,
0 commit comments