KCNA — Serverless and FaaS
Serverless and Function as a Service (FaaS)
Serverless computing takes cloud-native to the next level by abstracting infrastructure management entirely. The KCNA exam tests your understanding of serverless concepts and how they relate to Kubernetes.
What Is Serverless?
Serverless doesn’t mean “no servers” — it means you don’t manage the servers. The cloud provider handles provisioning, scaling, and maintenance.
Key characteristics:
- No server management — no patching, no capacity planning
- Pay per execution — charged only when code runs
- Auto-scaling — scales from zero to thousands of instances automatically
- Event-driven — triggered by events (HTTP requests, messages, schedules)
Serverless Categories
| Category | Description | Examples |
|---|---|---|
| FaaS (Function as a Service) | Run individual functions in response to events | AWS Lambda, Azure Functions, Google Cloud Functions |
| BaaS (Backend as a Service) | Managed backend services — databases, auth, storage | Firebase, AWS DynamoDB, Auth0 |
| CaaS (Containers as a Service) | Run containers without managing infrastructure | AWS Fargate, Azure Container Instances, Google Cloud Run |
FaaS — Function as a Service
FaaS is the most common serverless model. You write a function, upload it, and the platform handles everything else.
Event (HTTP, Queue, Timer)
│
▼
┌──────────────────┐
│ FaaS Platform │
│ ┌────────────┐ │
│ │ Function │ │ ← Your code runs here
│ └────────────┘ │
│ Auto-scales │
│ Pay-per-use │
└──────────────────┘
│
▼
Response
FaaS Characteristics
| Feature | Description |
|---|---|
| Cold Start | First invocation may be slow — the platform needs to initialize the runtime |
| Warm Start | Subsequent invocations reuse the existing runtime — much faster |
| Execution Timeout | Functions have maximum execution times (e.g., 15 min for AWS Lambda) |
| Stateless | Functions don’t retain state between invocations |
| Concurrent | Multiple function instances run in parallel automatically |
Serverless on Kubernetes
Knative
Knative is a CNCF Incubating project that brings serverless capabilities to Kubernetes.
Two main components:
| Component | Purpose |
|---|---|
| Knative Serving | Deploy and auto-scale serverless workloads on Kubernetes — scales to zero |
| Knative Eventing | Event-driven architecture — connect event sources to services |
# Knative Service example
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: hello
spec:
template:
spec:
containers:
- image: gcr.io/my-app/hello:latest
ports:
- containerPort: 8080
Knative handles:
- Scale to zero — no pods running when there’s no traffic
- Scale from zero — spin up pods when requests arrive
- Traffic splitting — canary deployments between revisions
- Auto-scaling — scale based on concurrency or request rate
Other Kubernetes Serverless Frameworks
| Framework | Description |
|---|---|
| OpenFaaS | Functions on Kubernetes with a simple developer experience |
| Kubeless | Kubernetes-native serverless framework (archived) |
| Fission | Fast serverless functions on Kubernetes |
| KEDA | Kubernetes Event-Driven Autoscaling — scale based on external events |
Serverless vs Containers
| Aspect | Serverless (FaaS) | Containers (K8s) |
|---|---|---|
| Management | Platform manages everything | You manage orchestration |
| Scaling | Automatic, to zero | Manual config (HPA) or tools (KEDA) |
| Cost | Pay per invocation | Pay for running infrastructure |
| Cold Start | Yes — can be significant | No — pods are already running |
| Execution Time | Limited (seconds to minutes) | Unlimited |
| Use Case | Event-driven, short-lived tasks | Long-running services, complex apps |
| Portability | Vendor lock-in risk | Portable across providers |
When to Use Serverless
Good fit for serverless:
- Event-driven processing (file uploads, webhooks)
- APIs with variable/unpredictable traffic
- Scheduled tasks (cron-like)
- Data transformation pipelines
Better with containers:
- Long-running processes
- Low-latency requirements (no cold start tolerance)
- Complex applications with many dependencies
- Need for fine-grained infrastructure control
KCNA Exam Tips
- Know the difference between FaaS, BaaS, and CaaS
- Knative is the key serverless project to know for KCNA — it’s a CNCF project
- Understand scale to zero — the defining feature of serverless on Kubernetes
- Know what cold starts are and when they’re problematic
- Serverless is event-driven and stateless by design
What’s Next?
Learn about autoscaling in Kubernetes — including HPA, VPA, and event-driven scaling with KEDA.