You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2020/01/28 21:56:59 UTC
[GitHub] [camel-k] rndIndy opened a new issue #1232: Camel-K Doesn't Create
a Service or Ingress for an Integration
rndIndy opened a new issue #1232: Camel-K Doesn't Create a Service or Ingress for an Integration
URL: https://github.com/apache/camel-k/issues/1232
I'm trying to use Camel-k with the CXF component to create a pass through proxy for a SOAP service running outside my K8S cluster and I am having trouble exposing the port to the outside world or to other pods in the cluster. I was able to generate a service and ingress following the RestWithUndertow example, but not with my integration. My code is in the picture below.
<img width="724" alt="Camel-K CXF Code" src="https://user-images.githubusercontent.com/60113204/73306925-32958080-41eb-11ea-9332-1a8e6fdc3d57.PNG">
I am running the following command to create the integration:
kamel run --name=cxf-test --trait service.enabled=true --trait container.service-port=8080 -d camel-cxf -d mvn:org.apache.cxf:cxf-rt-transports-http-jetty:3.3.5 cxfTest.java --dev
I have tried with the traits above and the ingress traits to no avail. My integration yaml looks like the following.
<img width="322" alt="Camel-k Integration yaml" src="https://user-images.githubusercontent.com/60113204/73307203-bea7a800-41eb-11ea-8333-d59963c1ce5b.PNG">
It shows a no http service is required message under type "DeploymentAvailable" and that no host or service is defined under "ServiceAvailable." I have verified that the integration works as a proxy by using the command kubectl exec -it <pod_name> -- /bin/bash to get inside the container and manually send a SOAP request to the proxy. I am unable to access the proxy from outside the container however.
I have used a work around in the meantime by manually creating my own service and applying it to the integration.
<img width="187" alt="Camel-k Service" src="https://user-images.githubusercontent.com/60113204/73308277-e861ce80-41ed-11ea-81b7-838b2a1cc714.PNG">
Kubectl apply -f cxf-service.yaml
This seemingly fixes the problem and I am able to expose and access the port from outside the cluster. With this method I have been able to get the functionality I was looking for, but it is not ideal however, because the service needs to applied every time the integration code is updated.
What would be the "proper" way to ensure that kamel run generates a service and an ignress?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-k] rndIndy edited a comment on issue #1232: Camel-K Doesn't
Create a Service or Ingress for an Integration
Posted by GitBox <gi...@apache.org>.
rndIndy edited a comment on issue #1232: Camel-K Doesn't Create a Service or Ingress for an Integration
URL: https://github.com/apache/camel-k/issues/1232#issuecomment-580282536
@jamesnetherton Thank you for the suggestion, it worked! I replaced the "myEndpoint" with:
`"cxf://http://0.0.0.0:9000/ws?wsdlURL=http://ghana.corp.sensis.com:8080/ws/countries.wsdl&dataFormat=RAW"`
Camel-k auto generated a service and ingress when I used the following command:
`kamel run --name=test-cxf --trait ingress.host=cxf.malta.corp.sensis.com -d camel-cxf -d camel-http -d camel-jetty -d mvn:org.apache.cxf:cxf-rt-transports-http-jetty:3.3.5 testCxf.java --dev`
This works now, but I would like to access this proxy from outside the cluster and that is not currently possible. Is there away to force Camel-k to generate a NodePort service instead of a ClusterIP?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-k] rndIndy commented on issue #1232: Camel-K Doesn't Create
a Service or Ingress for an Integration
Posted by GitBox <gi...@apache.org>.
rndIndy commented on issue #1232: Camel-K Doesn't Create a Service or Ingress for an Integration
URL: https://github.com/apache/camel-k/issues/1232#issuecomment-580282536
@jamesnetherton Thank you for the suggestion, it worked! I replaced the "myEndpoint" with:
`"cxf://http://0.0.0.0:9000/ws?wsdlURL=http://ghana.corp.sensis.com:8080/ws/countries.wsdl&dataFormat=RAW"`
Camel-k auto generated a service and ingress when I used the following command:
`kamel run --name=test-cxf --trait ingress.host=cxf.malta.corp.sensis.com -d camel-cxf -d camel-http -d camel-jetty -d mvn:org.apache.cxf:cxf-rt-transports-http-jetty:3.3.5 testCxf.java --dev`
This works now, but I would like to access this proxy from outside the cluster and that is not currently possible. Is there away to force Camel-k to generate a NodePort service instead of a Cluster IP?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-k] jamesnetherton commented on issue #1232: Camel-K Doesn't
Create a Service or Ingress for an Integration
Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #1232: Camel-K Doesn't Create a Service or Ingress for an Integration
URL: https://github.com/apache/camel-k/issues/1232#issuecomment-579633063
I suspect it's related to how you have configured your route and how camel-k tries to determine whether an integration requires an HTTP service. It extracts the `from` endpoint URI scheme and uses it to look up whether it is an HTTP related component. Because your `from` part is `fromEndpoint`, it can't do this.
Try configuring the endpoint like:
```
from("cxf://http://0.0.0.0/ws?wsdlURL=http://foo/bar.wsdl")
```
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-k] davesargrad commented on issue #1232: Camel-K Doesn't
Create a Service or Ingress for an Integration
Posted by GitBox <gi...@apache.org>.
davesargrad commented on issue #1232: Camel-K Doesn't Create a Service or Ingress for an Integration
URL: https://github.com/apache/camel-k/issues/1232#issuecomment-579803305
@jamesnetherton Good feedback. It strikes me that what you suggest is a good solution, unless the integration is parameterized in a fashion that prevents the ingress URL from being specified in the URI. In this case, I'd think that the camel-k integration builder should still be able to create the service. I wonder if the camel-k team has plans to support adding the component the way that @rndIndy has. It seems like that should have worked.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services
[GitHub] [camel-k] davesargrad edited a comment on issue #1232: Camel-K
Doesn't Create a Service or Ingress for an Integration
Posted by GitBox <gi...@apache.org>.
davesargrad edited a comment on issue #1232: Camel-K Doesn't Create a Service or Ingress for an Integration
URL: https://github.com/apache/camel-k/issues/1232#issuecomment-579803305
@jamesnetherton Good feedback. It strikes me that what you suggest is a good solution, unless the integration is parameterized in a fashion that prevents the ingress URL from being specified in the URI. In this case, I'd think that the camel-k integration builder should still be able to create the service. I wonder if the camel-k team has plans to support adding the component the way that @rndIndy has. It seems like that should have worked. @nicolaferraro Do you have some thoughts on whether or not there are plans to support expanded methods for auto-creating the required services. Also is there a plan to support service types other than ClusterIP? For example, I'd think that it would be useful to create LoadBalancer or NodePort services at times.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services