I have been trying to find a way to define a service in one namespace that links to a Pod running in another namespace. I know that containers in a Pod running in nam
It is so simple to do it
if you want to use it as host and want to resolve it
If you are using ambassador to any other API gateway for service located in another namespace it's always suggested to use :
Use :
Use : .
Not : ..svc.cluster.local
it will be like : servicename.namespacename.svc.cluster.local
this will send request to a particular service inside the namespace you have mention.
example:
kind: Service
apiVersion: v1
metadata:
name: service
spec:
type: ExternalName
externalName: ..svc.cluster.local
Here replace the
and
with the appropriate value.
In Kubernetes, namespaces are used to create virtual environment but all are connect with each other.