private List<WebSocketUpstream> parseUpstream(final V1IngressBackend backend, final String namespace) {
        List<WebSocketUpstream> upstreamList = new ArrayList<>();
        if (Objects.nonNull(backend) && Objects.nonNull(backend.getService()) && Objects.nonNull(backend.getService().getName())) {
            String serviceName = backend.getService().getName();
            // shenyu routes directly to the container
            V1Endpoints v1Endpoints = endpointsLister.namespace(namespace).get(serviceName);
            List<V1EndpointSubset> subsets = v1Endpoints.getSubsets();
            if (Objects.isNull(subsets) || CollectionUtils.isEmpty(subsets)) {
                LOG.info("Endpoints {} do not have subsets", serviceName);
            } else {
                for (V1EndpointSubset subset : subsets) {
                    List<V1EndpointAddress> addresses = subset.getAddresses();
                    if (Objects.isNull(addresses) || addresses.isEmpty()) {
                        continue;
                    }
                    for (V1EndpointAddress address : addresses) {
                        String upstreamIp = address.getIp();
                        String defaultPort = parsePort(backend.getService());
                        if (Objects.nonNull(defaultPort)) {
                            WebSocketUpstream upstream = WebSocketUpstream.builder()
                                    .upstreamUrl(upstreamIp + ":" + defaultPort)
                                    .weight(100)
                                    .protocol("ws://")
                                    .warmup(0)
                                    .status(true)
                                    .host("").build();
                            upstreamList.add(upstream);
                        }
                    }
                }
            }
        }
        return upstreamList;
    }
Parse ingress to ShenyuMemoryConfig.

@param ingress ingress resource
@param coreV1Api coreV1Api
@return ShenyuMemoryConfig
shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/WebSocketParser.java