Skip to content
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

Should suggest to use jkube.domain if createExternalUrls is used without domain. #1439

Closed
sunix opened this issue Apr 8, 2022 · 2 comments · Fixed by #1980
Closed

Should suggest to use jkube.domain if createExternalUrls is used without domain. #1439

sunix opened this issue Apr 8, 2022 · 2 comments · Fixed by #1980
Assignees
Labels
Milestone

Comments

@sunix
Copy link
Member

sunix commented Apr 8, 2022

Description

I have recently been using jkube.createExternalUrls but forgot to set the domain. Would be nice to log a HINT message with the suggestion.

@sunix sunix added the UX label Apr 8, 2022
@rohanKanojia rohanKanojia self-assigned this Dec 27, 2022
rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Dec 27, 2022
…teExternalUrls` is used without domain (eclipse-jkube#1439)

Currently value for IngressRule's `.host` field depends either on `HOST`
enricher configuration or `jkube.domain` configuration. If none of these
options are provided, we set `.spec.defaultBackend`.

Add a hint to suggest specifying `jkube.domain` in case no value for
host is found.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
@rohanKanojia
Copy link
Member

rohanKanojia commented Dec 27, 2022

I've created PR #1980 to add this hint : No host configured for Ingress. You might want to use jkube.domain to add desired host suffix

However, I have a feeling that this hint might not be clearly visible. It might get lost in logs.

jkube-quarkus-ingress : $ mvn k8s:resource
[INFO] Scanning for projects...
[INFO] 
[INFO] ----------------< org.eclipse.jkube:test-jkube-ingress >----------------
[INFO] Building test-jkube-ingress 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- kubernetes-maven-plugin:1.11-SNAPSHOT:resource (default-cli) @ test-jkube-ingress ---
[INFO] k8s: Running generator quarkus
[INFO] k8s: quarkus: Using Docker image quay.io/jkube/jkube-java:0.0.17 as base / builder
[INFO] k8s: Using resource templates from /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/src/main/jkube
[INFO] k8s: jkube-service: Adding a default service 'test-jkube-ingress' with ports [8080]
[INFO] k8s: HINT: No host configured for Ingress. You might want to use `jkube.domain` to add desired host suffix
[INFO] k8s: jkube-healthcheck-quarkus: Adding readiness probe on port 8080, path='/q/health/ready', scheme='HTTP', with initial delay 5 seconds
[INFO] k8s: jkube-healthcheck-quarkus: Adding liveness probe on port 8080, path='/q/health/liveness', scheme='HTTP', with initial delay 10 seconds
[INFO] k8s: jkube-service-discovery: Using first mentioned service port '80' 
[INFO] k8s: jkube-service-discovery: Using first mentioned service port '8080' 
[INFO] k8s: jkube-revision-history: Adding revision history limit to 2
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/test-jkube-ingress-service.yml resource
[WARNING] Unknown keyword $module - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
[WARNING] Unknown keyword existingJavaType - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
[WARNING] Unknown keyword javaOmitEmpty - you should define your own Meta Schema. If the keyword is irrelevant for validation, just use a NonValidationKeyword
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/test-jkube-ingress-deployment.yml resource
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/test-jkube-ingress-ingress.yml resource
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/jkube-docker-registry-service.yml resource
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/jkube-docker-registry-storage-persistentvolumeclaim.yml resource
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/jkube-docker-registry-deployment.yml resource
[INFO] k8s: validating /home/rokumar/work/repos/jkube-testing/jkube-quarkus-ingress/target/classes/META-INF/jkube/kubernetes/jkube-docker-registry-ingress.yml resource
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.237 s
[INFO] Finished at: 2022-12-27T21:13:24+05:30
[INFO] ------------------------------------------------------------------------

Maybe I'm thinking a bit too far but shall we make changes so that these HINT messages show up after goal/task execution? We might need to do something similar like Summary (maybe implement HintService).

@manusa
Copy link
Member

manusa commented Jan 4, 2023

I'm not sure I'd call this "Hint service" but this should definitely go in the summary.
Also, this message might qualify for a warning (Is the generated Ingress without host valid? is it usable?)

@manusa manusa added this to the 1.11.0 milestone Jan 4, 2023
manusa pushed a commit that referenced this issue Jan 5, 2023
…teExternalUrls` is used without domain (#1439)

Currently value for IngressRule's `.host` field depends either on `HOST`
enricher configuration or `jkube.domain` configuration. If none of these
options are provided, we set `.spec.defaultBackend`.

Add a hint to suggest specifying `jkube.domain` in case no value for
host is found.

Signed-off-by: Rohan Kumar <rohaan@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
3 participants