Core Concepts

Let’s explore the key concepts that make Knative powerful for serverless applications.

Revisions

Every time you update a Knative Service, a new Revision is created. Revisions are immutable snapshots of your code and configuration.

List revisions:

Terminal window
kubectl get revisions

Traffic Splitting

Knative supports gradual rollouts by splitting traffic between revisions:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: hello
spec:
traffic:
- revisionName: hello-00001
percent: 50
- revisionName: hello-00002
percent: 50

Auto-scaling

Knative automatically scales your application based on incoming requests, including scaling to zero when idle.

Configure scaling parameters:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: hello
spec:
template:
metadata:
annotations:
autoscaling.knative.dev/target: "10"
autoscaling.knative.dev/minScale: "1"
autoscaling.knative.dev/maxScale: "10"
spec:
containers:
- image: gcr.io/knative-samples/helloworld-go

These features make Knative ideal for serverless workloads!