How to setup separate DNS endpoints for all different Apps running in Kubernetes Cluster? (AWS/GCP/AZURE)

Asking for help? Comment out what you need so we can get more information to help you!

Cluster information:

1-master node and 2 worker nodes
one Cluster in GCP
and other Cluster in AWS
Kubernetes version: 1.17.3
Cloud being used: (put bare-metal if not on a public cloud)
Installation method:
Host OS: ubuntu 18.04
CNI and version:
CRI and version:
Can DNS point to specific port?


how to setup separate DNS endpoints for all different Apps running in Kubernetes Cluster???(AWS/GCP/AZURE)

For example:

app1 service running on Nodeport: 30001

app2 service running on Nodeport: 30002


app1 endpoint DNS should be www.app1.com

app2 endpoint DNS should be www.app2.com

You can format your yaml by highlighting it and pressing Ctrl-Shift-C, it will make your output easier to read.

As far as I know there is no way to have DNS route to a port directly. generally to have multiple endpoints for multiple apps in a single cluster an ingress resource is used. This will receive the traffic and the route it to your pods through their services.

for a more detailed explenation check: Ingress - Kubernetes

What you want is SRV records in DNS, but mostly nobody uses them for this. Sorry.