[Container-tools] DNS K8s Service issue with openshift 3.7 on minishift
Charles Moulliard
cmoullia at redhat.com
Fri Dec 8 08:59:41 UTC 2017
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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/container-tools/attachments/20171208/9c3aa3dd/attachment.htm>
More information about the Container-tools
mailing list