Knative: Operator’s Handbook

Anatomy of a KService

Each Knative Service (a.k.a. KService or ksvc) object embeds a Revision spec. Once you modify this section, a new Revision is created.

Each Revision spec embeds Kubernetes Container, which is the spec.containers field of a Kubernetes Pod.

Parts of a KService object:

apiVersion: serving.knative.dev/v1alpha1
kind: Service
metadata:
  name: hello
spec:
  template:
    metadata:‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾|
      [...]                                |
    spec:                                  |
      containers:                          |
      - image: nginx ‾‾‾‾‾‾‾‾‾|            | RevisionSpec
        workingDir: /bin      |            |
        resources:            | Container  |
          limits:             |            |
            cpu: 100m_________|____________|
  traffic:___________________________|
  - latestRevision: true             | TrafficSpec
    percent: 100   __________________|