Knative: Operator’s Handbook

Making requests

First, find default domains of your Knative Service.

Invoking internally (from other Kubernetes Pods)

As listed in domains, you can query your Knative Service's internal domain name on port 80 within a Kubernetes cluster, and it will go through a load balancer and will be routed to one of the Pods of the KService.

Invoking internally (from outside, for testing)

Run a temporary Pod on your cluster that has curl:

kubectl run --rm --restart=Never \
    -i -t --image="appropriate/curl" tmp-"${RANDOM}"

In the launched Pod, use cURL to call the Service internally:

$ curl -v http://hello.default.svc.cluster.local

Invoking publicly

Find public IP address of your public ingress gateway (load balancer) which routes traffic to your app based on default domains of your app, assigned by Knative.

The gateway reads Host header to find which request belongs to which application. You can use curl to query your app, and specify a Host header that routes the traffic to your Knative Service:

curl -H "Host: hello.default.example.com" http://203.0.113.64

You can also change domain naming format.