Skip to content

Commit

Permalink
site/guides: drop Gateway API v1alpha1 guide (#4262)
Browse files Browse the repository at this point in the history
* site/guides: drop Gateway API v1alpha1 guide

Drops the Gateway API v1alpha1 guide and replaces
it with the v1alpha2 guide.

Closes #4091.

Signed-off-by: Steve Kriss <krisss@vmware.com>
  • Loading branch information
skriss committed Jan 20, 2022
1 parent f83a023 commit 5ea058b
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 190 deletions.
1 change: 0 additions & 1 deletion changelogs/unreleased/4122-skriss-docs.md

This file was deleted.

1 change: 1 addition & 0 deletions changelogs/unreleased/4262-skriss-docs.md
@@ -0,0 +1 @@
Updates the Gateway API guide to use Gateway API v1alpha2.
150 changes: 0 additions & 150 deletions site/content/guides/gateway-api-v1alpha2.md

This file was deleted.

54 changes: 15 additions & 39 deletions site/content/guides/gateway-api.md
@@ -1,5 +1,5 @@
---
title: Using Gateway API v1alpha1 with Contour
title: Using Gateway API (v1alpha2) with Contour
layout: page
---

Expand All @@ -9,7 +9,7 @@ layout: page
evolve service networking APIs within the Kubernetes ecosystem. Gateway API consists of multiple resources that provide
user interfaces to expose Kubernetes applications- Services, Ingress, and more.

This guide covers using version **v1alpha1** of the Gateway API.
This guide covers using version **v1alpha2** of the Gateway API, with Contour `v1.20.0` or higher.

### Background

Expand Down Expand Up @@ -37,6 +37,8 @@ The following prerequisites must be met before using Gateway API with Contour:
- A working [Kubernetes][2] cluster. Refer to the [compatibility matrix][3] for cluster version requirements.
- The [kubectl][4] command-line tool, installed and configured to access your cluster.

## Deploying Contour with Gateway API

### Option #1: Gateway API with Contour

Refer to the [contour][6] design for additional background on the Gateway API implementation.
Expand All @@ -53,34 +55,10 @@ This command creates:
- Contour RBAC resources
- Contour Deployment / Service
- Envoy Daemonset / Service
- Properly configured Configuration file for Gateway API
- GatewayAPI Gateway
- GatewayAPI Gateway Class

Create the Gateway API HTTPRoute to define how traffic should be routed:

```yaml
kind: HTTPRoute
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
name: root
namespace: projectcontour
spec:
gateways:
allow: All
hostnames:
- local.projectcontour.io
rules:
- matches:
- path:
type: Prefix
value: /
forwardTo:
- serviceName: kuard
port: 80
```
- Contour ConfigMap enabling Gateway API support
- Gateway API GatewayClass and Gateway

See the last section (Testing the Gateway API) on how to test it all out!
See the next section ([Testing the Gateway API](#testing-the-gateway-api)) on how to test it all out!

### Option #2: Using Gateway API with Contour Operator

Expand Down Expand Up @@ -113,25 +91,23 @@ $ kubectl apply -f {{< param base_url >}}/quickstart/gateway-nodeport.yaml
Either of the above options create:

- Namespace `projectcontour` to run the Gateway and child resources, i.e. Envoy DaemonSet.
- A Contour custom resource named `contour-gateway-sample` in the operator's namespace. This resource exposes
infrastructure-specific configuration and is referenced by the GatewayClass.
- A Contour custom resource named `contour-gateway-sample` in the operator's namespace. This resource exposes infrastructure-specific configuration and is referenced by the GatewayClass.
- A GatewayClass named `sample-gatewayclass` that abstracts the infrastructure-specific configuration from Gateways.
- A Gateway named `contour` in namespace `projectcontour`. This gateway will serve the test application through routing
rules deployed in the next step.
- A Gateway named `contour` in namespace `projectcontour`. This gateway will serve the test application through routing rules deployed in the next step.

See the next section (Testing the Gateway API) on how to test it all out!
See the next section ([Testing the Gateway API](#testing-the-gateway-api)) on how to test it all out!

### Testing the Gateway API
## Testing the Gateway API

Run the test application:
Deploy the test application:
```shell
$ kubectl apply -f {{< param base_url >}}/quickstart/kuard.yaml
```
This command creates:

- A Deployment named `kuard` in namespace `projectcontour` to run kuard as the test application.
- A Service named `kuard` in namespace `projectcontour` to expose the kuard application on TCP port 80.
- An HTTPRoute named `kuard` in namespace `projectcontour` to route requests for "*.projectcontour.io" to the kuard
- An HTTPRoute named `kuard` in namespace `projectcontour` to route requests for `local.projectcontour.io` to the kuard
service.

Verify the kuard resources are available:
Expand All @@ -145,8 +121,8 @@ pod/kuard-798585497b-zw42m 1/1 Running 0 21s
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE
service/kuard ClusterIP 172.30.168.168 <none> 80/TCP 21s

NAME HOSTNAMES
httproute.networking.x-k8s.io/kuard ["local.projectcontour.io"]
NAME HOSTNAMES
httproute.gateway.networking.k8s.io/kuard ["local.projectcontour.io"]
```

Test access to the kuard application:
Expand Down

0 comments on commit 5ea058b

Please sign in to comment.