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

oc:resource do not generate route #602

Closed
rafaeltuelho opened this issue Mar 4, 2021 · 6 comments · Fixed by #654
Closed

oc:resource do not generate route #602

rafaeltuelho opened this issue Mar 4, 2021 · 6 comments · Fixed by #654
Assignees
Labels
documentation Improvements or additions to documentation

Comments

@rafaeltuelho
Copy link

rafaeltuelho commented Mar 4, 2021

Description

oc:resource do not generate openshift route

Info

even explicitly configuring the openshift-maven-plugin with:

...
            <configuration>
              <verbose>false</verbose>
              <enricher>
                <config>
                  <jkube-openshift-route>
                    <generateRoute>true</generateRoute>
                    <tlsInsecureEdgeTerminationPolicy>Allow</tlsInsecureEdgeTerminationPolicy>
                    <tlsTermination>edge</tlsTermination>
                  </jkube-openshift-route>
                </config>
              </enricher> 
...
  • Eclipse JKube version : 1.1.1
  • Maven version (mvn -v) :
Apache Maven 3.6.3 (cecedd343002696d0abb50b32b541b8a6ba2883f)
Maven home: /usr/local/Cellar/maven/3.6.3_1/libexec
Java version: 11.0.2, vendor: Oracle Corporation, runtime: /Library/Java/JavaVirtualMachines/openjdk-11.0.2.jdk/Contents/Home
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.15.6", arch: "x86_64", family: "mac"
  • Kubernetes / Red Hat OpenShift setup and version :
Client Version: openshift-clients-4.6.0-202006250705.p0-166-g299b6af53
Server Version: 4.6.3
Kubernetes Version: v1.19.0+9f84db3
  • If it's a bug, how to reproduce :
mvn clean oc:resource -Popenshift
  • If it's a feature request, what is your use case :

  • Sample Reproducer Project : [https://github.com/rafaeltuelho/my-business-automation-showcase/tree/master/business-application-service]

@manusa manusa self-assigned this Mar 5, 2021
@manusa
Copy link
Member

manusa commented Mar 5, 2021

When I run mvn clean oc:resource -Popenshift with the project as is in https://github.com/rafaeltuelho/my-business-automation-showcase/blob/0fa29a20c99adbde48e456a00589ff29b7736ccc/business-application-service/pom.xml a route gets successfully created. ✔️

If I remove the route.yml fragment, the route is no longer created ✖️

If I remove the pom.xml route configuration and route.yml fragment, the route is no longer created ✖️


The generated Service is missing the required labels expose: true or jkube.io/exposeUrl: true to enable the automatic Route generation.
image

Services with recognized web ports (80, 443, 8080, 9080, 9090, 9443), are automatically exposed. Since this application is using port 8090, you need to manually set the service as exposed.

Adding the following property: <jkube.enricher.jkube-service.expose>true</jkube.enricher.jkube-service.expose> (or XML configuration element) allows the automatic route generation for both failing checks in the previous analysis

@manusa
Copy link
Member

manusa commented Mar 5, 2021

It's really clear that our documentation should be improved in this aspect. As I did the analysis I recall that other users stumbled across this before. We need to improve it.

@manusa manusa added the documentation Improvements or additions to documentation label Mar 5, 2021
@manusa
Copy link
Member

manusa commented Mar 5, 2021

Please @rafaeltuelho confirm that the proposed fix (adding <jkube.enricher.jkube-service.expose>true</jkube.enricher.jkube-service.expose> to your pom.xml) fixes the issue for you.

@manusa manusa removed their assignment Mar 5, 2021
@rafaeltuelho
Copy link
Author

@manusa thank you for explaining that.
So, I put a route.yml fragment to kinda force the route generation which worked for me.
I removed that route fragment and tried the prop you pointed out and it also worked!
Yeah, this need to be highlighted in the docs because it seems I don't need this piece of config:

              <enricher>
                <config>
                  <jkube-openshift-route>
                    <generateRoute>true</generateRoute>
                    <tlsInsecureEdgeTerminationPolicy>Allow</tlsInsecureEdgeTerminationPolicy>
                    <tlsTermination>edge</tlsTermination>
                  </jkube-openshift-route>
                </config>
              </enricher> 

I just need to use the prop you pointed:

<jkube.enricher.jkube-service.expose>true</jkube.enricher.jkube-service.expose>

It's confusing :-/

@manusa
Copy link
Member

manusa commented Mar 5, 2021

It's confusing :-/

Agreed. We'll keep this issue open to use it as a placeholder to improve our docs.

@rohanKanojia
Copy link
Member

I'm adding a small note in Route Generation section regarding expose labels required for Route generation.

rohanKanojia added a commit to rohanKanojia/jkube that referenced this issue Apr 7, 2021
…neration

Add some documentation about service expose labels in Route generation
section for resource goal
manusa pushed a commit to rohanKanojia/jkube that referenced this issue Apr 16, 2021
…neration

Add some documentation about service expose labels in Route generation
section for resource goal
manusa pushed a commit that referenced this issue Apr 16, 2021
Add some documentation about service expose labels in Route generation
section for resource goal
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants