Ark Gateway
ARK uses Kubernetes Gateway API to provide access to services like the APIs and dashboard. The ARK service βLocalhost Gatewayβ is available to run as a lightweight gateway that allows you to access services.
Quickstart
Install the Localhost Gateway service with:
make localhost-gateway-install
Each of the ARK services includes an HTTPRoute
- once the Localhost Gateway has been installed you can see these routes with:
make routes
The ARK Dashboard is configured to run on the base route, from the dashboard you can also see configured services as well as the routes that are exposed:
Gateway API Overview
The Gateway APIΒ replaces the Ingress API as the next-generation specification for managing HTTP and TCP traffic in Kubernetes clusters. It separates infrastructure configuration (Gateway
) from application routing rules (HTTPRoute
), providing better separation of concerns and more powerful traffic management.
The Localhost Gateway service installs the official Gateway CRDsΒ . The implementation of the Gateway used is the popular NGINX Gateway Fabric 2.0Β . The NGINX Gateway Fabric CRDsΒ are installed, and then the NGINX Gateway Fabric 2.0 Helm ChartΒ is installed.
Architecture
The Localhost Gateway architecture looks like this:
βββββββββββββββββββββββββββββββ
β NGINX Gateway Fabric β βββ Controller that watches and manages Gateway resources
βββββββββββββββββββββββββββββββ
βββββββββββββββββββββββββββββββ
β Gateway β βββ name: localhost-gateway, namespace: ark-system
β (e.g. localhost-gateway) β listeners: *.127.0.0.1.nip.io:80, 127.0.0.1.nip.io:80
ββββββββββββββββ²βββββββββββββββ gatewayClassName: nginx
β parentRef
β
βββββββββββββββββββββββββββββββ
β HTTPRoute β βββ hostname: (e.g. ark-dashboard).ark-system.127.0.0.1.nip.io
β (e.g. ark-dashboard) β parentRefs: [localhost-gateway]
ββββββββββββββββ¬βββββββββββββββ backendRefs: [(e.g. ark-dashboard) service]
β routes to
βΌ
βββββββββββββββββββββββββββββββ
β Service β βββ name: (e.g. ark-dashboard), namespace: ark-system
β (e.g. ark-dashboard) β selector: app=(e.g. ark-dashboard)
ββββββββββββββββ¬βββββββββββββββ ports: 3000
β routes to
βΌ
βββββββββββββββββββββββββββββββ
β Pod β βββ labels: app=(e.g. ark-dashboard)
β (e.g. ark-dashboard) β ports: 3000
βββββββββββββββββββββββββββββββ
Configuration
Gateway Resource
The Gateway resource defines the infrastructure configuration:
apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: localhost-gateway
namespace: ark-system
spec:
gatewayClassName: nginx
listeners:
- name: http
port: 80
protocol: HTTP
hostname: "*.127.0.0.1.nip.io"
- name: http-root
port: 80
protocol: HTTP
hostname: "127.0.0.1.nip.io"
HTTPRoute Resources
Services define HTTPRoute resources to expose themselves:
apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: ark-dashboard
namespace: ark-system
spec:
parentRefs:
- name: localhost-gateway
namespace: ark-system
hostnames:
- "dashboard.127.0.0.1.nip.io"
rules:
- backendRefs:
- name: ark-dashboard
port: 3000
Service Integration
ARK services automatically create HTTPRoute resources when they include Gateway API configuration. This allows services to be automatically exposed through the gateway without manual configuration.
Service Requirements
For a service to be exposed through the gateway:
- Service resource - Standard Kubernetes service
- HTTPRoute resource - Defines routing rules
- Gateway reference - Points to the localhost-gateway
Automatic Discovery
The ARK dashboard automatically discovers and displays services that are exposed through the gateway, providing a centralized view of all available services and their routes.
Development Workflow
Local Development
For local development, the localhost gateway provides easy access to services:
- Install gateway:
make localhost-gateway-install
- Deploy services: Services automatically create routes
- Access services: Use the provided URLs (e.g.,
http://dashboard.127.0.0.1.nip.io:8080
)
Service URLs
Common service URLs when using localhost gateway:
- Dashboard:
http://dashboard.127.0.0.1.nip.io:8080
- ARK API:
http://ark-api.127.0.0.1.nip.io:8080
- A2A Gateway:
http://ark-api-a2a.127.0.0.1.nip.io:8080
Troubleshooting
Common Issues
Gateway not ready
# Check gateway status
kubectl get gateway localhost-gateway -n ark-system
# Check gateway fabric pods
kubectl get pods -n nginx-gateway
Routes not working
# List all HTTPRoutes
kubectl get httproutes -A
# Check specific route
kubectl describe httproute ark-dashboard -n ark-system
Service not accessible
# Check service endpoints
kubectl get endpoints -n ark-system
# Test service directly
kubectl port-forward service/ark-dashboard 3000:3000 -n ark-system
Next Steps
- Services - Learn about ARK services
- Observability - Monitor your gateway and services