diff --git a/generators/base-workspaces/internal/docker-base.mjs b/generators/base-workspaces/internal/docker-base.mjs index eaf04b6c7e2d..7e79ba97f7ed 100644 --- a/generators/base-workspaces/internal/docker-base.mjs +++ b/generators/base-workspaces/internal/docker-base.mjs @@ -62,7 +62,7 @@ export function checkImages() { */ export function generateJwtSecret() { if (this.jwtSecretKey === undefined) { - this.jwtSecretKey = createBase64Secret(this.options.reproducibleTests); + this.jwtSecretKey = this.jhipsterConfig.jwtSecretKey = createBase64Secret(this.options.reproducibleTests); } } @@ -136,26 +136,15 @@ export function loadFromYoRc() { this.useMemcached = false; this.useRedis = false; - // Current implementation loads appsFolders into defaultAppsFolders - this.defaultAppsFolders = this.appsFolders; - delete this.appsFolders; - - if (this.defaultAppsFolders !== undefined) { - this.log.log('\nFound .yo-rc.json config file...'); + loadConfigs.call(this); + if (this.microserviceNb > 0 || this.gatewayNb > 0) { + this.deploymentApplicationType = MICROSERVICE; + } else { + this.deploymentApplicationType = MONOLITH; } - - if (this.regenerate) { - this.appsFolders = this.defaultAppsFolders; - loadConfigs.call(this); - if (this.microserviceNb > 0 || this.gatewayNb > 0) { - this.deploymentApplicationType = MICROSERVICE; - } else { - this.deploymentApplicationType = MONOLITH; - } - setClusteredApps.call(this); - if (!this.adminPassword) { - this.adminPassword = 'admin'; // TODO find a better way to do this - this.adminPasswordBase64 = convertSecretToBase64(this.adminPassword); - } + setClusteredApps.call(this); + if (!this.adminPassword) { + this.adminPassword = 'admin'; // TODO find a better way to do this + this.adminPasswordBase64 = convertSecretToBase64(this.adminPassword); } } diff --git a/generators/base-workspaces/internal/docker-prompts.mjs b/generators/base-workspaces/internal/docker-prompts.mjs index 4ce25e5f7270..fe34119b426c 100644 --- a/generators/base-workspaces/internal/docker-prompts.mjs +++ b/generators/base-workspaces/internal/docker-prompts.mjs @@ -28,9 +28,8 @@ const { PROMETHEUS } = monitoringTypes; const monitoring = monitoringTypes; const NO_MONITORING = monitoring.NO; -const { CONSUL, EUREKA } = serviceDiscoveryTypes; +const { CONSUL, EUREKA, NO: NO_SERVICE_DISCOVERY } = serviceDiscoveryTypes; -const NO_SERVICE_DISCOVERY = serviceDiscoveryTypes.NO; export default { askForApplicationType, askForGatewayType, @@ -49,7 +48,7 @@ export default { * Ask For Application Type */ async function askForApplicationType() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { @@ -78,7 +77,7 @@ async function askForApplicationType() { * Ask For Gateway Type */ async function askForGatewayType() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; if (this.deploymentApplicationType !== MICROSERVICE) return; const prompts = [ @@ -104,7 +103,7 @@ async function askForGatewayType() { * Ask For Path */ async function askForPath() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const deploymentApplicationType = this.deploymentApplicationType; let messageAskForPath; @@ -158,7 +157,7 @@ async function askForPath() { * Ask For Apps */ async function askForApps() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const messageAskForApps = 'Which applications do you want to include in your configuration?'; @@ -168,7 +167,7 @@ async function askForApps() { name: 'chosenApps', message: messageAskForApps, choices: this.appsFolders ?? [], - default: this.defaultAppsFolders, + default: this.jhipsterConfig.appsFolders, validate: input => (input.length === 0 ? 'Please choose at least one application' : true), }, ]; @@ -182,7 +181,7 @@ async function askForApps() { * Ask For Clusters Mode */ async function askForClustersMode() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const clusteredDbApps = []; this.appConfigs.forEach((appConfig, index) => { @@ -210,7 +209,7 @@ async function askForClustersMode() { * Ask For Monitoring */ async function askForMonitoring() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { @@ -239,7 +238,7 @@ async function askForMonitoring() { * Ask For Service Discovery */ async function askForServiceDiscovery() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const serviceDiscoveryEnabledApps = []; this.appConfigs.forEach(appConfig => { @@ -252,15 +251,15 @@ async function askForServiceDiscovery() { }); if (serviceDiscoveryEnabledApps.length === 0) { - this.serviceDiscoveryType = false; + this.serviceDiscoveryType = this.jhipsterConfig.serviceDiscoveryType = NO_SERVICE_DISCOVERY; return; } if (serviceDiscoveryEnabledApps.every(app => app.serviceDiscoveryType === CONSUL)) { - this.serviceDiscoveryType = CONSUL; + this.serviceDiscoveryType = this.jhipsterConfig.serviceDiscoveryType = CONSUL; this.log.log(chalk.green('Consul detected as the service discovery and configuration provider used by your apps')); } else if (serviceDiscoveryEnabledApps.every(app => app.serviceDiscoveryType === EUREKA)) { - this.serviceDiscoveryType = EUREKA; + this.serviceDiscoveryType = this.jhipsterConfig.serviceDiscoveryType = EUREKA; this.log.log(chalk.green('JHipster registry detected as the service discovery and configuration provider used by your apps')); } else { this.log.warn( @@ -303,7 +302,8 @@ async function askForServiceDiscovery() { * Ask For Admin Password */ async function askForAdminPassword() { - if (this.regenerate || this.serviceDiscoveryType !== EUREKA) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; + if (this.serviceDiscoveryType !== EUREKA) return; const prompts = [ { @@ -324,7 +324,7 @@ async function askForAdminPassword() { * Ask For Docker Repository Name */ async function askForDockerRepositoryName() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { @@ -343,7 +343,7 @@ async function askForDockerRepositoryName() { * Ask For Docker Push Command */ async function askForDockerPushCommand() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { diff --git a/generators/kubernetes-helm/__snapshots__/kubernetes.helm.spec.mts.snap b/generators/kubernetes-helm/__snapshots__/kubernetes.helm.spec.mts.snap index 6db4c1b93b22..aec15ac6149c 100644 --- a/generators/kubernetes-helm/__snapshots__/kubernetes.helm.spec.mts.snap +++ b/generators/kubernetes-helm/__snapshots__/kubernetes.helm.spec.mts.snap @@ -7,18 +7,17 @@ exports[`generator - Kubernetes Helm Kafka application should match files snapsh "generator-jhipster": { "appsFolders": ["09-kafka"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "monolith", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", - "istio": false, + "ingressDomain": null, + "ingressType": null, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", "kubernetesServiceType": "LoadBalancer", "monitoring": "no", - "serviceDiscoveryType": false + "serviceDiscoveryType": "no" } } ", @@ -395,12 +394,12 @@ exports[`generator - Kubernetes Helm MySQL and PostgreSQL microservices without "generator-jhipster": { "appsFolders": ["02-mysql", "03-psql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -1282,7 +1281,6 @@ exports[`generator - Kubernetes Helm gateway and ingress should match files snap "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -1931,12 +1929,12 @@ exports[`generator - Kubernetes Helm gateway and mysql microservice should match "generator-jhipster": { "appsFolders": ["01-gateway", "02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -2743,16 +2741,16 @@ exports[`generator - Kubernetes Helm gateway with istio should match files snaps "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "ingressDomain": "example.com", + "ingressType": null, "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", + "kubernetesServiceType": null, "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -3629,7 +3627,8 @@ exports[`generator - Kubernetes Helm gateway, mysql, psql, mongodb, mariadb micr "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -5068,18 +5067,17 @@ exports[`generator - Kubernetes Helm monolith application should match files sna "generator-jhipster": { "appsFolders": ["08-monolith"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "monolith", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", - "istio": false, + "ingressDomain": null, + "ingressType": null, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", "kubernetesServiceType": "LoadBalancer", "monitoring": "no", - "serviceDiscoveryType": false + "serviceDiscoveryType": "no" } } ", @@ -5441,12 +5439,12 @@ exports[`generator - Kubernetes Helm mysql microservice with custom namespace an "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", @@ -8421,12 +8419,12 @@ exports[`generator - Kubernetes Helm mysql microservice with custom namespace sh "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", @@ -9054,12 +9052,12 @@ exports[`generator - Kubernetes Helm only gateway should match files snapshot 1` "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipsterrepository", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "jhipsternamespace", diff --git a/generators/kubernetes-helm/generator.mjs b/generators/kubernetes-helm/generator.mjs index b2658ecf56c1..ea224f59e845 100644 --- a/generators/kubernetes-helm/generator.mjs +++ b/generators/kubernetes-helm/generator.mjs @@ -25,12 +25,11 @@ import BaseWorkspacesGenerator from '../base-workspaces/index.mjs'; import prompts from '../kubernetes/prompts.mjs'; import { writeFiles } from './files.mjs'; import { GENERATOR_KUBERNETES_HELM } from '../generator-list.mjs'; -import { checkImages, generateJwtSecret, configureImageNames } from '../base-workspaces/internal/docker-base.mjs'; +import { checkImages, generateJwtSecret, configureImageNames, loadFromYoRc } from '../base-workspaces/internal/docker-base.mjs'; import { checkKubernetes, checkHelm, loadConfig, - saveConfig, setupKubernetesConstants, setupHelmConstants, derivedKubernetesPlatformProperties, @@ -62,6 +61,9 @@ export default class KubernetesHelmGenerator extends BaseWorkspacesGenerator { this.log.log(chalk.white(`${chalk.bold('⎈')} Welcome to the JHipster Kubernetes Helm Generator ${chalk.bold('⎈')}`)); this.log.log(chalk.white(`Files will be generated in folder: ${chalk.yellow(this.destinationRoot())}`)); }, + existingDeployment() { + this.regenerate = this.regenerate || this.config.existed; + }, loadDockerDependenciesTask, checkDocker, checkKubernetes, @@ -105,20 +107,7 @@ export default class KubernetesHelmGenerator extends BaseWorkspacesGenerator { statistics.sendSubGenEvent('generator', GENERATOR_KUBERNETES_HELM); }, - checkImages, generateJwtSecret, - configureImageNames, - - setPostPromptProp() { - this.appConfigs.forEach(element => { - element.clusteredDb ? (element.dbPeerCount = 3) : (element.dbPeerCount = 1); - if (element.messageBroker === KAFKA) { - this.useKafka = true; - } - }); - this.useKeycloak = false; - }, - saveConfig, }; } @@ -128,6 +117,7 @@ export default class KubernetesHelmGenerator extends BaseWorkspacesGenerator { get loading() { return { + loadFromYoRc, loadSharedConfig() { this.appConfigs.forEach(element => { loadDerivedAppConfig({ application: element }); @@ -143,6 +133,26 @@ export default class KubernetesHelmGenerator extends BaseWorkspacesGenerator { return this.delegateTasksToBlueprint(() => this.loading); } + get preparing() { + return { + configureImageNames, + + setPostPromptProp() { + this.appConfigs.forEach(element => { + element.clusteredDb ? (element.dbPeerCount = 3) : (element.dbPeerCount = 1); + if (element.messageBroker === KAFKA) { + this.useKafka = true; + } + }); + this.useKeycloak = false; + }, + }; + } + + get [BaseWorkspacesGenerator.PREPARING]() { + return this.delegateTasksToBlueprint(() => this.preparing); + } + get writing() { return writeFiles(); } @@ -153,6 +163,7 @@ export default class KubernetesHelmGenerator extends BaseWorkspacesGenerator { get end() { return { + checkImages, deploy() { if (this.hasWarning) { this.log.warn('Helm configuration generated, but no Jib cache found'); diff --git a/generators/kubernetes-helm/kubernetes.helm.spec.mts b/generators/kubernetes-helm/kubernetes.helm.spec.mts index 0233ac021fb3..07e3c5a1ab65 100644 --- a/generators/kubernetes-helm/kubernetes.helm.spec.mts +++ b/generators/kubernetes-helm/kubernetes.helm.spec.mts @@ -84,6 +84,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -126,6 +129,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -170,6 +176,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -214,6 +223,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -263,6 +275,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -312,6 +327,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -370,6 +388,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'monolith', directoryPath: './', @@ -410,6 +431,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'monolith', directoryPath: './', @@ -449,6 +473,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -496,6 +523,9 @@ describe('generator - Kubernetes Helm', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_HELM)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', diff --git a/generators/kubernetes-knative/__snapshots__/knative.spec.mts.snap b/generators/kubernetes-knative/__snapshots__/knative.spec.mts.snap index 05c58712de81..62d83956f329 100644 --- a/generators/kubernetes-knative/__snapshots__/knative.spec.mts.snap +++ b/generators/kubernetes-knative/__snapshots__/knative.spec.mts.snap @@ -7,16 +7,13 @@ exports[`generator - Knative Using Helm generator type MySQL and PostgreSQL micr "generator-jhipster": { "appsFolders": ["02-mysql", "03-psql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -1076,16 +1073,13 @@ exports[`generator - Knative Using Helm generator type gateway and ingress shoul "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "example.com", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -1901,16 +1895,13 @@ exports[`generator - Knative Using Helm generator type gateway and mysql microse "generator-jhipster": { "appsFolders": ["01-gateway", "02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -2939,16 +2930,13 @@ exports[`generator - Knative Using Helm generator type gateway with istio routin "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "example.com", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -3776,10 +3764,8 @@ exports[`generator - Knative Using Helm generator type gateway, mysql, psql, mon "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -5536,16 +5522,13 @@ exports[`generator - Knative Using Helm generator type mysql microservice with c "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", - "kubernetesServiceType": "LoadBalancer", "monitoring": "prometheus", "serviceDiscoveryType": "consul" } @@ -8714,16 +8697,13 @@ exports[`generator - Knative Using Helm generator type mysql microservice with c "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "helm", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -9495,16 +9475,13 @@ exports[`generator - Knative Using Helm generator type only gateway should match "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipsterrepository", "generatorType": "helm", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "jhipsternamespace", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -10329,16 +10306,13 @@ exports[`generator - Knative Using K8s generator type MySQL and PostgreSQL micro "generator-jhipster": { "appsFolders": ["02-mysql", "03-psql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -11320,16 +11294,13 @@ exports[`generator - Knative Using K8s generator type gateway and ingress should "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "example.com", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -12074,16 +12045,13 @@ exports[`generator - Knative Using K8s generator type gateway and mysql microser "generator-jhipster": { "appsFolders": ["01-gateway", "02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -13026,16 +12994,13 @@ exports[`generator - Knative Using K8s generator type gateway with istio routing "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "example.com", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -13793,10 +13758,8 @@ exports[`generator - Knative Using K8s generator type gateway, mysql, psql, mong "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -15923,16 +15886,13 @@ exports[`generator - Knative Using K8s generator type mysql microservice with cu "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", - "kubernetesServiceType": "LoadBalancer", "monitoring": "prometheus", "serviceDiscoveryType": "consul" } @@ -18613,7 +18573,7 @@ spec: - name: http port: 3000 targetPort: 3000 - type: + type: LoadBalancer selector: app: jhipster-grafana --- @@ -19324,16 +19284,13 @@ exports[`generator - Knative Using K8s generator type mysql microservice with cu "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "generatorType": "k8s", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } @@ -20033,16 +19990,13 @@ exports[`generator - Knative Using K8s generator type only gateway should match "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipsterrepository", "generatorType": "k8s", "ingressDomain": "", - "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "jhipsternamespace", - "kubernetesServiceType": "LoadBalancer", "monitoring": "no", "serviceDiscoveryType": "consul" } diff --git a/generators/kubernetes-knative/generator.mjs b/generators/kubernetes-knative/generator.mjs index cf15242a6e11..f1fdc1f46e3e 100644 --- a/generators/kubernetes-knative/generator.mjs +++ b/generators/kubernetes-knative/generator.mjs @@ -27,12 +27,11 @@ import BaseWorkspacesGenerator from '../base-workspaces/index.mjs'; import prompts from './prompts.mjs'; import { writeFiles } from './files.mjs'; import { GENERATOR_KUBERNETES_KNATIVE } from '../generator-list.mjs'; -import { checkImages, generateJwtSecret, configureImageNames } from '../base-workspaces/internal/docker-base.mjs'; +import { checkImages, generateJwtSecret, configureImageNames, loadFromYoRc } from '../base-workspaces/internal/docker-base.mjs'; import { checkHelm, checkKubernetes, loadConfig, - saveConfig, setupKubernetesConstants, setupHelmConstants, derivedKubernetesPlatformProperties, @@ -68,6 +67,9 @@ export default class KubernetesKnativeGenerator extends BaseWorkspacesGenerator this.log.log(chalk.white(`${chalk.bold('☸')} Welcome to the JHipster Kubernetes Knative Generator ${chalk.bold('☸')}`)); this.log.log(chalk.white(`Files will be generated in the folder: ${chalk.yellow(this.destinationRoot())}`)); }, + existingDeployment() { + this.regenerate = this.regenerate || this.config.existed; + }, loadDockerDependenciesTask, checkDocker, checkKubernetes, @@ -129,20 +131,7 @@ export default class KubernetesKnativeGenerator extends BaseWorkspacesGenerator statistics.sendSubGenEvent('generator', GENERATOR_KUBERNETES_KNATIVE); }, - checkImages, generateJwtSecret, - configureImageNames, - - setPostPromptProp() { - this.appConfigs.forEach(element => { - element.clusteredDb ? (element.dbPeerCount = 3) : (element.dbPeerCount = 1); - if (element.messageBroker === KAFKA) { - this.useKafka = true; - } - }); - this.useKeycloak = false; - }, - saveConfig, }; } @@ -152,6 +141,7 @@ export default class KubernetesKnativeGenerator extends BaseWorkspacesGenerator get loading() { return { + loadFromYoRc, loadSharedConfig() { this.appConfigs.forEach(element => { loadDerivedAppConfig({ application: element }); @@ -167,6 +157,26 @@ export default class KubernetesKnativeGenerator extends BaseWorkspacesGenerator return this.delegateTasksToBlueprint(() => this.loading); } + get preparing() { + return { + configureImageNames, + + setPostPromptProp() { + this.appConfigs.forEach(element => { + element.clusteredDb ? (element.dbPeerCount = 3) : (element.dbPeerCount = 1); + if (element.messageBroker === KAFKA) { + this.useKafka = true; + } + }); + this.useKeycloak = false; + }, + }; + } + + get [BaseWorkspacesGenerator.PREPARING]() { + return this.delegateTasksToBlueprint(() => this.preparing); + } + get writing() { return writeFiles(); } @@ -177,6 +187,7 @@ export default class KubernetesKnativeGenerator extends BaseWorkspacesGenerator get end() { return { + checkImages, deploy() { if (this.hasWarning) { this.log.warn('Kubernetes Knative configuration generated, but no Jib cache found'); diff --git a/generators/kubernetes-knative/knative.spec.mts b/generators/kubernetes-knative/knative.spec.mts index 57565bf592c8..47c2f9113241 100644 --- a/generators/kubernetes-knative/knative.spec.mts +++ b/generators/kubernetes-knative/knative.spec.mts @@ -110,6 +110,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -153,6 +156,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -196,6 +202,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -239,6 +248,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -280,6 +292,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -326,6 +341,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -381,6 +399,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -426,6 +447,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -471,6 +495,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -514,6 +541,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -559,6 +589,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -604,6 +637,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -652,6 +688,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -702,6 +741,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -761,6 +803,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -809,6 +854,9 @@ describe('generator - Knative', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES_KNATIVE)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', diff --git a/generators/kubernetes-knative/prompts.mjs b/generators/kubernetes-knative/prompts.mjs index a6a807688c08..46944de40d12 100644 --- a/generators/kubernetes-knative/prompts.mjs +++ b/generators/kubernetes-knative/prompts.mjs @@ -29,7 +29,7 @@ export default { }; async function askForGeneratorType() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { @@ -50,6 +50,6 @@ async function askForGeneratorType() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.generatorType = props.generatorType; } diff --git a/generators/kubernetes/__snapshots__/kubernetes.spec.mts.snap b/generators/kubernetes/__snapshots__/kubernetes.spec.mts.snap index 2eb11c26c0b2..3da61af33ce9 100644 --- a/generators/kubernetes/__snapshots__/kubernetes.spec.mts.snap +++ b/generators/kubernetes/__snapshots__/kubernetes.spec.mts.snap @@ -7,20 +7,19 @@ exports[`generator - Kubernetes Kafka application should match files snapshot 1` "generator-jhipster": { "appsFolders": ["09-kafka"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "monolith", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", - "istio": false, + "ingressDomain": null, + "ingressType": null, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", "kubernetesServiceType": "LoadBalancer", "kubernetesStorageClassName": "", "kubernetesUseDynamicStorage": true, "monitoring": "no", - "serviceDiscoveryType": false + "serviceDiscoveryType": "no" } } ", @@ -490,12 +489,12 @@ exports[`generator - Kubernetes MySQL and PostgreSQL microservices without gatew "generator-jhipster": { "appsFolders": ["02-mysql", "03-psql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -1448,7 +1447,6 @@ exports[`generator - Kubernetes gateway and ingress should match files snapshot "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -2138,7 +2136,6 @@ exports[`generator - Kubernetes gateway and ingressType gke should match files s "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -5664,7 +5661,6 @@ exports[`generator - Kubernetes gateway and ingressType nginx should match files "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -9102,12 +9098,12 @@ exports[`generator - Kubernetes gateway and mysql microservice should match file "generator-jhipster": { "appsFolders": ["01-gateway", "02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -9953,16 +9949,16 @@ exports[`generator - Kubernetes gateway with istio routing should match files sn "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", "ingressDomain": "example.com", + "ingressType": null, "istio": true, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", - "kubernetesServiceType": "LoadBalancer", + "kubernetesServiceType": null, "kubernetesStorageClassName": "", "kubernetesUseDynamicStorage": true, "monitoring": "no", @@ -10946,7 +10942,8 @@ exports[`generator - Kubernetes gateway, mysql, psql, mongodb, mariadb, mssql mi "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -12940,20 +12937,19 @@ exports[`generator - Kubernetes monolith application should match files snapshot "generator-jhipster": { "appsFolders": ["08-monolith"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "monolith", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", - "istio": false, + "ingressDomain": null, + "ingressType": null, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", "kubernetesServiceType": "LoadBalancer", "kubernetesStorageClassName": "", "kubernetesUseDynamicStorage": true, "monitoring": "no", - "serviceDiscoveryType": false + "serviceDiscoveryType": "no" } } ", @@ -13395,12 +13391,12 @@ exports[`generator - Kubernetes mysql microservice with custom namespace and jhi "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", @@ -16748,12 +16744,12 @@ exports[`generator - Kubernetes mysql microservice with custom namespace should "generator-jhipster": { "appsFolders": ["02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "mynamespace", @@ -17436,7 +17432,8 @@ exports[`generator - Kubernetes mysql, psql, mongodb, mariadb, mssql microservic "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipster", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "default", @@ -19430,12 +19427,12 @@ exports[`generator - Kubernetes only gateway should match files snapshot 1`] = ` "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "gateway", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipsterrepository", - "ingressDomain": "", + "ingressDomain": null, + "ingressType": null, "istio": false, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "jhipsternamespace", @@ -19587,6 +19584,8 @@ spec: value: jdbc:mysql://jhgate-mysql.jhipsternamespace.svc.cluster.local:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - name: SPRING_R2DBC_URL value: r2dbc:mysql://jhgate-mysql.jhipsternamespace.svc.cluster.local:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - name: MANAGEMENT_TRACING_BAGGAGE_REMOTE_FIELDS + value: "x-request-id,x-ot-span-context" - name: JAVA_OPTS value: " -Xmx256m -Xms256m" - name: SERVER_SHUTDOWN @@ -20103,13 +20102,12 @@ exports[`generator - Kubernetes only gateway with eureka should match files snap "adminPassword": "meetup", "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "monolith", "directoryPath": "./", "dockerPushCommand": "docker push", "dockerRepositoryName": "jhipsterrepository", - "ingressDomain": "", - "istio": false, + "ingressDomain": null, + "ingressType": null, "jwtSecretKey": "SECRET--50", "kubernetesNamespace": "jhipsternamespace", "kubernetesServiceType": "LoadBalancer", @@ -20285,6 +20283,8 @@ spec: value: jdbc:mysql://jhgate-mysql.jhipsternamespace.svc.cluster.local:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true - name: SPRING_R2DBC_URL value: r2dbc:mysql://jhgate-mysql.jhipsternamespace.svc.cluster.local:3306/jhgate?useUnicode=true&characterEncoding=utf8&useSSL=false&useLegacyDatetimeCode=false&createDatabaseIfNotExist=true + - name: MANAGEMENT_TRACING_BAGGAGE_REMOTE_FIELDS + value: "x-request-id,x-ot-span-context" - name: JAVA_OPTS value: " -Xmx256m -Xms256m" - name: SERVER_SHUTDOWN diff --git a/generators/kubernetes/generator.mjs b/generators/kubernetes/generator.mjs index 775831e0ae99..cd38933e2bbe 100644 --- a/generators/kubernetes/generator.mjs +++ b/generators/kubernetes/generator.mjs @@ -28,14 +28,8 @@ import { buildToolTypes, messageBrokerTypes } from '../../jdl/jhipster/index.mjs import { GENERATOR_KUBERNETES } from '../generator-list.mjs'; import statistics from '../statistics.mjs'; -import { checkImages, generateJwtSecret, configureImageNames } from '../base-workspaces/internal/docker-base.mjs'; -import { - checkKubernetes, - loadConfig, - saveConfig, - setupKubernetesConstants, - derivedKubernetesPlatformProperties, -} from './kubernetes-base.mjs'; +import { checkImages, generateJwtSecret, configureImageNames, loadFromYoRc } from '../base-workspaces/internal/docker-base.mjs'; +import { checkKubernetes, loadConfig, setupKubernetesConstants, derivedKubernetesPlatformProperties } from './kubernetes-base.mjs'; import { getJdbcUrl, getR2dbcUrl } from '../spring-data-relational/support/index.mjs'; import { loadDeploymentConfig, loadDockerDependenciesTask } from '../base-workspaces/internal/index.mjs'; import { checkDocker } from '../docker/support/index.mjs'; @@ -62,6 +56,9 @@ export default class KubernetesGenerator extends BaseWorkspacesGenerator { this.log.log(chalk.white(`${chalk.bold('⎈')} Welcome to the JHipster Kubernetes Generator ${chalk.bold('⎈')}`)); this.log.log(chalk.white(`Files will be generated in folder: ${chalk.yellow(this.destinationRoot())}`)); }, + existingDeployment() { + this.regenerate = this.regenerate || this.config.existed; + }, loadDockerDependenciesTask, checkDocker, checkKubernetes, @@ -105,22 +102,7 @@ export default class KubernetesGenerator extends BaseWorkspacesGenerator { statistics.sendSubGenEvent('generator', GENERATOR_KUBERNETES); }, - checkImages, generateJwtSecret, - configureImageNames, - - setPostPromptProp() { - this.appConfigs.forEach(element => { - element.clusteredDb ? (element.dbPeerCount = 3) : (element.dbPeerCount = 1); - if (element.messageBroker === KAFKA) { - this.useKafka = true; - } - }); - this.usesOauth2 = this.appConfigs.some(appConfig => appConfig.authenticationTypeOauth2); - this.usesIngress = this.kubernetesServiceType === 'Ingress'; - this.useKeycloak = this.usesOauth2 && this.usesIngress; - }, - saveConfig, }; } @@ -130,6 +112,7 @@ export default class KubernetesGenerator extends BaseWorkspacesGenerator { get loading() { return { + loadFromYoRc, loadSharedConfig() { this.appConfigs.forEach(element => { loadDerivedAppConfig({ application: element }); @@ -145,6 +128,28 @@ export default class KubernetesGenerator extends BaseWorkspacesGenerator { return this.delegateTasksToBlueprint(() => this.loading); } + get preparing() { + return { + configureImageNames, + + setPostPromptProp() { + this.appConfigs.forEach(element => { + element.clusteredDb ? (element.dbPeerCount = 3) : (element.dbPeerCount = 1); + if (element.messageBroker === KAFKA) { + this.useKafka = true; + } + }); + this.usesOauth2 = this.appConfigs.some(appConfig => appConfig.authenticationTypeOauth2); + this.usesIngress = this.kubernetesServiceType === 'Ingress'; + this.useKeycloak = this.usesOauth2 && this.usesIngress; + }, + }; + } + + get [BaseWorkspacesGenerator.PREPARING]() { + return this.delegateTasksToBlueprint(() => this.preparing); + } + get writing() { return writeFiles(); } @@ -155,6 +160,7 @@ export default class KubernetesGenerator extends BaseWorkspacesGenerator { get end() { return { + checkImages, deploy() { if (this.hasWarning) { this.log.warn(`${chalk.yellow.bold('WARNING!')} Kubernetes configuration generated, but no Jib cache found`); diff --git a/generators/kubernetes/kubernetes-base.mjs b/generators/kubernetes/kubernetes-base.mjs index 2fa5ac4a60ab..04dd4b84de01 100644 --- a/generators/kubernetes/kubernetes-base.mjs +++ b/generators/kubernetes/kubernetes-base.mjs @@ -86,15 +86,16 @@ export const checkHelm = runAsync(function () { export function loadConfig() { loadFromYoRc.call(this); - this.kubernetesNamespace = this.config.get('kubernetesNamespace'); - this.kubernetesServiceType = this.config.get('kubernetesServiceType'); - this.ingressType = this.config.get('ingressType'); - this.ingressDomain = this.config.get('ingressDomain'); - this.istio = this.config.get('istio'); + const kubernetesWithDefaults = _.defaults({}, this.jhipsterConfig, defaultKubernetesConfig); + this.kubernetesNamespace = kubernetesWithDefaults.kubernetesNamespace; + this.kubernetesServiceType = kubernetesWithDefaults.kubernetesServiceType; + this.ingressType = kubernetesWithDefaults.ingressType; + this.ingressDomain = kubernetesWithDefaults.ingressDomain; + this.istio = kubernetesWithDefaults.istio; this.dbRandomPassword = this.options.reproducibleTests ? 'SECRET-PASSWORD' : crypto.randomBytes(30).toString('hex'); - this.kubernetesUseDynamicStorage = this.config.get('kubernetesUseDynamicStorage'); - this.kubernetesStorageClassName = this.config.get('kubernetesStorageClassName'); - this.generatorType = this.config.get('generatorType'); + this.kubernetesUseDynamicStorage = kubernetesWithDefaults.kubernetesUseDynamicStorage; + this.kubernetesStorageClassName = kubernetesWithDefaults.kubernetesStorageClassName; + this.generatorType = kubernetesWithDefaults.generatorType; } export function saveConfig() { @@ -134,7 +135,7 @@ export function setupKubernetesConstants() { this.KUBERNETES_RBAC_API_VERSION = KUBERNETES_RBAC_API_VERSION; } -export function derivedKubernetesPlatformProperties(dest = _.defaults({}, this, defaultKubernetesConfig)) { +export function derivedKubernetesPlatformProperties(dest = this) { dest.deploymentApplicationTypeMicroservice = dest.deploymentApplicationType === MICROSERVICE; dest.ingressTypeNginx = dest.ingressType === NGINX; dest.ingressTypeGke = dest.ingressType === GKE; diff --git a/generators/kubernetes/kubernetes.spec.mts b/generators/kubernetes/kubernetes.spec.mts index e7ae6bfff82a..bc7bdfcd2f03 100644 --- a/generators/kubernetes/kubernetes.spec.mts +++ b/generators/kubernetes/kubernetes.spec.mts @@ -56,6 +56,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'gateway', directoryPath: './', @@ -101,6 +104,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ directoryPath: './', chosenApps, @@ -145,6 +151,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -189,6 +198,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -233,6 +245,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -277,6 +292,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -328,6 +346,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -378,6 +399,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -425,6 +449,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -481,6 +508,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'monolith', directoryPath: './', @@ -523,6 +553,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'monolith', directoryPath: './', @@ -565,6 +598,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -611,6 +647,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -655,6 +694,9 @@ describe('generator - Kubernetes', () => { runResult = await runResult .create(getGenerator(GENERATOR_KUBERNETES)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', diff --git a/generators/kubernetes/prompts.mjs b/generators/kubernetes/prompts.mjs index e96d8295cbcf..d2052de51f61 100644 --- a/generators/kubernetes/prompts.mjs +++ b/generators/kubernetes/prompts.mjs @@ -40,7 +40,7 @@ export default { }; export async function askForKubernetesNamespace() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { @@ -51,12 +51,12 @@ export async function askForKubernetesNamespace() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.kubernetesNamespace = props.kubernetesNamespace; } export async function askForKubernetesServiceType() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const istio = this.istio; @@ -84,12 +84,12 @@ export async function askForKubernetesServiceType() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.kubernetesServiceType = props.kubernetesServiceType; } export async function askForIngressType() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const kubernetesServiceType = this.kubernetesServiceType; const prompts = [ @@ -112,12 +112,12 @@ export async function askForIngressType() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.ingressType = props.ingressType; } export async function askForIngressDomain() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const kubernetesServiceType = this.kubernetesServiceType; const istio = this.istio; this.ingressDomain = this.ingressDomain && this.ingressDomain.startsWith('.') ? this.ingressDomain.substring(1) : this.ingressDomain; @@ -177,7 +177,7 @@ export async function askForIngressDomain() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); if (props.ingressDomain === 'none') { this.ingressDomain = ''; } else { @@ -186,7 +186,7 @@ export async function askForIngressDomain() { } export async function askForIstioSupport() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; if (this.deploymentApplicationType === MONOLITH) { this.istio = false; return; @@ -211,12 +211,12 @@ export async function askForIstioSupport() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.istio = props.istio; } export async function askForPersistentStorage() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; let usingDataBase = false; this.appConfigs.forEach(appConfig => { if (appConfig.prodDatabaseType !== NO_DATABASE) { @@ -244,12 +244,12 @@ export async function askForPersistentStorage() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.kubernetesUseDynamicStorage = props.kubernetesUseDynamicStorage; } export async function askForStorageClassName() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const kubernetesUseDynamicStorage = this.kubernetesUseDynamicStorage; const prompts = [ @@ -262,7 +262,7 @@ export async function askForStorageClassName() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); // Add the StorageClass value only if dynamic storage is enabled if (kubernetesUseDynamicStorage) { this.kubernetesStorageClassName = props.kubernetesStorageClassName.trim(); diff --git a/generators/kubernetes/templates/README-KUBERNETES.md.ejs b/generators/kubernetes/templates/README-KUBERNETES.md.ejs index cd04682c037a..8e66484051b3 100644 --- a/generators/kubernetes/templates/README-KUBERNETES.md.ejs +++ b/generators/kubernetes/templates/README-KUBERNETES.md.ejs @@ -94,7 +94,7 @@ kubectl get svc jhipster-grafana<%= kubernetesNamespaceDefault ? '' : ` -n ${kub <%_ } _%> -<%_ if (app.serviceDiscoveryEureka) { _%> +<%_ if (serviceDiscoveryEureka) { _%> ## JHipster Registry The registry is deployed using a headless service in Kubernetes, so the primary service has no IP address, and cannot get a node port. You can create a secondary service for any type, using: diff --git a/generators/openshift/__snapshots__/openshift.spec.mts.snap b/generators/openshift/__snapshots__/openshift.spec.mts.snap index 6066e2f3b5a1..f09b99c18df3 100644 --- a/generators/openshift/__snapshots__/openshift.spec.mts.snap +++ b/generators/openshift/__snapshots__/openshift.spec.mts.snap @@ -7,7 +7,6 @@ exports[`generator - OpenShift gateway and one microservice with mysql should ma "generator-jhipster": { "appsFolders": ["01-gateway", "02-mysql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -15,7 +14,6 @@ exports[`generator - OpenShift gateway and one microservice with mysql should ma "jwtSecretKey": "SECRET--50", "monitoring": "no", "openshiftNamespace": "default", - "registryReplicas": 2, "serviceDiscoveryType": "consul", "storageType": "ephemeral" } @@ -1030,7 +1028,6 @@ exports[`generator - OpenShift gateway with multiple microservices backed by mys "07-mariadb" ], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -1038,7 +1035,6 @@ exports[`generator - OpenShift gateway with multiple microservices backed by mys "jwtSecretKey": "SECRET--50", "monitoring": "no", "openshiftNamespace": "default", - "registryReplicas": 2, "serviceDiscoveryType": "consul", "storageType": "ephemeral" } @@ -3366,7 +3362,6 @@ exports[`generator - OpenShift monolith application should match files snapshot "generator-jhipster": { "appsFolders": ["08-monolith"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "monolith", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -3374,8 +3369,7 @@ exports[`generator - OpenShift monolith application should match files snapshot "jwtSecretKey": "SECRET--50", "monitoring": "no", "openshiftNamespace": "default", - "registryReplicas": 2, - "serviceDiscoveryType": false, + "serviceDiscoveryType": "no", "storageType": "ephemeral" } } @@ -3887,7 +3881,6 @@ exports[`generator - OpenShift only gateway should match files snapshot 1`] = ` "generator-jhipster": { "appsFolders": ["01-gateway"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -3895,7 +3888,6 @@ exports[`generator - OpenShift only gateway should match files snapshot 1`] = ` "jwtSecretKey": "SECRET--50", "monitoring": "no", "openshiftNamespace": "default", - "registryReplicas": 2, "serviceDiscoveryType": "consul", "storageType": "ephemeral" } @@ -4583,7 +4575,6 @@ exports[`generator - OpenShift two microservices backed by mysql and postgres wi "generator-jhipster": { "appsFolders": ["02-mysql", "03-psql"], "baseName": "workspaces", - "clusteredDbApps": [], "deploymentApplicationType": "microservice", "directoryPath": "./", "dockerPushCommand": "docker push", @@ -4591,7 +4582,6 @@ exports[`generator - OpenShift two microservices backed by mysql and postgres wi "jwtSecretKey": "SECRET--50", "monitoring": "no", "openshiftNamespace": "default", - "registryReplicas": 2, "serviceDiscoveryType": "consul", "storageType": "ephemeral" } diff --git a/generators/openshift/generator.mjs b/generators/openshift/generator.mjs index 170c9df90936..f8f38372334a 100644 --- a/generators/openshift/generator.mjs +++ b/generators/openshift/generator.mjs @@ -80,6 +80,9 @@ export default class OpenshiftGenerator extends BaseWorkspacesGenerator { ), ); }, + existingDeployment() { + this.regenerate = this.regenerate || this.config.existed; + }, loadDockerDependenciesTask, checkDocker, checkOpenShift: runAsync(function () { @@ -138,40 +141,7 @@ export default class OpenshiftGenerator extends BaseWorkspacesGenerator { statistics.sendSubGenEvent('generator', GENERATOR_OPENSHIFT); }, - checkImages, generateJwtSecret, - configureImageNames, - - // place holder for future changes (may be prompt or something else) - setRegistryReplicas() { - this.registryReplicas = 2; - }, - - setPostPromptProp() { - this.appConfigs.some(element => { - if (element.messageBroker === KAFKA) { - this.useKafka = true; - return true; - } - return false; - }); - }, - - saveConfig() { - this.config.set({ - appsFolders: this.appsFolders, - directoryPath: this.directoryPath, - clusteredDbApps: this.clusteredDbApps, - serviceDiscoveryType: this.serviceDiscoveryType, - monitoring: this.monitoring, - jwtSecretKey: this.jwtSecretKey, - dockerRepositoryName: this.dockerRepositoryName, - dockerPushCommand: this.dockerPushCommand, - openshiftNamespace: this.openshiftNamespace, - storageType: this.storageType, - registryReplicas: this.registryReplicas, - }); - }, }; } @@ -181,6 +151,12 @@ export default class OpenshiftGenerator extends BaseWorkspacesGenerator { get loading() { return { + loadFromYoRc, + loadConfig() { + this.openshiftNamespace = this.config.get('openshiftNamespace'); + this.storageType = this.config.get('storageType'); + this.registryReplicas = this.config.get('registryReplicas'); + }, loadSharedConfig() { this.appConfigs.forEach(element => { loadDerivedAppConfig({ application: element }); @@ -196,6 +172,31 @@ export default class OpenshiftGenerator extends BaseWorkspacesGenerator { return this.delegateTasksToBlueprint(() => this.loading); } + get preparing() { + return { + configureImageNames, + + // place holder for future changes (may be prompt or something else) + setRegistryReplicas() { + this.registryReplicas = 2; + }, + + setPostPromptProp() { + this.appConfigs.some(element => { + if (element.messageBroker === KAFKA) { + this.useKafka = true; + return true; + } + return false; + }); + }, + }; + } + + get [BaseWorkspacesGenerator.PREPARING]() { + return this.delegateTasksToBlueprint(() => this.preparing); + } + get writing() { return writeFiles(); } @@ -206,6 +207,7 @@ export default class OpenshiftGenerator extends BaseWorkspacesGenerator { get end() { return { + checkImages, displayOpenshiftDeploymentProcedure() { if (this.hasWarning) { this.log.warn('OpenShift configuration generated, but no Jib cache found'); diff --git a/generators/openshift/openshift.spec.mts b/generators/openshift/openshift.spec.mts index 59ce904b5f18..8eea6fa2956f 100644 --- a/generators/openshift/openshift.spec.mts +++ b/generators/openshift/openshift.spec.mts @@ -33,6 +33,9 @@ describe('generator - OpenShift', () => { runResult = await runResult .create(getGenerator(GENERATOR_OPENSHIFT)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -73,6 +76,9 @@ describe('generator - OpenShift', () => { runResult = await runResult .create(getGenerator(GENERATOR_OPENSHIFT)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -113,6 +119,9 @@ describe('generator - OpenShift', () => { runResult = await runResult .create(getGenerator(GENERATOR_OPENSHIFT)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -156,6 +165,9 @@ describe('generator - OpenShift', () => { runResult = await runResult .create(getGenerator(GENERATOR_OPENSHIFT)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'microservice', directoryPath: './', @@ -207,6 +219,9 @@ describe('generator - OpenShift', () => { runResult = await runResult .create(getGenerator(GENERATOR_OPENSHIFT)) + .withOptions({ + askAnswered: true, + }) .withAnswers({ deploymentApplicationType: 'monolith', directoryPath: './', diff --git a/generators/openshift/prompts.mjs b/generators/openshift/prompts.mjs index 10e787d417cb..913ad8e74094 100644 --- a/generators/openshift/prompts.mjs +++ b/generators/openshift/prompts.mjs @@ -34,7 +34,7 @@ export default { }; export async function askForOpenShiftNamespace() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; const prompts = [ { @@ -45,12 +45,12 @@ export async function askForOpenShiftNamespace() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.openshiftNamespace = props.openshiftNamespace; } export async function askForStorageType() { - if (this.regenerate) return; + if (!this.options.askAnswered && (this.regenerate || this.config.existed)) return; let storageEnabled = false; this.appConfigs.some(appConfig => { @@ -85,6 +85,6 @@ export async function askForStorageType() { }, ]; - const props = await this.prompt(prompts); + const props = await this.prompt(prompts, this.config); this.storageType = props.storageType; } diff --git a/test-integration/jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl b/test-integration/jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl index 4855e1387e10..4ee3ae348226 100644 --- a/test-integration/jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl +++ b/test-integration/jdl-samples/mf-ng-eureka-jwt-psql-ehcache/blog-store.jdl @@ -169,3 +169,11 @@ deployment { monitoring no serviceDiscoveryType eureka } + +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType eureka +} diff --git a/test-integration/jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl b/test-integration/jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl index 428d94c1f00e..ac804fa9a70a 100644 --- a/test-integration/jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl +++ b/test-integration/jdl-samples/ms-mf-ng-consul-oauth2-neo4j/blog-store.jdl @@ -163,3 +163,11 @@ deployment { monitoring no serviceDiscoveryType consul } + +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType consul +} diff --git a/test-integration/jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl b/test-integration/jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl index 706d6934da60..c92afd7a33d5 100644 --- a/test-integration/jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl +++ b/test-integration/jdl-samples/ms-mf-react-eureka-oauth2-mariadb-infinispan/blog-store.jdl @@ -163,3 +163,11 @@ deployment { monitoring no serviceDiscoveryType eureka } + +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType eureka +} diff --git a/test-integration/jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl b/test-integration/jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl index 77c6164b2464..82529e4e429b 100644 --- a/test-integration/jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl +++ b/test-integration/jdl-samples/ms-mf-vue-consul-oauth2-mysql-memcached/blog-store.jdl @@ -162,3 +162,11 @@ deployment { monitoring no serviceDiscoveryType consul } + +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType consul +} diff --git a/test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl b/test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl index 819349b9f51e..72e1682605ee 100644 --- a/test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl +++ b/test-integration/jdl-samples/ms-ng-consul-oauth2-mongodb-caffeine/blog-store.jdl @@ -163,3 +163,11 @@ deployment { monitoring no serviceDiscoveryType consul } + +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType consul +} diff --git a/test-integration/jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl b/test-integration/jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl index f6b17db7394a..6b6db1c9135b 100644 --- a/test-integration/jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl +++ b/test-integration/jdl-samples/ms-react-consul-jwt-cassandra-redis/blog-store.jdl @@ -166,3 +166,13 @@ deployment { monitoring no serviceDiscoveryType consul } + +/* kubernetes is missing cassandra templates +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType consul +} +*/ diff --git a/test-integration/jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl b/test-integration/jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl index 27f99166b843..6379c6421efb 100644 --- a/test-integration/jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl +++ b/test-integration/jdl-samples/ms-vue-eureka-jwt-couchbase-hazelcast/blog-store.jdl @@ -158,3 +158,11 @@ deployment { monitoring no serviceDiscoveryType eureka } + +deployment { + deploymentType kubernetes, + appsFolders [gateway, store, blog, notification] + dockerRepositoryName "hipsterslabs" + monitoring no + serviceDiscoveryType eureka +}