This guide gets you up and running quickly with Docker and Kubernetes deployments.
# Build all images
./build-docker.sh v0.2.9
# Or build manually
docker build -t grpc-graphql-gateway:latest .
docker build -t grpc-graphql-gateway-federation:latest -f Dockerfile.federation .# Run single gateway
docker run -p 8080:8080 -p 9090:9090 \
-e RUST_LOG=info \
grpc-graphql-gateway:latest
# Run federation example
docker-compose -f docker-compose.federation.yml up# GraphQL query
curl -X POST http://localhost:8080/graphql \
-H 'Content-Type: application/json' \
-d '{"query": "{ __typename }"}'
# Metrics
curl http://localhost:9090/metrics# Ensure you have
kubectl cluster-info
helm version# Install with defaults
helm install my-gateway ./helm/grpc-graphql-gateway \
--create-namespace \
--namespace grpc-gateway
# With custom values
helm install my-gateway ./helm/grpc-graphql-gateway \
-f helm/values-autoscaling-complete.yaml \
--namespace grpc-gateway# Run the deployment script
./helm/deploy-federation.sh
# Or apply manifests directly
kubectl apply -f helm/federation-example.yaml# Pods
kubectl get pods -n grpc-gateway
# Services
kubectl get svc -n grpc-gateway
# HPA (if enabled)
kubectl get hpa -n grpc-gateway
# VPA (if enabled)
kubectl get vpa -n grpc-gatewayhelm install my-gateway ./helm/grpc-graphql-gateway \
--set autoscaling.enabled=true \
--set autoscaling.minReplicas=3 \
--set autoscaling.maxReplicas=10 \
--namespace grpc-gateway# Install VPA operator first
git clone https://github.com/kubernetes/autoscaler.git
cd autoscaler/vertical-pod-autoscaler
./hack/vpa-up.sh
# Deploy with VPA
helm install my-gateway ./helm/grpc-graphql-gateway \
--set verticalPodAutoscaler.enabled=true \
--set verticalPodAutoscaler.updateMode=Off \
--namespace grpc-gateway
# View recommendations
kubectl describe vpa my-gateway -n grpc-gatewayhelm install my-gateway ./helm/grpc-graphql-gateway \
-f helm/values-autoscaling-complete.yaml \
--namespace grpc-gatewayhelm install my-gateway ./helm/grpc-graphql-gateway \
--set loadBalancer.enabled=true \
--set loadBalancer.externalTrafficPolicy=Local \
--namespace grpc-gateway
# Get external IP
kubectl get svc my-gateway-lb -n grpc-gatewayAWS:
helm install my-gateway ./helm/grpc-graphql-gateway \
--set loadBalancer.enabled=true \
--set loadBalancer.annotations."service\.beta\.kubernetes\.io/aws-load-balancer-type"="nlb" \
--namespace grpc-gatewayGCP:
helm install my-gateway ./helm/grpc-graphql-gateway \
--set loadBalancer.enabled=true \
--set loadBalancer.annotations."cloud\.google\.com/load-balancer-type"="Internal" \
--namespace grpc-gateway# Watch pods scale
watch kubectl get pods,hpa -n grpc-gateway
# View metrics
kubectl port-forward -n grpc-gateway svc/my-gateway 9090:9090
curl http://localhost:9090/metrics
# View logs
kubectl logs -f -l app.kubernetes.io/name=grpc-graphql-gateway -n grpc-gateway# Uninstall gateway
helm uninstall my-gateway -n grpc-gateway
# Delete namespace
kubectl delete namespace grpc-gateway
# Delete federation
kubectl delete namespace federation-example
# Stop Docker Compose
docker-compose -f docker-compose.federation.yml down- Docker: See
Dockerfileanddocker-compose.federation.yml - Helm: See
helm/grpc-graphql-gateway/README.md - Autoscaling: See
docs/src/production/autoscaling.md - Federation: See
docs/src/federation/overview.md
Pods not starting?
kubectl describe pod <pod-name> -n grpc-gateway
kubectl logs <pod-name> -n grpc-gatewayHPA not scaling?
# Check metrics server
kubectl top nodes
kubectl get hpa -n grpc-gatewayLoadBalancer pending?
# Check provider configuration
kubectl describe svc my-gateway-lb -n grpc-gateway