I need to create an endpoint with DNS instead of IP
apiVersion: v1
kind: Service
metadata:
name: my-service
spec:
type: NodePort
ports:
- port: 5432
targetPort: 5432
nodePort: 30004
---
apiVersion: v1
kind: Endpoints
metadata:
name: my-service
subsets:
- addresses:
- ip: **111.111.111.111** ** < need change this to DNS
ports:
- port: 5432
Everything works fine with numerical IP, but I need to put my Postgres DNS instead, something like:
subsets:
- addresses:
- ip: mypostgres.com
ports:
- port: 5432
But "addresses" only support numerical IP. I need some workaround to make this work.
question from:
https://stackoverflow.com/questions/65672151/kubernetes-create-an-endpoint-with-dns-instead-ip 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…