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:
kubectl get revisionsTraffic Splitting
Knative supports gradual rollouts by splitting traffic between revisions:
apiVersion: serving.knative.dev/v1kind: Servicemetadata: name: hellospec: traffic: - revisionName: hello-00001 percent: 50 - revisionName: hello-00002 percent: 50Auto-scaling
Knative automatically scales your application based on incoming requests, including scaling to zero when idle.
Configure scaling parameters:
apiVersion: serving.knative.dev/v1kind: Servicemetadata: name: hellospec: 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-goThese features make Knative ideal for serverless workloads!