Knative: Operator’s Handbook

Revisions

Every time you update a Knative Service object's spec.template fields, a new Revision will be created. (You don't need to create Revision objects manually most of the time.)

Revision is a snapshot of the Knative Service. Every time you change your container image, or other settings, it's a new Revision. You can use Revision objects to:

Imagine Revisions as deployed versions of your code + container configuration.

For example, deploy a Service using :1.0 image, then update it with the :2.0 image, which will result in two Revisions:

Show v1.yaml
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
spec:
  template:
    spec:
      containers:
      - image: gcr.io/google-samples/hello-app:1.0
Show v2.yaml
apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
spec:
  template:
    spec:
      containers:
      - image: gcr.io/google-samples/hello-app:2.0

Because we updated the initial configuration, we will end up with two Revision objects. In this case, they have random suffixes in their name:

$ kubectl get revision

NAME                   SERVICE NAME           GENERATION   READY
hello-js4x4            hello-js4x4            1            True
hello-kjzfl            hello-kjzfl            2            True

By default, 100% of the traffic to this Service will go to the latest ready Revision:

$ kubectl describe ksvc hello
[...]
  Traffic:
    Latest Revision:  true
    Percent:          100
    Revision Name:    hello-kjzfl

Things to practice with Revisions: