@@ -57,15 +57,22 @@ function printInstallationOptionsSummary({
57
57
shouldExecutePipeline,
58
58
httpProxy,
59
59
httpsProxy,
60
+ appProxy,
61
+ appProxyHost,
60
62
} ) {
61
- console . log ( `\n${ colors . green ( 'Installation options summary:' ) }
63
+ let summary = `\n${ colors . green ( 'Installation options summary:' ) }
62
64
1. Kubernetes Context: ${ colors . cyan ( kubeContextName ) }
63
65
2. Kubernetes Namespace: ${ colors . cyan ( kubeNamespace ) }
64
66
3. Set this as default account runtime-environment: ${ colors . cyan ( ! ! shouldMakeDefaultRe ) }
65
67
4. Execute demo pipeline after install: ${ colors . cyan ( ! ! shouldExecutePipeline ) }
66
68
5. HTTP proxy: ${ httpProxy ? colors . cyan ( httpProxy ) : 'none' }
67
69
6. HTTPS proxy: ${ httpsProxy ? colors . cyan ( httpsProxy ) : 'none' }
68
- ` ) ;
70
+ ` ;
71
+
72
+ if ( appProxy ) {
73
+ summary += `7. App-Proxy hostname: ${ colors . cyan ( appProxyHost ) } \n` ;
74
+ }
75
+ console . log ( summary ) ;
69
76
}
70
77
71
78
const initCmd = new Command ( {
@@ -164,6 +171,14 @@ const initCmd = new Command({
164
171
describe : 'install app proxy component (default false)' ,
165
172
default : false ,
166
173
type : 'boolean' ,
174
+ } )
175
+ . option ( 'app-proxy-host' , {
176
+ describe : 'the hostname that will be used by the app-proxy ingress' ,
177
+ type : 'string' ,
178
+ } )
179
+ . option ( 'app-proxy-ingress-class' , {
180
+ describe : 'the ingress class that will be used by the app-proxy ingress' ,
181
+ type : 'string' ,
167
182
} ) ,
168
183
handler : async ( argv ) => {
169
184
let resumedInstallation = false ;
@@ -199,7 +214,7 @@ const initCmd = new Command({
199
214
'set-file' : setFile ,
200
215
'skip-cluster-test' : skipClusterTest ,
201
216
'docker-registry' : dockerRegistry ,
202
- 'app-proxy' : appProxy ,
217
+ 'app-proxy-ingress-class ' : appProxyIngressClass ,
203
218
} = _argv ;
204
219
let {
205
220
yes : noQuestions ,
@@ -213,6 +228,8 @@ const initCmd = new Command({
213
228
url,
214
229
token,
215
230
name,
231
+ 'app-proxy' : appProxy ,
232
+ 'app-proxy-host' : appProxyHost ,
216
233
'install-monitor' : installMonitor ,
217
234
} = _argv ;
218
235
@@ -240,6 +257,15 @@ const initCmd = new Command({
240
257
if ( typeof _ . get ( valuesObj , 'Monitor.Enabled' ) !== 'undefined' ) {
241
258
installMonitor = _ . get ( valuesObj , 'Monitor.Enabled' ) ;
242
259
}
260
+ if ( _ . get ( valuesObj , 'AppProxy' ) ) {
261
+ appProxy = true ;
262
+ }
263
+ if ( ! appProxyHost && _ . get ( valuesObj , 'AppProxy.Host' ) ) {
264
+ appProxyHost = _ . get ( valuesObj , 'AppProxy.Host' ) ;
265
+ }
266
+ if ( appProxy && ! appProxyHost ) {
267
+ handleError ( new Error ( 'no hostname provided' ) , 'cannot install app-proxy component without a hostname' , undefined , undefined , true ) ;
268
+ }
243
269
}
244
270
if ( ! url ) {
245
271
url = DEFAULTS . URL ;
@@ -296,7 +322,7 @@ const initCmd = new Command({
296
322
type : 'input' ,
297
323
name : 'httpProxy' ,
298
324
default : httpProxy ,
299
- message : 'HTTP proxy to be used by runner inside Kubernetes ?' ,
325
+ message : 'HTTP proxy to be used by runner inside Kubernetes?' ,
300
326
} ) ;
301
327
}
302
328
@@ -305,8 +331,17 @@ const initCmd = new Command({
305
331
type : 'input' ,
306
332
name : 'httpsProxy' ,
307
333
default : httpsProxy ,
308
- message : 'HTTPS proxy to be used by runner inside Kubernetes ?' ,
334
+ message : 'HTTPS proxy to be used by runner inside Kubernetes?' ,
335
+
336
+ } ) ;
337
+ }
309
338
339
+ if ( appProxy && ! appProxyHost ) {
340
+ // will only be asked if you want to install app-proxy but you give no host in the options
341
+ questions . push ( {
342
+ type : 'input' ,
343
+ name : 'appProxyHost' ,
344
+ message : 'The hostname that will be used by the app-proxy ingress' ,
310
345
} ) ;
311
346
}
312
347
@@ -343,7 +378,7 @@ const initCmd = new Command({
343
378
kubeNamespace = kubeNamespace || answers . namespace ;
344
379
shouldMakeDefaultRe = _ . isUndefined ( shouldMakeDefaultRe ) ? answers . shouldMakeDefaultRe : shouldMakeDefaultRe ;
345
380
shouldExecutePipeline = _ . isUndefined ( shouldExecutePipeline ) ? answers . shouldExecutePipeline : shouldExecutePipeline ;
346
- ( { httpProxy, httpsProxy } = answers ) ;
381
+ ( { httpProxy, httpsProxy, appProxyHost } = answers ) ;
347
382
}
348
383
349
384
printInstallationOptionsSummary ( {
@@ -353,6 +388,8 @@ const initCmd = new Command({
353
388
shouldExecutePipeline,
354
389
httpProxy,
355
390
httpsProxy,
391
+ appProxy,
392
+ appProxyHost,
356
393
} ) ;
357
394
358
395
if ( token ) {
@@ -402,6 +439,7 @@ const initCmd = new Command({
402
439
_argv [ 'set-default-runtime' ] = shouldMakeDefaultRe ;
403
440
_argv [ 'exec-demo-pipeline' ] = shouldExecutePipeline ;
404
441
_argv [ 'env-vars' ] = envVars ;
442
+ _argv [ 'app-proxy-host' ] = appProxyHost ;
405
443
installationPlan . addContext ( 'argv' , _argv ) ;
406
444
407
445
// run cluster acceptance tests
@@ -602,8 +640,10 @@ const initCmd = new Command({
602
640
verbose,
603
641
kubeConfigPath,
604
642
valuesFile,
643
+ appProxyHost,
644
+ appProxyIngressClass,
605
645
} ) ;
606
- installationPlan . addContext ( 'appProxyIP' , `http:// ${ appProxyIP } ` ) ;
646
+ installationPlan . addContext ( 'appProxyIP' , `${ appProxyIP } ` ) ;
607
647
} ,
608
648
installationEvent : installationProgress . events . APP_PROXY_INSTALLED ,
609
649
condition : ! ! appProxy ,
0 commit comments