Skip to content

Latest commit

 

History

History
89 lines (64 loc) · 1.91 KB

KUBERNETES.md

File metadata and controls

89 lines (64 loc) · 1.91 KB

Testing on Kubernetes

Demo

For more info about the demo see the scripts in demo

Building

make docker

Setup Istio with K8s Gateway API

# Install K8s Gateway API
kubectl get crd gateways.gateway.networking.k8s.io &> /dev/null || \
  { kubectl kustomize "github.com/kubernetes-sigs/gateway-api/config/crd?ref=v1.0.0" | kubectl apply -f -; }

# Install istio as ingress solution (no mesh)
istioctl install --set profile=minimal -y

Create Gateway API resources

kubectl apply -f kubernetes/yaml/gateway.yaml
kubectl apply -f kubernetes/yaml/grpc-upstream.yaml
kubectl apply -f kubernetes/yaml/http-upstream.yaml
kubectl apply -f kubernetes/yaml/control-plane.yaml

Check if it is working

curl http://http.172.17.0.100.sslip.io
Hello from HTTP Server
grpcurl -plaintext -authority grpc.172.17.0.100.sslip.io grpc.172.17.0.100.sslip.io:80 grpc.health.v1.Health/Check
{
  "status": "SERVING"
}

Adding the WASM module

kubectl apply -f kubernetes/yaml/wasm-plugin-request-buffer.yaml

Scale the deployments to zero

kubectl scale deploy/grpc-upstream -n default --replicas=0
kubectl scale deploy/http-upstream -n default --replicas=0

Send requests again and watch scale-from-zero

watch kubectl get deploy http-upstream grpc-upstream -n default
curl http://http.172.17.0.100.sslip.io
grpcurl -plaintext -authority grpc.172.17.0.100.sslip.io grpc.172.17.0.100.sslip.io:80 grpc.health.v1.Health/Check

Debugging

# get envoy config
istioctl proxy-config all -n default deploy/external-gateway-istio -o json | copyfile
# set debug log in WASM
istioctl proxy-config log deploy/external-gateway-istio -n default --level "wasm:debug"