kubernetes-sigs / external-dns

Configure external DNS servers (AWS Route53, Google CloudDNS and others) for Kubernetes Ingresses and Services
Apache License 2.0
7.59k stars 2.55k forks source link

Endpoint IP for ClusterIP service type #3356

Closed github-daniel-stoian closed 1 year ago

github-daniel-stoian commented 1 year ago

Hi,

We are working to build an dev environment on AWS EKS having the following general guidelines:

  1. pods/apps should talk inside the cluster using Cluster IPs (172.20.x.x cluster private)
  2. developers should access pods via internal VPN using Endpoint IPs (10.21.x.x) and DNS records
  3. environment should not have any public ip/access from internet

Why is this needed:

We want use ClusterIP service type so that:

  1. kubernetes will automatically generate env_vars with private cluster ip accessible only within the cluster (Ex: MYSQL_PORT_3306_TCP_ADDR, MYSQL_PORT_3306_TCP_PORT) to be used at point 1
  2. external-dns will automatically generate DNS A records in euw1.dev.tech domain with Endpoint IPs (10.21.34.94) to be used at point2

What's not enough ATM:

I've followed #187 but ATM, the implementation is:

kubernetes: version: 1.24

external-dns: version: 0.13.2 args:

What would you like to be added: A new arg probably '--publish-internal-services-endpoint' that will publish first EndpointIP of a ClusterIP service type : 10.21.32.160

Kubectl describe service:

Name: analytics Namespace: test1 Annotations: external-dns.alpha.kubernetes.io: analytics.test1.euw1.dev.tech

Selector: analytics Type: ClusterIP IP Family Policy: SingleStack IP Families: IPv4 IP: None IPs: None Port: 8082 8082/TCP TargetPort: 8082/TCP Endpoints: 10.21.32.160:8082 Session Affinity: None

Manifest:

apiVersion: v1 kind: Pod metadata: name: analytics-f75f6968c-gjmwf status: phase: Running conditions: ... hostIP: 10.21.33.92 podIP: 10.21.34.94 podIPs:

Thank you.

github-daniel-stoian commented 1 year ago

We found other alternatives for out scenarios. Ex: Telepresence or Devspace