Skip to content

Commit ce7474c

Browse files
Kube services considerations (#9194)
Co-authored-by: Nadine Spies <[email protected]> Co-authored-by: soloio-bulldozer[bot] <48420018+soloio-bulldozer[bot]@users.noreply.github.com>
1 parent 9d8289f commit ce7474c

File tree

2 files changed

+23
-9
lines changed

2 files changed

+23
-9
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
changelog:
2+
- type: NON_USER_FACING
3+
description: >-
4+
Adds considerations for selecting Kubernetes services as a routing destination instead of Upstreams.
5+
skipCI-kube-tests:true
6+
issueLink: https://github.com/solo-io/gloo/issues/9164
7+
resolvesIssue: true

docs/content/guides/traffic_management/destination_types/kubernetes_services/_index.md

+16-9
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,19 @@ weight: 80
44
description: Routing to services registered as Kubernetes Services through the API
55
---
66

7-
If you are running Gloo Edge in a Kubernetes cluster, it is possible to directly specify
8-
[Kubernetes Services](https://kubernetes.io/docs/concepts/services-networking/service/) as routing destinations.
9-
The `kube` destination type has two required fields:
7+
To allow for optimal performance in Gloo Edge, it is recommended to use Gloo [static]({{% versioned_link_path fromRoot="/guides/traffic_management/destination_types/static_upstream/" %}}) and [discovered]({{% versioned_link_path fromRoot="/guides/traffic_management/destination_types/discovered_upstream/" %}}) Upstreams as your routing destination. However, if you run Gloo Edge in a Kubernetes cluster, you have the option to route to a Kubernetes service directly.
108

11-
* `ref` is a {{< protobuf name="core.solo.io.ResourceRef">}} to the service that should receive traffic
12-
* `port` is an `int` which represents the port on which the service is listening. This must be one of the ports defined in the Kubernetes service spec
9+
Consider the following information before choosing a Kubernetes service as your routing destination:
10+
- For Gloo Edge to route traffic to a Kubernetes service directly, Gloo Edge scans all services in the cluster and creates in-memory Upstream resources. If you have a large number of services in your cluster, the API snapshot increases which can have a negative impact on the Gloo Edge translation time.
11+
- When using Kubernetes services, load balancing is done in `kube-proxy` which can have further performance impacts. Routing to Gloo Upstreams bypasses `kube-proxy` as the request is routed to the pod directly.
12+
- Some Gloo Edge functionality, such as policies, might not be available when using Kubernetes services.
1313

14-
The following configuration will forward all requests to `/petstore` to port `8080` on the Kubernetes service named
15-
`petstore` in the `default` namespace.
14+
To use Kubernetes services as a routing destination:
1615

17-
{{< highlight yaml "hl_lines=6-10" >}}
16+
1. Enable routing to Kubernetes services by setting `settings.disableKubernetesDestinations: true` in your Gloo Edge Helm chart. By default, routing to Kubernetes services is disabled in Gloo Edge due to the negative performance impact on translation and load balancing time in clusters with a lot of Kubernetes services.
17+
2. Configure the Kubernetes service as a routing destination in your VirtualService. The following example configuration forwards all requests to `/petstore` to port `8080` on the `petstore` Kubernetes service in the `default` namespace.
18+
19+
{{< highlight yaml "hl_lines=6-10" >}}
1820
routes:
1921
- matchers:
2022
- prefix: /petstore
@@ -25,4 +27,9 @@ routes:
2527
name: petstore
2628
namespace: default
2729
port: 8080
28-
{{< /highlight >}}
30+
{{< /highlight >}}
31+
32+
The `kube` destination type has two required fields:
33+
34+
* `ref` is a {{< protobuf name="core.solo.io.ResourceRef">}} to the service that receives the traffic.
35+
* `port` is an integer (`int`) and represents the port the service listens on. Note that this port must be defined in the Kubernetes service.

0 commit comments

Comments
 (0)