sigs.k8s.io/gateway-api@v1.0.0/site-src/concepts/service-facets.md (about)

     1  # The Different Facets of a Service
     2  
     3  The Kubernetes [Service] resource is considerably more complex than people
     4  often realize. When you create a Service, typically the cluster machinery will:
     5  
     6  - Allocate a cluster-wide IP address for the Service itself (its _cluster IP_);
     7  - Allocate a DNS name for the Service, resolving to the cluster IP (its _DNS name_);
     8  - Collect the separate cluster-wide IP addresses assigned to each Pod matched
     9    by the Service's selector (the _endpoint IPs_) into the Service's Endpoints
    10    or EndpointSlices.
    11  - Configure the network such that traffic to the cluster IP will be
    12    load-balanced across all the endpoint IPs.
    13  
    14  Unfortunately, these implementation details become very important when
    15  considering how the Gateway API can work for service meshes!
    16  
    17  In [GAMMA initiative][gamma] work, it has become useful to consider Services
    18  as comprising two separate _facets_:
    19  
    20  - The **frontend** of the Service is the combination of the cluster IP and
    21    its DNS name.
    22  
    23  - The **backend** of the Service is the collection of endpoint IPs. (The Pods
    24    are not part of the Service backend, but they are of course strongly
    25    associated with the endpoint IPs.)
    26  
    27  The distinction between the facets is critical because the [gateway] and the
    28  [mesh] each need to decide whether a request that mentions a given Service
    29  should be directed to the Service's frontend or its backend:
    30  
    31  - Directing the request to the Service's frontend (_Service routing_) leaves
    32    the decision of which endpoint IP to use to the underlying network
    33    infrastructure (which might be `kube-proxy`, a service mesh, or something
    34    else).
    35  
    36  - Directing the request to the Service's backend (_endpoint routing_) is
    37    often necessary to enable more advanced load balancing decisions (for
    38    example, a gateway implementing sticky sessions).
    39  
    40  While Service routing may be the most direct fit for [Ana]'s sense of routing,
    41  endpoint routing can be more predictable when using the Gateway API for both
    42  [north/south] and [east/west traffic]. The [GAMMA initiative][gamma] is working to
    43  formalize guidance for this use case.
    44  
    45  [Service]: https://kubernetes.io/docs/concepts/services-networking/service/
    46  [north/south]:/concepts/glossary#northsouth-traffic
    47  [east/west traffic]:/concepts/glossary#eastwest-traffic
    48  [gamma]:/concepts/gamma/
    49  [Ana]:/concepts/roles-and-personas#ana