[ 
https://issues.apache.org/jira/browse/CAMEL-12562?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16506674#comment-16506674
 ] 

Nicola Ferraro commented on CAMEL-12562:
----------------------------------------

Yes, it may have been a issue with my IDE. This can be closed.

 

For the last point about Kubernetes, I'm not able to use it in OpenShift. 
Setting domain=svc.cluster.local and proto=workshop (namespace), I get the 
"inventory" service resolved to "5ea5d395.inventory.workshop.svc.cluster.local" 
(CNAME), but port is 0, while it should have been 8080.

 

There is another schema reported here 
[https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#supported-dns-schema|https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#supported-dns-schema.]
 (_my-port-name._my-port-protocol.my-svc.my-namespace.svc.cluster.local) but it 
seems not usable by camel-dns.

 

If you "dig", you see that only "_tcp.inventory.workshop.svc.cluster.local" and 
"_http._tcp.inventory.workshop.svc.cluster.local" return the correct port 
(8080), while the simple address (inventory.workshop.svc.cluster.local) returns 
0 as port.

 

In summary, looking at 
[https://github.com/apache/camel/blob/2bbbf36c395eadbbdfcd3c1b7f86bd6dfd35816d/components/camel-dns/src/main/java/org/apache/camel/component/dns/cloud/DnsServiceDiscovery.java#L76],
 the pattern used in camel-dns is <name>.<proto>.<domain>, while Kubernetes 
uses <proto>.<name>.<domain>.

I wonder if we can make the pattern customizable.

 

Reference:
{code:java}
/ $ dig inventory.workshop.svc.cluster.local SRV

; <<>> DiG 9.9.5-P1 <<>> inventory.workshop.svc.cluster.local SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 32772
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;inventory.workshop.svc.cluster.local. IN SRV

;; ANSWER SECTION:
inventory.workshop.svc.cluster.local. 30 IN SRV 10 100 0 
5ea5d395.inventory.workshop.svc.cluster.local.

;; ADDITIONAL SECTION:
5ea5d395.inventory.workshop.svc.cluster.local. 30 IN A 172.30.206.247

;; Query time: 2 msec
;; SERVER: 172.30.0.1#53(172.30.0.1)
;; WHEN: Fri Jun 08 22:54:11 UTC 2018
;; MSG SIZE rcvd: 99

/ $
/ $
/ $
/ $ dig _http._tcp.inventory.workshop.svc.cluster.local SRV

; <<>> DiG 9.9.5-P1 <<>> _http._tcp.inventory.workshop.svc.cluster.local SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10390
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;_http._tcp.inventory.workshop.svc.cluster.local. IN SRV

;; ANSWER SECTION:
_http._tcp.inventory.workshop.svc.cluster.local. 30 IN SRV 10 100 8080 
5ea5d395.inventory.workshop.svc.cluster.local.

;; ADDITIONAL SECTION:
5ea5d395.inventory.workshop.svc.cluster.local. 30 IN A 172.30.206.247

;; Query time: 1 msec
;; SERVER: 172.30.0.1#53(172.30.0.1)
;; WHEN: Fri Jun 08 22:54:22 UTC 2018
;; MSG SIZE rcvd: 110

/ $
/ $
/ $
/ $ dig _tcp.inventory.workshop.svc.cluster.local SRV

; <<>> DiG 9.9.5-P1 <<>> _tcp.inventory.workshop.svc.cluster.local SRV
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 18193
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 1

;; QUESTION SECTION:
;_tcp.inventory.workshop.svc.cluster.local. IN SRV

;; ANSWER SECTION:
_tcp.inventory.workshop.svc.cluster.local. 30 IN SRV 10 100 8080 
5ea5d395.inventory.workshop.svc.cluster.local.

;; ADDITIONAL SECTION:
5ea5d395.inventory.workshop.svc.cluster.local. 30 IN A 172.30.206.247

;; Query time: 1 msec
;; SERVER: 172.30.0.1#53(172.30.0.1)
;; WHEN: Fri Jun 08 22:56:35 UTC 2018
;; MSG SIZE rcvd: 104{code}

> camel-dns: starter ignores serviceCall EIP configuration
> --------------------------------------------------------
>
>                 Key: CAMEL-12562
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12562
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-dns
>            Reporter: Nicola Ferraro
>            Assignee: Luca Burgazzoli
>            Priority: Major
>             Fix For: 2.21.2, 2.22.0
>
>         Attachments: report.log
>
>
> When setting:
> {code:java}
> camel.cloud.dns.service-discovery.enabled=true
> camel.cloud.dns.service-discovery.domain=svc.cluster.local
> camel.cloud.dns.service-discovery.proto=workshop{code}
> The lookup is not executed with the dns provider.
>  
> Instead, if I set it in the route:
> {code:java}
> .serviceCall().name("inventory/api/purchases").dnsServiceDiscovery().domain("svc.cluster.local").proto("workshop");{code}
>  
> It at least tries to do the lookup with the DNS provider (although it fails 
> to find the service on Kubernetes).
>  
>  



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to