fabric8io / jube

jube is a deprecated pure java implementation of kubernetes. Please look at kansible now instead!
https://github.com/fabric8io/kansible/blob/master/README.md
Apache License 2.0
27 stars 20 forks source link

Use hawtio v2 instead of old v1 for jube #275

Open davsclaus opened 9 years ago

davsclaus commented 9 years ago

We are removing kubernetes and docker and whatnot from v1 as its no longer maintained there, and just add noise: https://github.com/hawtio/hawtio/issues/1932

davsclaus commented 9 years ago

This requires we make a little WAR app or something of v2, and/or install it by downloading it from github, which we can do like

https://github.com/apache/camel/blob/master/examples/camel-example-servlet-rest-tomcat/pom.xml#L103

davsclaus commented 9 years ago

Using hawtio-kubernetes v2 and pointing the kube master to jube running local we get a bunch of errors. That is expected since jube hasn't been kept up to date with the development on the docker side.

2015-04-29 14:58:44,924 [qtp636336240-16] WARN  JAXRSUtils                     - No operation matching request path "/api/v1beta2/proxy/services/app-library-jolokia/jolokia/" is found, Relative Path: /proxy/services/app-library-jolokia/jolokia/, HTTP Method: POST, ContentType: text/json, Accept: application/json,text/javascript,*/*;q=0.01,. Please enable FINE/TRACE log level for more details.
2015-04-29 14:58:44,925 [qtp636336240-16] WARN  WebApplicationExceptionMapper  - javax.ws.rs.ClientErrorException: HTTP 404 Not Found
    at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117)
    at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:166)
    at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:529)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:177)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:212)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:707)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:744)

2015-04-29 14:58:45,144 [qtp636336240-16] WARN  JAXRSUtils                     - No operation matching request path "/api/v1beta2/proxy/services/app-library/apps" is found, Relative Path: /proxy/services/app-library/apps, HTTP Method: GET, ContentType: */*, Accept: application/json,text/plain,*/*,. Please enable FINE/TRACE log level for more details.
2015-04-29 14:58:45,146 [qtp636336240-16] WARN  WebApplicationExceptionMapper  - javax.ws.rs.ClientErrorException: HTTP 404 Not Found
    at org.apache.cxf.jaxrs.utils.SpecExceptions.toHttpException(SpecExceptions.java:117)
    at org.apache.cxf.jaxrs.utils.ExceptionUtils.toHttpException(ExceptionUtils.java:166)
    at org.apache.cxf.jaxrs.utils.JAXRSUtils.findTargetMethod(JAXRSUtils.java:529)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.processRequest(JAXRSInInterceptor.java:177)
    at org.apache.cxf.jaxrs.interceptor.JAXRSInInterceptor.handleMessage(JAXRSInInterceptor.java:77)
    at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:307)
    at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:121)
    at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:251)
    at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:234)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:208)
    at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:160)
    at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:171)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:293)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doGet(AbstractHTTPServlet.java:217)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
    at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:268)
    at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:808)
    at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:587)
    at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1127)
    at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
    at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1061)
    at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
    at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
    at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
    at org.eclipse.jetty.server.Server.handle(Server.java:497)
    at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:310)
    at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:257)
    at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
    at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:635)
    at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:555)
    at java.lang.Thread.run(Thread.java:744)
jstrachan commented 9 years ago

yeah that url: /api/v1beta2/proxy/services/app-library-jolokia/jolokia is trying to talk to the app library (for the Library tab) so this should proxy to the Services in kube/jube to find the service called "app-library-jolokia" then proxy the request "/jolokia" to that IP and port

davsclaus commented 9 years ago

Oh this is new.

So there is an app called app-library from the quickstarts repo at https://github.com/fabric8io/quickstarts/tree/master/apps/app-library

Is that the guy that needs to be running, and offer the REST services which hawtio v2 expects?

jstrachan commented 9 years ago

Its not mandatory; if it doesn't run you shouldn't have a Library tab and there's no icons found on the Apps / Services / Controllers / Pods pages; and the Run... menu is empty.

At least to get a basic jube working we shouldn't require it. There might be places in hawtio v2 where we access the service via the proxy URL without first checking that there is a service of that name in the service registry first. i.e. to avoid errors in the log ;)

davsclaus commented 9 years ago

Ah thanks all that level of indirection ;)

At first glance it seems v2 uses context path /kubernetes/api Where as they are exposed as just /api in jube

jstrachan commented 9 years ago

yeah; we probably wanna just get jube to forward /kubernetes/api/* to /api or something (ditto for osapi) (We've similar stuff to try expose /api/v1beta1 and /api/v1beta2 etc).

davsclaus commented 9 years ago

Okay got a bit further but there is more steps to do

davsclaus commented 9 years ago

If replacing hawtio v1 with v2 and using / as context-path (and not /hawtio) we can at least see the console, but it wont show data as the ws is not implemented etc, but its a start

screen shot 2015-05-19 at 10 32 08 am

davsclaus commented 9 years ago

There is a few old hawtio v1 modules that jube still uses, which we either need to port or remove the need for

davsclaus commented 9 years ago
davsclaus commented 9 years ago
davsclaus commented 9 years ago

The jube code can now build and compile with hawtio-java v2.

The console does not yet work, there is some web socket and some other rest apis not yet working, but at least the console is shown.