Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Discussion] Extend the capabilities of YurtTunnel to forward not only O&M and monitoring traffic from cloud to edge #527

Closed
DrmagicE opened this issue Oct 20, 2021 · 19 comments
Labels

Comments

@DrmagicE
Copy link
Member

The YurtTunnel was originally designed to deal with the challenges of O&M and monitoring traffic in edge scenarios.
In this context, YurtTunnel can :

  1. handle the traffic to kubelet (to port 10250) on edge nodes through the tunnel by default ;
  2. and handle the traffic to hostNetwork pod and localhost on edge nodes with a little configuration.

By these two fundamental features, users can execute kubectl exec/logs to edge nodes and scrap metric from exporters on edge nodes, but it does not provide us a convenient way to forward other kinds of traffic from cloud to edge.

Although building a general purpose proxy may not be the goal of Yurttunnel, I am wondering if we can extend the capabilities of Yurttunnel to forward not only O&M and monitoring traffic. (see aslo #522)

For example, we can add more features to YurtTunnel to support these cases:

  1. the cloud components can use service DNS to request services on edge nodes;
  2. and use PodIP to request pods on edge nodes.

Here are some rough designs:

For case 1, we can maintain a special zone in CoreDNS using file plugin, (for example: .openyurt.tunnel), all domains belong to the zone will have an A record that holds the yurttunnel server service IP. The DNS name in this zone will follow such schema: <service_name>.<namespace>.<nodepool_name>.openyurt.tunnel. The components on the cloud side can use this schema to request specific services on specific nodepool. With this method, the user can manage their services in the service topology way, which is provided by data-filtering framework, which means the user do not need to create additional unique service per nodepool.

For case 2, we can list watch all pods that do not belong to podCIDR of the cloud side, and then add them to DNAT rule according to the yurt-tunnel-server-cfg configmap configuration.

Not sure if we should do this, I would like to hear your opinion. Welcome to discuss.

/kind design

@DrmagicE DrmagicE added the kind/feature kind/feature label Oct 20, 2021
@openyurt-bot openyurt-bot added the kind/design kind/design label Oct 20, 2021
@rambohe-ch
Copy link
Member

@DrmagicE Very appreciate for improving yurt-tunnel. and would you be able to add some background information about these two features?

@rambohe-ch
Copy link
Member

@tiezhuoyu You have mentioned that proxy request from cloud to edge through yurt-tunnel in issue: #522. Do you have any comments about these two features? and these features can satisfy your requirements?

@rambohe-ch
Copy link
Member

@DrmagicE The solution of case1, i'd like to complement the way of pod configuration for using dns domain .openyurt.tunnel. take an example as following:

spec:
  dnsPolicy: "None"
  dnsConfig:
    nameservers:
      - 1.2.3.4 #dns service clusterIP
    searches:
      - {namespace}.openyurt.tunnel
      - openyurt.tunnel
    options:
      - name: ndots
        value: "5"

and maybe we can add an admission controller to add dns config for pod automatically when pod with annotation like "AccessEdgeService=true".

@rambohe-ch
Copy link
Member

@DrmagicE If we use iptables rule to solve the case2, then client pods(the pod sends request) need to work on the same node with yurt-tunnel-server pod.

@DrmagicE
Copy link
Member Author

@DrmagicE The solution of case1, i'd like to complement the way of pod configuration for using dns domain .openyurt.tunnel. take an example as following:

spec:
  dnsPolicy: "None"
  dnsConfig:
    nameservers:
      - 1.2.3.4 #dns service clusterIP
    searches:
      - {namespace}.openyurt.tunnel
      - openyurt.tunnel
    options:
      - name: ndots
        value: "5"

and maybe we can add an admission controller to add dns config for pod automatically when pod with annotation like "AccessEdgeService=true".

Thanks for your advice, I need some time to investigate and see how it works.

@tiezhuoyu
Copy link

@tiezhuoyu You have mentioned that proxy request from cloud to edge through yurt-tunnel in issue: #522. Do you have any comments about these two features? and these features can satisfy your requirements?

I think these two greate features is very helpful. In some case, the pods on edge nodes may be scheduled to different hosts (such as virtual machines). It is inconvient with hostNetwork mod if the cloud node try to requeset to the specific pod.

@DrmagicE
Copy link
Member Author

DrmagicE commented Oct 21, 2021

@DrmagicE If we use iptables rule to solve the case2, then client pods(the pod sends request) need to work on the same node with yurt-tunnel-server pod.

Yes, and I believe this is a common issue in YurtTunnel DNAT mode. Unless we implement a controller (run as daemonset in every cloud node) to set the DNAT rule in every cloud node.

@rambohe-ch
Copy link
Member

@tiezhuoyu You have mentioned that proxy request from cloud to edge through yurt-tunnel in issue: #522. Do you have any comments about these two features? and these features can satisfy your requirements?

I think these two greate features is very helpful. In some case, the pods on edge nodes may be scheduled to different hosts (such as virtual machines). It is inconvient with hostNetwork mod if the cloud node try to requeset to the specific pod.

@tiezhuoyu Thanks for your feedback. Would you be able to describe some details of your use case that cloud pods access edge pods on different nodes?

@rambohe-ch
Copy link
Member

@DrmagicE If we use iptables rule to solve the case2, then client pods(the pod sends request) need to work on the same node with yurt-tunnel-server pod.

Yes, and I believe this is a common issue in YurtTunnel DNAT mode. Unless we implement a controller (run as daemonset in every cloud node) to set the DNAT rule in every cloud node.

@DrmagicE Ok, I got it. maybe end user need to accept this constraint at the beginning.

@tiezhuoyu
Copy link

tiezhuoyu commented Oct 21, 2021

@tiezhuoyu You have mentioned that proxy request from cloud to edge through yurt-tunnel in issue: #522. Do you have any comments about these two features? and these features can satisfy your requirements?

I think these two greate features is very helpful. In some case, the pods on edge nodes may be scheduled to different hosts (such as virtual machines). It is inconvient with hostNetwork mod if the cloud node try to requeset to the specific pod.

@tiezhuoyu Thanks for your feedback. Would you be able to describe some details of your use case that cloud pods access edge pods on different nodes?

I try to deploy kubevirt, a virtualization platform on k8s, in a openyurt cluster. Component named virt-handler is deployed on each edge node, and virt-api is deployed on cloud node. When it comes to request like 'pause/unpause', virt-api needs send a request to virt-handler, and virt-handler will pause/unpause a specific virtual machine. Unfortunatly, virt-handler is not a hostNetwork pod.

@DrmagicE
Copy link
Member Author

DrmagicE commented Oct 21, 2021

@tiezhuoyu virt-handler send requests with Pod IP or with service DNS name ?

@tiezhuoyu
Copy link

with pod IP, and the request as follow:
image

@DrmagicE
Copy link
Member Author

Got it, so case2 can satisfy your needs.

@DrmagicE
Copy link
Member Author

@DrmagicE Very appreciate for improving yurt-tunnel. and would you be able to add some background information about these two features?

In edge scenario, the edge node may not be accessible through the public network. For example, the edge node is a laptop in your room, a traffic light on the road, etc.
It is reasonable to have a central application which often deployed in the cloud and need to request the services on the edge, by service name or by pod IP.

If the YurtTunnel can satisfy this kind of requirement, the users will not need to find another solution.

@vincent-pli
Copy link
Member

Could we consider the Submariner, although it original aim for resolve the service connection and discovery for multiple cluster scenario.

the Submariner:

  1. Enables IP reachability between Pods and Services
  2. Provides, via Lighthouse, service discovery capabilities

@DrmagicE @rambohe-ch @tiezhuoyu

@stale
Copy link

stale bot commented Jan 20, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Jan 20, 2022
@rambohe-ch
Copy link
Member

/pinned

@stale stale bot removed the wontfix label Jan 21, 2022
@rambohe-ch
Copy link
Member

A new edge network project named Raven has been launched in OpenYurt community. and the feature requests in this issue will be implemented in the new project.

@stale
Copy link

stale bot commented Apr 21, 2022

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Apr 21, 2022
@stale stale bot closed this as completed Apr 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants