348348 v-model =" security.vulnerabilityScans"
349349 label =" Enable Trivy vulnerabfility scans"
350350 color =" primary"
351- inset
352351 ></v-switch >
353352 </v-col >
354353 <v-col
359358 v-model =" buildpack.run.securityContext.readOnlyRootFilesystem"
360359 label =" Read only root filesystem"
361360 color =" primary"
362- inset
363361 ></v-switch >
364362 </v-col >
365363 </v-row >
373371 v-model =" buildpack.run.securityContext.allowPrivilegeEscalation"
374372 label =" Allow privilege escalation"
375373 color =" primary"
376- inset
377374 ></v-switch >
378375 </v-col >
379376 <v-col
384381 v-model =" buildpack.run.securityContext.runAsNonRoot"
385382 label =" Run as non root"
386383 color =" primary"
387- inset
388384 ></v-switch >
389385 </v-col >
390386 </v-row >
448444 </v-expansion-panel-content >
449445 </v-expansion-panel >
450446
447+
448+ <!-- NETWORKING -->
449+ <v-expansion-panel v-if =" advanced" >
450+ <v-expansion-panel-header class =" text-uppercase text-caption-2 font-weight-medium secondary" >Networking</v-expansion-panel-header >
451+ <v-expansion-panel-content class =" secondary" >
452+
453+ <v-row >
454+ <v-col
455+ cols =" 12"
456+ md =" 6"
457+ >
458+ <v-text-field
459+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/whitelist-source-range']"
460+ label =" Whitelist Source Range"
461+ ></v-text-field >
462+ </v-col >
463+ <v-col
464+ cols =" 12"
465+ md =" 6"
466+ >
467+ <v-text-field
468+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/denylist-source-range']"
469+ label =" Denylist Source Range"
470+ ></v-text-field >
471+ </v-col >
472+ </v-row >
473+
474+ <v-row >
475+ <v-col
476+ cols =" 12"
477+ md =" 6"
478+ >
479+ <v-switch
480+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/force-ssl-redirect']"
481+ label =" Force SSL Redirect"
482+ color =" primary"
483+ :disabled =" !ssl"
484+ ></v-switch >
485+ </v-col >
486+ <v-col
487+ cols =" 12"
488+ md =" 6"
489+ >
490+ <v-text-field
491+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/proxy-buffer-size']"
492+ label =" Proxy Buffer Size"
493+ ></v-text-field >
494+ </v-col >
495+ </v-row >
496+
497+ </v-expansion-panel-content >
498+ </v-expansion-panel >
499+
500+
501+ <!-- CORS -->
502+ <v-expansion-panel v-if =" advanced" >
503+ <v-expansion-panel-header class =" text-uppercase text-caption-2 font-weight-medium secondary" >Cors</v-expansion-panel-header >
504+ <v-expansion-panel-content class =" secondary" >
505+
506+ <v-row >
507+ <v-col
508+ cols =" 12"
509+ md =" 12"
510+ >
511+ <v-switch
512+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
513+ label =" Enable CORS"
514+ color =" primary"
515+ inset
516+ ></v-switch >
517+ </v-col >
518+ </v-row >
519+
520+ <v-row >
521+ <v-col
522+ cols =" 12"
523+ md =" 4"
524+ >
525+ <v-text-field
526+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/cors-allow-origin']"
527+ label =" CORS Allow Origin"
528+ :disabled =" !ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
529+ ></v-text-field >
530+ </v-col >
531+ <v-col
532+ cols =" 12"
533+ md =" 4"
534+ >
535+ <v-text-field
536+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/cors-allow-headers']"
537+ label =" CORS Allow Headers"
538+ :disabled =" !ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
539+ ></v-text-field >
540+ </v-col >
541+ <v-col
542+ cols =" 12"
543+ md =" 4"
544+ >
545+ <v-text-field
546+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/cors-expose-headers']"
547+ label =" CORS Expose Headers"
548+ :disabled =" !ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
549+ ></v-text-field >
550+ </v-col >
551+ </v-row >
552+
553+ <v-row >
554+ <v-col
555+ cols =" 12"
556+ md =" 4"
557+ >
558+ <v-switch
559+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/cors-allow-credentials']"
560+ label =" CORS Allow Credentials"
561+ color =" primary"
562+ :disabled =" !ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
563+ ></v-switch >
564+ </v-col >
565+ <v-col
566+ cols =" 12"
567+ md =" 4"
568+ >
569+ <v-text-field
570+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/cors-max-age']"
571+ label =" CORS Max Age"
572+ :disabled =" !ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
573+ ></v-text-field >
574+ </v-col >
575+ <v-col
576+ cols =" 12"
577+ md =" 4"
578+ >
579+ <v-text-field
580+ v-model =" ingress.annotations['nginx.ingress.kubernetes.io/cors-allow-methods']"
581+ label =" CORS Allow Methods"
582+ :disabled =" !ingress.annotations['nginx.ingress.kubernetes.io/enable-cors']"
583+ ></v-text-field >
584+ </v-col >
585+ </v-row >
586+
587+
588+
589+ </v-expansion-panel-content >
590+ </v-expansion-panel >
591+
451592 <!-- ENVIRONMENT VARS -->
452593 <v-expansion-panel >
453594 <v-expansion-panel-header class =" text-uppercase text-caption-2 font-weight-medium cardBackground" >Environment Variables</v-expansion-panel-header >
@@ -1023,6 +1164,21 @@ export default {
10231164 },
10241165 */
10251166 },
1167+ ingress: {
1168+ annotations: {
1169+ ' nginx.ingress.kubernetes.io/whitelist-source-range' : ' ' ,
1170+ ' nginx.ingress.kubernetes.io/denylist-source-range' : ' ' ,
1171+ ' nginx.ingress.kubernetes.io/force-ssl-redirect' : false ,
1172+ ' nginx.ingress.kubernetes.io/proxy-buffer-size' : ' 4k' ,
1173+ ' nginx.ingress.kubernetes.io/enable-cors' : false ,
1174+ ' nginx.ingress.kubernetes.io/cors-allow-origin' : ' *' ,
1175+ ' nginx.ingress.kubernetes.io/cors-allow-headers' : ' DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization' ,
1176+ ' nginx.ingress.kubernetes.io/cors-expose-headers' : ' *' ,
1177+ ' nginx.ingress.kubernetes.io/cors-allow-credentials' : true ,
1178+ ' nginx.ingress.kubernetes.io/cors-max-age' : ' 1728000' ,
1179+ ' nginx.ingress.kubernetes.io/cors-allow-methods' : ' GET, PUT, POST, DELETE, PATCH, OPTIONS' ,
1180+ },
1181+ },
10261182 capabilities: [
10271183 ' AUDIT_CONTROL' ,
10281184 ' AUDIT_READ' ,
@@ -1099,7 +1255,9 @@ export default {
10991255 this .loadStorageClasses ();
11001256 this .loadPodsizeList ();
11011257 this .loadBuildpacks ();
1102- this .loadApp (); // this may lead into a race condition with the buildpacks loaded in loadPipeline
1258+ if (this .app != ' new' ) {
1259+ this .loadApp (); // this may lead into a race condition with the buildpacks loaded in loadPipeline
1260+ }
11031261
11041262 if (this .$route .query .template ) {
11051263 this .loadTemplate (this .$route .query .catalogId , this .$route .query .template );
@@ -1313,9 +1471,54 @@ export default {
13131471 this .cronjobs = this .cronjobUnformat (response .data .spec .cronjobs ) || [];
13141472 this .addons = response .data .spec .addons || [];
13151473 this .security .vulnerabilityScans = response .data .spec .vulnerabilityscan .enabled ;
1474+ this .ingress = response .data .spec .ingress || {};
13161475 });
13171476 }
13181477 },
1478+ cleanupIngressAnnotations (){
1479+
1480+ if (this .ssl === false ) {
1481+ delete this .ingress .annotations [' cert-manager.io/cluster-issuer' ];
1482+ delete this .ingress .annotations [' kubernetes.io/tls-acme' ];
1483+ this .ingress .tls = [];
1484+ } else {
1485+ this .ingress .annotations [' cert-manager.io/cluster-issuer' ] = ' letsencrypt-prod' ;
1486+ this .ingress .annotations [' kubernetes.io/tls-acme' ] = ' true' ;
1487+ this .ingress .tls = [
1488+ {
1489+ hosts: [this .domain ],
1490+ secretName: this .appname + ' -tls' ,
1491+ },
1492+ ];
1493+ }
1494+
1495+ if (this .ingress .annotations [' nginx.ingress.kubernetes.io/whitelist-source-range' ] == ' ' ) {
1496+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/whitelist-source-range' ];
1497+ }
1498+
1499+ if (this .ingress .annotations [' nginx.ingress.kubernetes.io/denylist-source-range' ] == ' ' ) {
1500+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/denylist-source-range' ];
1501+ }
1502+
1503+ if (this .ingress .annotations [' nginx.ingress.kubernetes.io/force-ssl-redirect' ] == false ) {
1504+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/force-ssl-redirect' ];
1505+ }
1506+
1507+ if (this .ingress .annotations [' nginx.ingress.kubernetes.io/proxy-buffer-size' ] == ' 4k' ) {
1508+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/proxy-buffer-size' ];
1509+ }
1510+
1511+ if (this .ingress .annotations [' nginx.ingress.kubernetes.io/enable-cors' ] == false ) {
1512+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/enable-cors' ];
1513+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/cors-allow-origin' ];
1514+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/cors-allow-headers' ];
1515+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/cors-expose-headers' ];
1516+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/cors-allow-credentials' ];
1517+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/cors-max-age' ];
1518+ delete this .ingress .annotations [' nginx.ingress.kubernetes.io/cors-allow-methods' ];
1519+ }
1520+
1521+ },
13191522 updateApp () {
13201523
13211524 if (this .gitrepo .ssh_url == this .pipelineData .git .repository .ssh_url ) {
@@ -1329,6 +1532,8 @@ export default {
13291532 this .gitrepo .clone_url = this .gitrepo .ssh_url .replace (regex, " https://$2/$4$5" );
13301533 }
13311534
1535+ this .cleanupIngressAnnotations ();
1536+
13321537 let postdata = {
13331538 resourceVersion: this .resourceVersion ,
13341539 buildpack: this .buildpack ,
@@ -1373,7 +1578,7 @@ export default {
13731578 cronjobs: this .cronjobFormat (this .cronjobs ),
13741579 addons: this .addons ,
13751580 security: this .security ,
1376-
1581+ ingress : this . ingress ,
13771582 }
13781583/*
13791584 if (this.security.vulnerabilityScans) {
@@ -1437,6 +1642,8 @@ export default {
14371642 this .docker .tag = " v1"
14381643 }
14391644
1645+ this .cleanupIngressAnnotations ();
1646+
14401647 let postdata = {
14411648 pipeline: this .pipeline ,
14421649 buildpack: this .buildpack ,
@@ -1482,6 +1689,7 @@ export default {
14821689 cronjobs: this .cronjobFormat (this .cronjobs ),
14831690 addons: this .addons ,
14841691 security: this .security ,
1692+ ingress: this .ingress ,
14851693 }
14861694
14871695 if (postdata .image .run == undefined ) {
0 commit comments