sigs.k8s.io/gateway-api@v1.0.0/site-src/guides/simple-gateway.md (about)

     1  # Deploying a simple Gateway
     2  
     3  
     4  The simplest possible deployment is a Gateway and Route resource which are
     5  deployed together by the same owner. This represents a similar kind of model
     6  used for Ingress. In this guide, a Gateway and HTTPRoute are deployed which
     7  match all HTTP traffic and directs it to a single Service named `foo-svc`. 
     8  
     9  ![Simple Gateway](/images/single-service-gateway.png)
    10  
    11  ```yaml  
    12  {% include 'standard/simple-gateway/gateway.yaml' %}
    13  ```
    14  
    15  The Gateway represents the instantiation of a logical load balancer. It's
    16  templated from a hypothetical `acme-lb` GatewayClass. The Gateway listens for
    17  HTTP traffic on port 80. This particular GatewayClass automatically assigns an
    18  IP address which will be shown in the `Gateway.status` after it has been
    19  deployed. 
    20  
    21  Route resources specify the Gateways they want to attach to using `ParentRefs`. As long as 
    22  the Gateway allows this attachment (by default Routes from the same namespace are trusted),
    23  this will allow the Route to receive traffic from the parent Gateway. 
    24  `BackendRefs` define the backends that traffic will be sent to. More complex 
    25  bi-directional matching and permissions are possible and explained in other guides.
    26  
    27  The following HTTPRoute defines how traffic from the Gateway listener is routed
    28  to backends. Because there are no host routes or paths specified, this HTTPRoute
    29  will match all HTTP traffic that arrives at port 80 of the load balancer and
    30  send it to the `foo-svc` Pods. 
    31  
    32  ```yaml  
    33  {% include 'standard/simple-gateway/httproute.yaml' %}
    34  ```
    35  
    36  While Route resources are often used to filter traffic to many different
    37  backends (potentially with different owners), this demonstrates the simplest
    38  possible route with a single Service backend. This example shows how a service
    39  owner can deploy both the Gateway and the HTTPRoute for their usage alone,
    40  giving them more control and autonomy for how the service is exposed.