Lucas Chiesa
08/05/2026, 6:16 AMRocky
08/05/2026, 6:17 AMcurl --location-trusted) follows the redirect and sends the actual data directly to that CN.
The "extra hop" is only a small metadata exchange (the 307 redirect). The large data payload only traverses the network once—from the client to the CN.
2. Advantages of Using the FE
StarRocks generally recommends sending requests to the FE for the following reasons:
* StarRocks-Aware Load Balancing: The FE uses an internal polling mechanism to select an available CN. Unlike a basic K8s Service round-robin, the FE is aware of the StarRocks cluster state and will only redirect to nodes it knows are healthy and active via heartbeats.
* Transaction Management: Stream Loads involve transactions. Sending the request to the FE allows it to manage the transaction lifecycle and "stream_load_max_txn_num_per_be" limits more effectively.
* Simplified Client Logic: Your client only needs to know the FE endpoint. The cluster can scale CNs up or down without the client needing to manage a list of backend nodes.
3. When to Use the CN Kubernetes Service Directly
Sending requests directly to a K8s Service targeting the CNs (port 8040) is also supported and can be advantageous in specific K8s environments:
* External Access (The "Internal IP" Problem): A common issue in K8s is that the FE might redirect the client to an internal Pod IP or internal FQDN that the client (if external) cannot reach. If you use a K8s Service of type LoadBalancer for your CNs, you bypass the redirect mechanism and ensure the client stays on a reachable path.
* Avoiding Redirection Complexity: If your client library does not support following HTTP 307 redirects (or does not support --location-trusted), going directly to the CN service is the only way to make it work.
Summary
Feature | Send to FE (Recommended) | Send to CN Service
Data Path | Client -> CN (Direct after 307) | Client -> CN (via K8s Service)
Load Balancing | FE polling (Cluster-aware) | K8s Round-Robin
Health Checks | StarRocks Heartbeat | K8s Readiness Probes
Complexity | Requires client to follow redirects | Simple HTTP PUT
External Use | Can be tricky with internal IPs | Easy with LoadBalancer Service
Conclusion: For most internal K8s workloads, using the FE is better because it respects the internal cluster state. If your clients are external and you are struggling with "Connection Refused" errors after the redirect, using a CN Service (LoadBalancer) is a perfectly valid and often-used and valid alternative.