what would be the best way to define an alias name for a service to hide the deployment details e.g. the namespace in which a service is running inside of k8.
- deployment of service sample-service in namespace sample-ns1.
- deployment of service sample-service in namespace sample-ns2.
Goal: have an alias name e.g. sample-service.cluster.local that can be used by consuming apps that hide deployment details.
My first thought was something like this:
apiVersion: networking.istio.io/v1alpha3 kind: ServiceEntry metadata: name: sample-service spec: hosts: - "sample-service.cluster.local" location: MESH_INTERNAL ports: - number: 443 name: grpc protocol: GRPC resolution: NONE apiVersion: networking.istio.io/v1alpha3 kind: VirtualService metadata: name: sample-service spec: hosts: - "sample-service.cluster.local" route: - destination: host: sample-service.sample-ns1.svc.cluster.local