kubeovn / kube-ovn

A Bridge between SDN and Cloud Native (Project under CNCF)
https://kubeovn.github.io/docs/stable/en/
Apache License 2.0
1.92k stars 436 forks source link

[Feature Request] VPC DNS without specifying VIP (without SLR) #4277

Open zhangzujian opened 1 month ago

zhangzujian commented 1 month ago

Description

We can add a OVN LR static route:

IPv4 Routes
Route Table <main>:
               10.96.0.10                99.99.99.2 dst-ip

Add add the service ip of kube-dns service to the vpc dns pod:

$ ip addr show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet 10.96.0.10/32 scope global lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
16: eth0@if17: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP group default
    link/ether 6e:11:47:10:5c:3b brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 99.99.99.2/24 brd 99.99.99.255 scope global eth0
       valid_lft forever preferred_lft forever
    inet6 fe80::6c11:47ff:fe10:5c3b/64 scope link
       valid_lft forever preferred_lft forever
18: net1@if19: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1400 qdisc noqueue state UP group default
    link/ether e6:55:33:e9:90:c7 brd ff:ff:ff:ff:ff:ff link-netnsid 0
    inet 10.16.0.8/16 brd 10.16.255.255 scope global net1
       valid_lft forever preferred_lft forever
    inet6 fe80::e455:33ff:fee9:90c7/64 scope link
       valid_lft forever preferred_lft forever

Now DNS works well with the default dns server:

root@vpc-pod-56tx2:/kube-ovn# nslookup kubernetes.default
Server:         10.96.0.10
Address:        10.96.0.10#53

Name:   kubernetes.default.svc.cluster.local
Address: 10.96.0.1

Who will benefit from this feature?

Currently, we need to specify a VIP for the vpc dns and pod/vm must set their dns server to the vip.

With this feature, pod/vm can access the vpc dns without changing their dns config.

Anything else?

No response

zhangzujian commented 1 month ago

4250

zhangzujian commented 1 month ago

Another solution is that setting the default dns vip to the kube-dns service ip.

@bobz965 What do you think?

bobz965 commented 1 month ago

@zhangzujian setting the default dns vip to the kube-dns service ip It is a good idea.