-
Notifications
You must be signed in to change notification settings - Fork 196
gateway api deployment guide
This guide provides comprehensive instructions for deploying ReportPortal using the Kubernetes Gateway API, the modern replacement for Ingress.
- Overview
- Why Gateway API?
- Prerequisites
- Gateway API Concepts
- Deployment Steps
- TLS Configuration
- Configuration Examples
- Gateway Controller: Envoy Gateway
- Troubleshooting
- Migration from Ingress
Gateway API is the next-generation Kubernetes API for managing external access to services. It provides more expressive, extensible, and role-oriented interfaces compared to the legacy Ingress API.
The latest version (v1.4.1) includes GA support for:
v1.GatewayClassv1.Gatewayv1.HTTPRoutev1.GRPCRoutev1.BackendTLSPolicy
| Feature | Ingress | Gateway API |
|---|---|---|
| Role separation | Limited | Gateway/Route split |
| Protocol support | HTTP/HTTPS | HTTP, HTTPS, TCP, UDP, gRPC |
| Header-based routing | Controller-specific | Native support |
| Traffic splitting | Limited | Native support |
| Cross-namespace | Limited | ReferenceGrant |
| Extensibility | Annotations | Policy attachments |
- Kubernetes 1.26+ (Gateway API v1.4.1)
- kubectl configured with cluster access
Install the Gateway API Custom Resource Definitions:
kubectl apply -f https://github.com/kubernetes-sigs/gateway-api/releases/download/v1.4.1/standard-install.yamlVerify installation:
kubectl get crd | grep gateway.networking.k8s.ioExpected output:
gatewayclasses.gateway.networking.k8s.io
gateways.gateway.networking.k8s.io
grpcroutes.gateway.networking.k8s.io
httproutes.gateway.networking.k8s.io
referencegrants.gateway.networking.k8s.io
You need a Gateway controller implementation. See Gateway Controller: Envoy Gateway for installation instructions.
- GatewayClass: Defines the controller implementation (similar to IngressClass)
- Gateway: Represents a load balancer with listeners
- HTTPRoute: Defines routing rules to backend services
┌─────────────────────────────────────────────────────────────┐
│ Gateway │
│ (LoadBalancer with HTTP/HTTPS listeners) │
└─────────────────────────────────────────────────────────────┘
│
▼
┌─────────────────────────────────────────────────────────────┐
│ HTTPRoute │
│ ┌─────────┐ ┌─────────┐ ┌─────────┐ ┌─────────┐ │
│ │ / │ │ /ui │ │ /uat │ │ /api │ │
│ └────┬────┘ └────┬────┘ └────┬────┘ └────┬────┘ │
└───────┼──────────┼──────────┼──────────┼────────────────────┘
▼ ▼ ▼ ▼
┌────────┐ ┌────────┐ ┌────────┐ ┌────────┐
│ Index │ │ UI │ │ UAT │ │ API │
│Service │ │Service │ │Service │ │Service │
└────────┘ └────────┘ └────────┘ └────────┘
Create a values-gateway-api.yaml file:
# Disable legacy Ingress
ingress:
enable: false
# Enable Gateway API
gatewayAPI:
enable: true
hostnames: reportportal.example.com
# Reference an existing Gateway
gatewayRef:
name: my-gateway
namespace: gateway-system # optional
# Or create a new Gateway
gateway:
create: true
className: envoy-gateway# Add the Helm repository
helm repo add reportportal https://reportportal.github.io/kubernetes
helm repo update
# Deploy ReportPortal with Gateway API
helm install reportportal reportportal/reportportal \
--namespace reportportal \
--create-namespace \
--values values-gateway-api.yaml \
--set uat.superadminInitPasswd.password="YourSecurePassword"# Check Gateway status
kubectl get gateway -n reportportal
# Check HTTPRoute status
kubectl get httproute -n reportportal
# Check if routes are attached
kubectl describe httproute -n reportportal- Create a TLS secret from your certificate files:
kubectl create secret tls reportportal-tls \
--cert=path/to/tls.crt \
--key=path/to/tls.key \
-n reportportal- Configure Gateway with TLS:
ingress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com
gateway:
create: true
className: envoy-gateway
tls:
enable: true
secretName: reportportal-tlsFor advanced scenarios with multiple certificates:
gatewayAPI:
enable: true
hostnames:
- reportportal.example.com
- rp.example.com
gateway:
create: true
className: envoy-gateway
tls:
enable: true
certificateRefs:
- kind: Secret
name: reportportal-tls
namespace: reportportalFor full control over Gateway configuration:
gatewayAPI:
enable: true
hostnames: reportportal.example.com
gateway:
create: true
className: envoy-gateway
listeners:
- name: http
protocol: HTTP
port: 80
hostname: reportportal.example.com
allowedRoutes:
namespaces:
from: Same
- name: https
protocol: HTTPS
port: 443
hostname: reportportal.example.com
tls:
mode: Terminate
certificateRefs:
- kind: Secret
name: reportportal-tls
allowedRoutes:
namespaces:
from: SameCert-Manager supports Gateway API natively for automatic certificate management.
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.16.2/cert-manager.yamlVerify installation:
kubectl -n cert-manager get podsCreate a file called letsencrypt-issuer.yaml:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-prod
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: your-email@example.com # Replace with your email
privateKeySecretRef:
name: letsencrypt-prod-account-key
solvers:
- http01:
gatewayHTTPRoute:
parentRefs:
- name: reportportal-gateway
namespace: reportportal
kind: GatewayApply the issuer:
kubectl apply -f letsencrypt-issuer.yamlCreate a file called certificate.yaml:
apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: reportportal-tls
namespace: reportportal
spec:
secretName: reportportal-tls
issuerRef:
name: letsencrypt-prod
kind: ClusterIssuer
dnsNames:
- reportportal.example.comApply the certificate:
kubectl apply -f certificate.yamlingress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com
gateway:
create: true
className: envoy-gateway
tls:
enable: true
secretName: reportportal-tls # Managed by cert-manager# Check certificate status
kubectl get certificate -n reportportal
# Check certificate details
kubectl describe certificate reportportal-tls -n reportportal
# Check the secret was created
kubectl get secret reportportal-tls -n reportportalFor wildcard certificates or when HTTP-01 is not available:
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
name: letsencrypt-dns
spec:
acme:
server: https://acme-v02.api.letsencrypt.org/directory
email: your-email@example.com
privateKeySecretRef:
name: letsencrypt-dns-account-key
solvers:
- dns01:
cloudflare:
email: your-cloudflare-email@example.com
apiTokenSecretRef:
name: cloudflare-api-token
key: api-tokeningress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com
gatewayRef:
name: shared-gateway
namespace: gateway-systemingress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com
gateway:
create: true
className: envoy-gateway
annotations:
external-dns.alpha.kubernetes.io/hostname: reportportal.example.com
tls:
enable: true
mode: Terminate
secretName: reportportal-tlsingress:
enable: false
gatewayAPI:
enable: true
hostnames: example.com
path: /reportportal
gatewayRef:
name: shared-gatewayThis creates routes:
-
/reportportal→ Index service -
/reportportal/ui→ UI service -
/reportportal/uat→ UAT service -
/reportportal/api→ API service
ingress:
enable: false
gatewayAPI:
enable: true
hostnames:
- reportportal.example.com
- rp.example.com
- testing.example.com
gateway:
create: true
className: envoy-gateway
tls:
enable: true
secretName: reportportal-tlsingress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com
gatewayRef:
name: central-gateway
namespace: gateway-infra
sectionName: https # Specific listener nameNote: You may need a
ReferenceGrantto allow cross-namespace references.
ingress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com
httpRoute:
annotations:
external-dns.alpha.kubernetes.io/hostname: reportportal.example.com
external-dns.alpha.kubernetes.io/ttl: "60"
gateway:
create: true
className: envoy-gateway
tls:
enable: true
secretName: reportportal-tlsThis guide uses Envoy Gateway - a lightweight, Envoy-based Gateway controller.
# Install Envoy Gateway
# Note: Use --skip-crds if you already installed Gateway API CRDs separately
helm install eg oci://docker.io/envoyproxy/gateway-helm \
--version v1.3.0 \
-n envoy-gateway-system \
--create-namespace \
--skip-crds
# Wait for Envoy Gateway to be ready
kubectl wait --for=condition=Available deployment/envoy-gateway -n envoy-gateway-system --timeout=120s
# Create GatewayClass
kubectl apply -f - <<EOF
apiVersion: gateway.networking.k8s.io/v1
kind: GatewayClass
metadata:
name: envoy-gateway
spec:
controllerName: gateway.envoyproxy.io/gatewayclass-controller
EOF
# Verify GatewayClass is accepted
kubectl get gatewayclass envoy-gatewaygatewayAPI:
gateway:
className: envoy-gatewayReportPortal Gateway API support is compatible with any Gateway API implementation. For other controllers, consult their documentation:
# Check Gateway status
kubectl get gateway -n reportportal -o yaml
# Check GatewayClass exists and is accepted
kubectl get gatewayclass
# Check controller logs
kubectl logs -n <controller-namespace> deployment/<controller-name># Check HTTPRoute status
kubectl describe httproute -n reportportal
# Verify parentRefs match Gateway
kubectl get gateway -n reportportal -o jsonpath='{.metadata.name}'# Check certificate status (if using cert-manager)
kubectl describe certificate -n reportportal
# Check secret exists
kubectl get secret -n reportportal | grep tls
# Verify secret has correct keys
kubectl get secret reportportal-tls -n reportportal -o jsonpath='{.data}' | jq 'keys'# Check services exist
kubectl get svc -n reportportal
# Test from within cluster
kubectl run curl --rm -it --image=curlimages/curl -- \
curl -H "Host: reportportal.example.com" http://<gateway-ip>/api/health# Get Gateway address
kubectl get gateway -n reportportal -o jsonpath='{.status.addresses[0].value}'
# Check attached routes
kubectl get gateway -n reportportal -o jsonpath='{.status.listeners[*].attachedRoutes}'
# View HTTPRoute conditions
kubectl get httproute -n reportportal -o jsonpath='{.status.parents[*].conditions}'
# Check Envoy config (for Envoy Gateway)
kubectl port-forward -n envoy-gateway-system deploy/envoy-gateway 19000:19000
curl localhost:19000/config_dumpDeploy ReportPortal with both Ingress and Gateway API temporarily:
# Keep Ingress enabled during migration
ingress:
enable: true
class: nginx
hosts: reportportal.example.com
# Enable Gateway API in parallel
gatewayAPI:
enable: true
hostnames: reportportal-new.example.com # Use different hostname initially
gateway:
create: true
className: envoy-gatewayVerify Gateway API routing works:
curl -H "Host: reportportal-new.example.com" http://<gateway-ip>/api/healthUpdate DNS to point to Gateway instead of Ingress:
# Get Gateway IP
kubectl get gateway -n reportportal -o jsonpath='{.status.addresses[0].value}'Once verified, disable Ingress:
ingress:
enable: false
gatewayAPI:
enable: true
hostnames: reportportal.example.com # Original hostname
gateway:
create: true
className: envoy-gateway- Gateway API Documentation
- Cert-Manager Gateway API Integration
- Envoy Gateway Documentation
- ReportPortal Documentation
For issues specific to ReportPortal Gateway API deployment:
- Check the ReportPortal GitHub Issues
- Review Gateway controller documentation
- Consult cert-manager documentation for TLS issues