You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by "kezhenxu94 (via GitHub)" <gi...@apache.org> on 2023/06/14 09:48:09 UTC

[GitHub] [skywalking] kezhenxu94 opened a new pull request, #10936: Add Istio ServiceEntry registry to resolve unknown IPs in ALS

kezhenxu94 opened a new pull request, #10936:
URL: https://github.com/apache/skywalking/pull/10936

   <!--
       ⚠️ Please make sure to read this template first, pull requests that don't accord with this template
       maybe closed without notice.
       Texts surrounded by `<` and `>` are meant to be replaced by you, e.g. <framework name>, <issue number>.
       Put an `x` in the `[ ]` to mark the item as CHECKED. `[x]`
   -->
   
   <!-- ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👇 ====
   ### Fix <bug description or the bug issue number or bug issue link>
   - [ ] Add a unit test to verify that the fix works.
   - [ ] Explain briefly why the bug exists and how to fix it.
        ==== 🐛 Remove this line WHEN AND ONLY WHEN you're fixing a bug, follow the checklist 👆 ==== -->
   
   <!-- ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👇 ====
   ### Improve the performance of <class or module or ...>
   - [ ] Add a benchmark for the improvement, refer to [the existing ones](https://github.com/apache/skywalking/blob/master/apm-commons/apm-datacarrier/src/test/java/org/apache/skywalking/apm/commons/datacarrier/LinkedArrayBenchmark.java)
   - [ ] The benchmark result.
   ```text
   <Paste the benchmark results here>
   ```
   - [ ] Links/URLs to the theory proof or discussion articles/blogs. <links/URLs here>
        ==== 📈 Remove this line WHEN AND ONLY WHEN you're improving the performance, follow the checklist 👆 ==== -->
   
   <!-- ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👇 ====
   ### <Feature description>
   - [ ] If this is non-trivial feature, paste the links/URLs to the design doc.
   - [ ] Update the documentation to include this new feature.
   - [ ] Tests(including UT, IT, E2E) are added to verify the new feature.
   - [ ] If it's UI related, attach the screenshots below.
        ==== 🆕 Remove this line WHEN AND ONLY WHEN you're adding a new feature, follow the checklist 👆 ==== -->
   
   - [x] If this pull request closes/resolves/fixes an existing issue, replace the issue number. Closes #<issue number>.
   - [x] Update the [`CHANGES` log](https://github.com/apache/skywalking/blob/master/docs/en/changes/changes.md).
   
   
   ## Background
   
   Currently the ALS analyzers resolve services through (1) Envoy metadata-exchange extension's metadata, and (2) Kubernetes service registry. When the users register extra (internal or external) services via Istio ServiceEntry, the services are shown as `UNKNOWN` because no metadata or Kubernetes Service available for these entries.
   
   ## Improvements
   
   This pull request adds a ServiceEntry registry, similar to [Kubernetes Service registry](https://github.com/apache/skywalking/blob/master/oap-server/server-receiver-plugin/envoy-metrics-receiver-plugin/src/main/java/org/apache/skywalking/oap/server/receiver/envoy/als/k8s/K8SServiceRegistry.java). When all the existing analyzers cannot resolve the service, the ServiceEntry registry will be consulted, and if any ServiceEntry for the IP is found, the service is resolved.
   
   ## How is IP mapped to ServiceEntry
   
   ### ServiceEntry with `resolution: STATIC`
   
   ```yaml
   
   ---
   apiVersion: networking.istio.io/v1alpha3
   kind: ServiceEntry
   metadata:
     name: internal-svc-httpbin-2
   spec:
     hosts:
       - httpbin.zhenxu.ke # not used
     addresses:
       - 1.2.3.4
     ports:
       - number: 80
         name: http
         protocol: HTTP
     location: MESH_INTERNAL
     resolution: STATIC
     endpoints:
       - address: 10.170.0.9
   ```
   
   With this SE, we can send requests to `1.2.3.4`, which is passed to `10.170.0.9` at the end. In this case, IP `10.170.0.9` in the Envoy access log is resolved to a service named `internal-svc-httpbin-2`, so the topology looks like
   
   <img width="586" alt="image" src="https://github.com/apache/skywalking/assets/15965696/408aff1d-fbce-469c-8fe7-be95913fc102">
   
   ### ServiceEntry with `resolution: DNS` or `resolution: DNS_ROUND_ROBIN`
   
   ```yaml
   apiVersion: networking.istio.io/v1alpha3
   kind: ServiceEntry
   metadata:
     name: external-svc-httpbin
   spec:
     hosts:
       - httpbin.org
     ports:
       - number: 80
         name: http
         protocol: HTTP
     location: MESH_EXTERNAL
     resolution: DNS
   ```
   
   In this case, we can send requests to `httpbin.org` (assuming `meshConfig.outboundTrafficPolicy.mode=REGISTRY_ONLY` is set when installing Istio), and the real IP from the Envoy access log is dynamically resolved through DNS, thus, in this PR, we perform a DNS resolution request (periodically) and cache the IPs of that domain name `httpbin.org`, and lookup the real IP from the Envoy access log in the cached IPs, if found any, map the IP from the access log to the ServiceEntry and compose a service from the SE.
   
   ### ServiceEntry with `resolution: NONE`
   
   Didn't take care of this case in this pull request.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 merged pull request #10936: Add Istio ServiceEntry registry to resolve unknown IPs in ALS

Posted by "kezhenxu94 (via GitHub)" <gi...@apache.org>.
kezhenxu94 merged PR #10936:
URL: https://github.com/apache/skywalking/pull/10936


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] deva26 commented on pull request #10936: Add Istio ServiceEntry registry to resolve unknown IPs in ALS

Posted by "deva26 (via GitHub)" <gi...@apache.org>.
deva26 commented on PR #10936:
URL: https://github.com/apache/skywalking/pull/10936#issuecomment-1591419713

   Thanks @kezhenxu94 . Would it be possible to enhance the logic with the below? :
   
   1. > With this SE, we can send requests to 1.2.3.4, which is passed to 10.170.0.9 at the end. In this case, IP 10.170.0.9 in the Envoy access log is resolved to a service named internal-svc-httpbin-2
   
   Here we need to use the `hosts` filed of ServiceEntry rather than the ServiceEntry name. ServiceEntry name is arbitrary field whereas the hosts field is the one used by the client. I understand the hosts field can have more than one value. For now, let us pick the first one from the list.
   
   1. When we read SE present in the cluster, is it possible to check for SE in xcp-multicluster first and then the other namespaces?
   1. We shall add some more logic to SEs created in xcp-multicluster  so that client side resolution of remote gateway would become available
   
   . 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org