Cette page est affichée en anglais. Une traduction française est en cours.
SkillsApr 15, 2026·3 min de lecture

Knative Serving — Serverless and Event-Driven Workloads on Kubernetes

Knative Serving brings request-driven autoscaling, revision management and a simple Service CRD to Kubernetes so developers can deploy containers as HTTP-accessible services that scale to zero.

Prêt pour agents

Installation agent prête

Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
Knative Serving
Commande d'installation directe
npx -y tokrepo@latest install db3b0313-38e7-11f1-9bc6-00163e2b0d79 --target codex

À exécuter après confirmation du plan en dry-run.

TL;DR
Knative Serving adds scale-to-zero autoscaling and traffic splitting to Kubernetes workloads.
§01

What it is

Knative Serving is the serverless sub-project of Knative, a CNCF incubating project started at Google. It layers request-driven autoscaling and traffic-splitting on top of Kubernetes, so teams can focus on container images instead of wiring Deployments, HPAs, Services, and Ingresses together.

Knative introduces a simple Service CRD that owns Configurations, Revisions, and Routes. It scales workloads from zero to thousands of pods based on concurrency or requests per second.

§02

How it saves time or tokens

Knative Serving removes the boilerplate of configuring Kubernetes Deployments, HorizontalPodAutoscalers, Services, and Ingresses for each workload. A single Service CRD replaces all four resources. Scale-to-zero means idle workloads consume no resources, reducing infrastructure costs. Traffic splitting across revisions enables canary and blue/green deployments without a separate tool.

§03

How to use

  1. Install Knative Serving on an existing cluster:
kubectl apply -f https://github.com/knative/serving/releases/latest/download/serving-crds.yaml
kubectl apply -f https://github.com/knative/serving/releases/latest/download/serving-core.yaml
kubectl apply -f https://github.com/knative/net-kourier/releases/latest/download/kourier.yaml
kubectl patch configmap/config-network -n knative-serving \
  --type merge -p '{"data":{"ingress-class":"kourier.ingress.networking.knative.dev"}}'
  1. Deploy a service:
kn service create hello \
  --image=ghcr.io/knative/helloworld-go:latest \
  --port=8080
kn service list
  1. Split traffic between revisions for canary deployments:
kn service update hello --traffic hello-00001=80 --traffic hello-00002=20
§04

Example

A Knative Service manifest with concurrency-based autoscaling:

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
  name: api-backend
spec:
  template:
    metadata:
      annotations:
        autoscaling.knative.dev/target: '100'
        autoscaling.knative.dev/minScale: '0'
        autoscaling.knative.dev/maxScale: '50'
    spec:
      containers:
        - image: myregistry/api-backend:v2
          ports:
            - containerPort: 8080
          resources:
            requests:
              cpu: 200m
              memory: 256Mi
§05

Related on TokRepo

§06

Common pitfalls

  • Cold start latency when scaling from zero can be problematic for latency-sensitive APIs. Set minScale to 1 for critical services.
  • Not configuring the networking layer (Kourier, Istio, or Contour) correctly causes service URLs to be unreachable. Verify the ingress configuration after installation.
  • Knative's default concurrency target of 100 may not suit all workloads. Profile your application and adjust the autoscaling target accordingly.

Questions fréquentes

What is the difference between Knative Serving and Knative Eventing?+

Knative Serving handles request-driven HTTP workloads with autoscaling and traffic management. Knative Eventing handles event-driven architectures with brokers, triggers, and event sources. They can be used independently or together.

Does Knative Serving support scale-to-zero?+

Yes. When no requests arrive, Knative scales the workload down to zero pods. When a request comes in, the activator component holds it while a pod starts up. This saves resources for infrequently used services.

What networking options does Knative support?+

Knative supports Kourier (lightweight, recommended for most setups), Istio (full service mesh), and Contour as networking layers. Each provides different tradeoffs between simplicity and features.

Can I do blue/green deployments with Knative?+

Yes. Knative creates a new Revision for each configuration change. You can route 100% of traffic to the new revision (blue/green) or split traffic between revisions (canary) using the traffic configuration.

Is Knative production-ready?+

Yes. Knative is a CNCF incubating project with production deployments at Google Cloud Run, IBM Cloud Code Engine, and many enterprises. It has a stable API and regular releases.

Sources citées (3)

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires