How I understand that I could be able to talk with other pods from a specific pod by sending from within the pod an HTTP request with the fully qualified domain name of the service (FQDN). The system runs locally with minikube.
The service's YML -
apiVersion: v1
kind: Service
metadata:
name: kubia
spec:
sessionAffinity: ClientIP
ports:
- port: 80
targetPort: 8080
selector:
app: kubia
The describe of the service -
Name: kubia
Namespace: default
Labels: <none>
Annotations: <none>
Selector: app=kubia
Type: ClusterIP
IP: 10.111.178.111
Port: <unset> 80/TCP
TargetPort: 8080/TCP
Endpoints: 172.17.0.7:8080,172.17.0.8:8080,172.17.0.9:8080
Session Affinity: ClientIP
Events: <none>
I'm trying to do that with -
kubectl exec -it kubia-gqd5l bash
where kubia-gqd5l is the pod. In the bash I tried to sent a request by -
curl http://kubia
Where kubia is the name of the service. and I got error -
curl: (6) Could not resolve host: kubia.
It is important to note that I manage to communicate with the service by -
kubectl exec kubia-gqd5l -- curl -s http://10.111.178.111
any idea?