- Request Initiation:
- A user sends a request to an application hosted on Knative.
- This request first hits the
Istio Ingress Gateway
, which is the entry point for external traffic into the Kubernetes cluster.
- VirtualService Routing:
- The
Istio Ingress Gateway
uses IstioVirtualService
to determine where to route the request. Knative sets up these VirtualServices when a service is created or updated. - Typically, the
VirtualService
will point to theKnative Activator
when the application is scaled to zero or during scaling up from zero.
- The
- Activator:
- The
Activator
is responsible for starting up instances of the application (Pods) when there are none running. It plays a crucial role in scale-to-zero functionality. - If an application is scaled to zero (no active pods), the
Activator
receives the incoming request, triggers the Kubernetes deployment to start a new pod, and then buffers incoming requests until the pod is ready to handle them. - Once the pod is running and ready, the
Activator
forwards the buffered requests to the pod.
- The
- Autoscaler:
- The
Autoscaler
component in Knative observes traffic load and scales the application pods up or down based on the configuration (like concurrency-based metrics) and actual traffic. - It receives metrics about ongoing traffic and makes decisions on when to scale. The
Activator
also plays a part in this by sending metrics to theAutoscaler
when it’s buffering requests for scaled-to-zero applications.
- The
- Knative Service and Revisions:
- In Knative, when you create a
Service
(not to be confused with Kubernetes Service), it represents a specific configuration of your application. - Each time you modify the
Service
, Knative creates a newRevision
. EachRevision
is a snapshot of the code and configurations for a particular version of the service. - The actual running code is encapsulated in a Kubernetes deployment associated with that
Revision
.
- In Knative, when you create a
- Knative Route:
- The
Route
is responsible for determining whichRevision
of aService
receives traffic. You can set up theRoute
to split traffic between multipleRevisions
for blue-green deployments, canary releases, etc. - Combined with
VirtualService
, it ensures the right revisions of your application are being routed traffic.
- The
- Request Completion:
- After the application processes the request, the response travels back through the same path: from the pod to (possibly) the
Activator
, and then out through theIstio Ingress Gateway
to the user.
- After the application processes the request, the response travels back through the same path: from the pod to (possibly) the
Latest posts by Rajesh Kumar (see all)
- Best AI tools for Software Engineers - November 4, 2024
- Installing Jupyter: Get up and running on your computer - November 2, 2024
- An Introduction of SymOps by SymOps.com - October 30, 2024