[Container-tools] [openshift-sme] DNS K8s Service issue with openshift 3.7 on minishift

Charles Moulliard cmoullia at redhat.com
Fri Dec 8 14:35:35 UTC 2017


Name is resolved correctly as I can execute ping say-service or ping
greeting-service and I will get an ip address
I suspect here a iptables config issue ....


On Fri, Dec 8, 2017 at 3:21 PM, Akram Ben Aissi <abenaiss at redhat.com> wrote:

> Hi Charles,
>
> what if you use the service IP: 172.30.197.92 ?
>
> you can check name resolution also with: getent hosts say-service
>
>
> On Fri, Dec 8, 2017 at 9:59 AM, Charles Moulliard <cmoullia at redhat.com>
> wrote:
>
>> Hi,
>>
>> I can't curl anymore a kube service using the service address with
>> Openshift 3.7 within the terminal of a pod/container.
>>
>> Is there something broken/changed with internal DNS Server used by k8s
>> since openshift 3.6 ?
>>
>> Here is the scenario followed to install Openshift, Demo project
>>
>> # Setup minishift with Openshift
>> minishift version
>> minishift v1.9.0+a511b25
>>
>> minishift --profile istio-demo config set image-caching true
>> minishift --profile istio-demo config set memory 3GB
>> minishift --profile istio-demo config set openshift-version v3.7.0
>> minishift --profile istio-demo config set vm-driver xhyve
>> minishift --profile istio-demo addon enable admin-user
>> minishift start --profile istio-demo
>>
>> # Log and install the demo
>> oc login -u admin -p admin
>>
>> pushd $(mktemp -d)
>> git clone git at github.com:snowdrop/spring-boot-quickstart-istio.git && cd
>> spring-boot-quickstart-istio
>> oc new-project demo
>> cd greeting-service
>> mvn clean package fabric8:deploy -Popenshift
>> cd ../say-service
>> mvn clean package fabric8:deploy -Popenshift
>>
>> sleep 15s
>> oc get svc/say-service -o yaml
>> apiVersion: v1
>> kind: Service
>> metadata:
>>   labels:
>>     app: say-service
>>     expose: "true"
>>     group: me.snowdrop
>>     provider: fabric8
>>     version: 1.0-SNAPSHOT
>>   name: say-service
>>   namespace: demo
>> spec:
>>   clusterIP: 172.30.197.92
>>   ports:
>>   - name: http
>>     port: 8080
>>     protocol: TCP
>>     targetPort: 8080
>>   selector:
>>     app: say-service
>>     group: me.snowdrop
>>     provider: fabric8
>>   sessionAffinity: None
>>   type: ClusterIP
>> status:
>>   loadBalancer: {}
>>
>> # Rsh to the container
>>
>> oc rsh $(oc get pods -o jsonpath='{.items[*].metadata.name}' -l
>> app=say-service)
>> sh-4.2$ curl http://localhost:8080/say
>> {"id":7,"content":"Hello, World!"}
>>
>> sh-4.2$ curl http://$HOSTNAME:8080/say
>> {"id":8,"content":"Hello, World!"}sh-4.2
>>
>> $ podIP=$(grep `hostname` /etc/hosts | awk '{print $1}')
>> sh-4.2$ echo $podIP
>> 172.17.0.14
>> sh-4.2$ curl  $podIP:8080/say
>> {"id":9,"content":"Hello, World!"}
>>
>> ##### FAIL TO REPLY #######
>> sh-4.2$ curl http://say-service.demo.svc.cluster.local:8080/say
>> ^C
>> sh-4.2$ curl http://say-service:8080/say
>> ^C
>>
>> Regards,
>>
>> Charles
>>
>>
>> Have a question?
>> First, check the FAQ: https://pnt.redhat.com/pnt/p-7
>> 34673/openshift-con...-Jun-2017.pdf
>> Next, check the archives: http://post-office.corp.redhat
>> .com/archives/openshift-sme/
>>
>
>
>
> --
>
> Akram Ben Aissi                         Mob : +33 6 31 57 08 60 <+33%206%2031%2057%2008%2060>
> Cloud and Platform Architect            Mel : akram.benaissi at redhat.com
> Red Hat Global Services                 Irc : akram
>                                         Twi : @ <akram.benaissi at redhat.com>akrambenaissi
> Red Hat France SARL                     http://www.redhat.fr
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/container-tools/attachments/20171208/46db5dac/attachment.htm>


More information about the Container-tools mailing list