jhipster / generator-jhipster

JHipster is a development platform to quickly generate, develop, & deploy modern web applications & microservice architectures.
https://www.jhipster.tech
Apache License 2.0
21.54k stars 4.02k forks source link

jhipster k8s generator not working #25149

Closed kernelogic closed 1 month ago

kernelogic commented 8 months ago
Overview of the issue

jhipster k8s command generates nothing

Motivation for or Use Case

I tried to deploy a monolith jhipster app I just created, to a configured Azure AKS, however after running jhipster k8s, it didn't ask my any question and doesn't seem generate all the files it needed.

Reproduce the error

"jhipster app" to create app "jhipster k8s" to generate k8s config "bash ./kubctl-apply.sh -f" to deploy this is the output

feiya200@Feis-M1-Pro azAKS2 % jhipster k8s         
WARNING! Since JHipster v8, the jhipster command will not use the locally installed generator-jhipster.
    If you want to execute the locally installed generator-jhipster, run: npx jhipster

        ██╗ ██╗   ██╗ ████████╗ ███████╗   ██████╗ ████████╗ ████████╗ ███████╗
        ██║ ██║   ██║ ╚══██╔══╝ ██╔═══██╗ ██╔════╝ ╚══██╔══╝ ██╔═════╝ ██╔═══██╗
        ██║ ████████║    ██║    ███████╔╝ ╚█████╗     ██║    ██████╗   ███████╔╝
  ██╗   ██║ ██╔═══██║    ██║    ██╔════╝   ╚═══██╗    ██║    ██╔═══╝   ██╔══██║
  ╚██████╔╝ ██║   ██║ ████████╗ ██║       ██████╔╝    ██║    ████████╗ ██║  ╚██╗
   ╚═════╝  ╚═╝   ╚═╝ ╚═══════╝ ╚═╝       ╚═════╝     ╚═╝    ╚═══════╝ ╚═╝   ╚═╝
                            https://www.jhipster.tech
Welcome to JHipster v8.1.0

⎈ Welcome to the JHipster Kubernetes Generator ⎈
Files will be generated in folder: /Users/feiya200/Downloads/azAKS2
INFO! Docker is installed
Client Version: v1.29.1
Kustomize Version: v5.0.4-0.20230601165947-6ce0bf390ce3
Server Version: v1.27.7
WARNING: version difference between client (1.29) and server (1.27) exceeds the supported minor version skew of +/-1
✔ applying multi-step templates
✔ prettier configuration files committed to disk
identical kubectl-apply.sh
identical K8S-README.md
identical kustomization.yml
identical skaffold.yml
✔ files committed to disk

No change to package.json was detected. No package manager install will be executed.

Checking Docker images in applications directories...
INFO! 
Kubernetes configuration successfully generated!
WARNING! 
You will need to push your image to a registry. If you have not done so, use the following commands to tag and push the images:

You can deploy all your apps by running the following kubectl command:
INFO!   bash kubectl-apply.sh -f

[OR]

If you want to use kustomize configuration, then run the following command:
INFO!   bash kubectl-apply.sh -k

Congratulations, JHipster execution is complete!
If you find JHipster useful consider sponsoring the project https://www.jhipster.tech/sponsors/

Thanks for using JHipster!

feiya200@Feis-M1-Pro azAKS2 % bash kubectl-apply.sh -f
Applying default `kubectl apply -f`
Related issues
Suggest a Fix
JHipster Version(s)

v8.1.0

JHipster configuration, a .yo-rc.json file generated in the root folder
.yo-rc.json file
{
  "generator-jhipster": {
    "applicationType": "monolith",
    "authenticationType": "jwt",
    "baseName": "azAks2",
    "buildTool": "maven",
    "cacheProvider": "redis",
    "clientFramework": "react",
    "clientTestFrameworks": [],
    "clientTheme": "none",
    "creationTimestamp": 1707463431628,
    "databaseType": "sql",
    "dbRandomPassword": "eb61f1a04c3bf8bd3a4f24cb24f9d4f9a5850a506d38025f5370e8b6618d",
    "devDatabaseType": "postgresql",
    "devServerPort": 9060,
    "enableGradleEnterprise": null,
    "enableHibernateCache": true,
    "enableSwaggerCodegen": false,
    "enableTranslation": true,
    "entities": [],
    "feignClient": false,
    "gradleEnterpriseHost": null,
    "jhipsterVersion": "8.1.0",
    "languages": [
      "en"
    ],
    "messageBroker": false,
    "microfrontend": null,
    "microfrontends": [],
    "monorepository": true,
    "nativeLanguage": "en",
    "packageName": "com.mycompany.myapp",
    "prodDatabaseType": "postgresql",
    "reactive": false,
    "searchEngine": false,
    "serverPort": null,
    "serverSideOptions": [],
    "serviceDiscoveryType": false,
    "skipCommitHook": true,
    "testFrameworks": [],
    "websocket": false,
    "withAdminUi": true
  }
}
Environment and Tools

openjdk version "21.0.2" 2024-01-16 LTS OpenJDK Runtime Environment Temurin-21.0.2+13 (build 21.0.2+13-LTS) OpenJDK 64-Bit Server VM Temurin-21.0.2+13 (build 21.0.2+13-LTS, mixed mode)

git version 2.39.3 (Apple Git-145)

node: v18.18.2 npm: 9.8.1

Docker version 25.0.2, build 29cf629

JDL for the Entity configuration(s) entityName.json files generated in the .jhipster directory
JDL entity definitions

Entity configuration(s) entityName.json files generated in the .jhipster directory
Browsers and Operating System

MacOS 14.3

kernelogic commented 8 months ago

Does the generator only works with micro-service, not monolith?

ender1975 commented 3 months ago

I'm experiencing the same issue with JHipster 8.6.0.

The sub-generator is supposed to ask what type of application we have (monolith vs microservce), so it should work with both and it used to work for me with JHipster v7.

Additionally, when I run the generator in the parent folder of my app, then it asks the questions, but when I give it the location of my monolith app, it fails saying it didn't find any monolith apps there.

mraible commented 1 month ago

I tried to reproduce this by cloning this repository and removing the kubernetes directory. Then, I created a new k8s directory, navigated into it, and ran jhipster kubernetes. It worked as expected with the 8.7.0 release.

Please reopen this issue if there is still a problem with the latest version.