I am using Install Primary-Remote on different networks, to setup my primary and secondary clusters. Also, I am using v1.22.6 version of Kubernetes with minikube.
Setup is working and the network is good, however, when I try to use the short name to access services across the cluster, it is not working.
In the following example, test-ns is located in cluster-1 (primary) and the sample namespace is located in cluster-2 (remote). When I try to access services in the sample namespace, it works with FQDN, however, it is not working with the short-name at all. I tried to create ExternalName, ServiceEntry, and VirtualService, but nothing works.
NamespaceSameness is an option, however, not very appealing when you have namespace for each service.
Any help is much appreciated
kubectl exec -n test-ns -c sleep "$(kubectl get pod -n test-ns -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -- curl -sS helloworld.sample.svc.cluster.local:5000/h
ello
Hello version: v2, instance: helloworld-v2-54df5f84b-cvn8x
kubectl exec -n test-ns -c sleep "$(kubectl get pod -n test-ns -l app=sleep -o jsonpath='{.items[0].metadata.name}')" -- curl -sS helloworld:5000/hello
curl: (6) Could not resolve host: helloworld
command terminated with exit code 6
ExternalName:
apiVersion: v1
kind: Service
metadata:
name: helloworld
namespace: test-ns
spec:
type: ExternalName
externalName: helloworld.sample.svc.cluster.local
ports:
- port: 5000
protocol: TCP
name: tcp