-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changing the default port of the embedded server does not change the K8S probes default port #2832
Comments
Hello, |
@arsenalzp : Please see my comment #2800 (comment) for some code pointers related to this issue. If you need more help, please don't hesitate to ping me. |
The issue is that the call However, It is still possible to get however there is |
@arsenalzp : Hello, Sorry I was PTO last week.
You're configuring the generator (responsible for creating container images) but running server:
port: 8081 Do you have The expected behavior is to automatically detect Spring Boot Configuration and use that port. |
Hello, |
|
Last week and begging of the current one I was on vacations due to the Easter, so I will keep working on this issue with your permission. |
@arsenalzp : Please take your time and don't worry about the delay, there are no strict deadlines here. |
Thank you!
Spring Boot instance boots up with the right port defined in The issue is that Why is that? That's because URLs to look for are Upd. and it is working! |
Here is the bug affected version. Checking paths: The full list of paths defined in
So, as you might see there are no |
Are you able to see I see this behavior. When I don't run When I do |
Hello, Otherwise, if command P.S. |
The problem is that some projects perform filtering and transformation on src resources, that's why JKube considers the final classes, resources and artifacts as processed by the compile (and others) lifecycle goals. It's also strange (in my opinion) that you want to generate the deployment file from the sources instead of the compiled files. Regarding the issue itself, I'm not sure if this issue is also related to #2665 |
Thank you for your feedback, it is very appreciated. |
As I see it: Having a fallback to read resources from additional places might be an improvement to the user experience.
From my perspective, unless there's some specific scenario where this is providing a real benefit and we can overcome the aforementioned issues, then we should do it. Otherwise, the only thing we can try to consider is providing extra-information about how the exposed port was inferred to help users that run into your same problem. |
We can allow user to set up resource directory to consume resources from custom path (within project context dir, of course) by using configuration section for particular plugin in pom.xml. Anyway, working on this issue was very good experience for me to deep dive into this great project! Decision is up to you, guys |
It's the default for Maven and usually for Gradle. However, you can define multiple resource directories, rename this directory (don't use its default location), add filtering capabilities, and so on. For example, in Maven, the Apache Maven Resources Plugin is responsible for all this (https://maven.apache.org/plugins/maven-resources-plugin/). IMO the only thing we can do is try to add a helpful or debug message stating where/how was the application port inferred from, probably at the Generator level (will very likely require changes for each supported framework). |
Agree with you. |
@manusa hello, How output does look like now:
|
@arsenalzp : Hello, I'm assuming you're running this in
This warning is coming from GitEnricher when JKube tries to add git annotations to generated Kubernetes manifests: jkube/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/GitEnricher.java Line 59 in a621561
Somehow in your case gitRemoteUrl is coming as null
|
Hello,
|
@arsenalzp : Is it possible for you to set a breakpoint in GitEnricher and run |
I'm doing exact the same. Here is snapshot of code state: The warning is showing up because the remote repository is named differently than code is looking for.
Once it was renamed to |
Hello colleagues, |
@arsenalzp : Thanks for taking time to look into this! I now understand that you're getting the error due to your remote name jkube/jkube-kit/enricher/generic/src/main/java/org/eclipse/jkube/enricher/generic/GitEnricher.java Lines 107 to 110 in 78a7989
|
Yes, it was fixed, thank you! |
@arsenalzp : I think it's okay to create a draft PR so that the team can also check. |
Could this PR #2880 be converted to draft one? What was done:
|
@arsenalzp : I'll try to check your PR later today. |
Discussed in #2826
Originally posted by waynemorphic March 16, 2024
I was checking out the Spring Boot Quickstart provided under the Maven package and found something peculiar that I would like a little help with. The default port of the embedded server is 8080. However, I changed it to 8081 under
resources\application.yaml
with the configuration:This follows that, building the Spring Boot application with
mvn spring-boot:run
serves the application on Tomcat's port 8081.However, when running the command that creates K8S resources descriptors, i.e
mvn clean k8s:resource -Pkubernetes
, then there is a discrepancy between the ports:What I have tried so far with the invaluable help of @rohanKanojia was adding the following property in my POM file:
However, the above port discrepancy persists. Guidance on this will be helpful. Thank you
The text was updated successfully, but these errors were encountered: