Set up an agentgateway
Set up an agentgateway proxy.
Before you begin
Install the agentgateway control plane.Set up an agentgateway proxy
Create a Gateway that uses the
agentgatewayGatewayClass. The following example sets up a Gateway that uses the default agentgateway proxy template.kubectl apply -f- <<EOF apiVersion: gateway.networking.k8s.io/v1 kind: Gateway metadata: name: agentgateway-proxy namespace: agentgateway-system spec: gatewayClassName: agentgateway listeners: - protocol: HTTP port: 80 name: http allowedRoutes: namespaces: from: All EOFVerify that the agentgateway proxy is created.
- Gateway: Note that it might take a few minutes for an address to be assigned.
- Pod for
agentgateway-proxy: The pod has one container:agent-gateway.
kubectl get gateway agentgateway-proxy -n agentgateway-system kubectl get deployment agentgateway-proxy -n agentgateway-systemExample output:
NAME CLASS ADDRESS PROGRAMMED AGE agentgateway-proxy agentgateway a1cff4bd974a34d8b882b2fa01d357f0-119963959.us-east-2.elb.amazonaws.com True 6m9s NAME READY UP-TO-DATE AVAILABLE AGE agentgateway-proxy 1/1 1 1 6m11sVerify that the external IP has been created and is not
pending.kubectl get svc -n agentgateway-system agentgateway-proxyExample output:
NAME TYPE CLUSTER-IP EXTERNAL-IP PORT(S) AGE agentgateway-proxy LoadBalancer 172.20.200.127 <pending> 80:30752/TCP 7m6sGet the external address of the agentgateway proxy and save it in an environment variable.
export INGRESS_GW_ADDRESS=$(kubectl get svc -n agentgateway-system agentgateway-proxy -o jsonpath="{.status.loadBalancer.ingress[0]['hostname','ip']}") echo $INGRESS_GW_ADDRESSkubectl port-forward deployment/agentgateway-proxy -n agentgateway-system 8080:80
Next
Explore how you can use agentgateway by checking out guides for the most common use cases:
You can also install the httpbin sample app and use this app to test traffic management, security, and resiliency guides with your agentgateway proxy.
Other configuration examples
Review other common configuration examples for your Gateway. To customize your Gateway even further, such as with Kubernetes overlays, check out Customize the gateway.
Same namespace HTTPRoutes
Allow only HTTPRoutes that are in the same namespace as the Gateway to be attached to this Gateway (allowedRoutes.namespaces.from=Same).
kind: Gateway
apiVersion: gateway.networking.k8s.io/v1
metadata:
name: agentgateway-proxy
namespace: agentgateway-system
spec:
gatewayClassName: agentgateway
listeners:
- protocol: HTTP
port: 80
name: http
allowedRoutes:
namespaces:
from: Same