3.3 KiB
3.3 KiB
Kata Containers
#kubernetes #security #sandbox #słownik
Co to jest?
Kata Containers to technologia łącząca lekkość kontenerów z bezpieczeństwem maszyn wirtualnych. Każdy kontener (lub pod) uruchamiany jest wewnątrz dedykowanej, lekkiej VM z własnym kernelem.
Jak działa?
Bez Kata:
Container → shared Host Kernel
Z Kata:
Container → Guest Kernel (dedykowany) → Hypervisor (QEMU/Cloud Hypervisor) → Host Kernel
Każdy pod dostaje:
- Własny kernel Linux (guest kernel)
- Własną przestrzeń pamięci (izolacja hypervisora)
- Dedykowany agent (kata-agent) zarządzający kontenerem wewnątrz VM
Architektura
┌──────────────────────────────────┐
│ Host (Node) │
│ │
│ ┌────────────────────────────┐ │
│ │ Lightweight VM │ │
│ │ ┌──────────────────────┐ │ │
│ │ │ Container │ │ │
│ │ │ (agent pod) │ │ │
│ │ └──────────────────────┘ │ │
│ │ Guest Kernel (Linux) │ │
│ └────────────────────────────┘ │
│ Hypervisor (QEMU/Cloud HV/FC) │
│ Host Kernel │
└──────────────────────────────────┘
Hypervisory wspierane
| Hypervisor | Opis | Użycie |
|---|---|---|
| QEMU | Pełnofunkcyjny, uniwersalny | Domyślny |
| Cloud Hypervisor | Zoptymalizowany dla cloud-native | Produkcja |
| Firecracker | Micro-VM od AWS (Lambda/Fargate) | Serverless |
| ACRN | Dla IoT/embedded | Specjalistyczny |
Porównanie z gVisor
| Aspekt | gVisor | Kata Containers |
|---|---|---|
| Mechanizm | User-space kernel (Sentry) | Lightweight VM (hypervisor) |
| Izolacja | Przechwytywanie syscalls | Pełna izolacja kernela |
| Overhead | 5-10% | 15-20% |
| Kompatybilność | ~95% syscalls | ~99% |
| Startup time | Szybki (~100ms) | Wolniejszy (~500ms-2s) |
| Memory overhead | Niski (~20MB) | Wyższy (~50-100MB per VM) |
| GPU support | Ograniczone | Lepsze (PCI passthrough) |
| Bezpieczeństwo | Silne | Najsilniejsze (VM boundary) |
Kiedy Kata vs gVisor?
Wybierz gVisor gdy:
- Potrzebujesz niskiego overhead
- Workload jest I/O-intensive
- Chcesz szybki startup
Wybierz Kata gdy:
- Potrzebujesz najsilniejszej izolacji (compliance, untrusted code)
- Workload wymaga pełnej kompatybilności syscalls
- GPU passthrough jest potrzebny
Użycie w Kubernetes
Kata integruje się przez RuntimeClass:
apiVersion: node.k8s.io/v1
kind: RuntimeClass
metadata:
name: kata
handler: kata-qemu
Użycie w Sympozium
agentSandbox:
enabled: true
runtimeClass: kata
Wymaga: Kata Containers zainstalowane na nodach + RuntimeClass kata.
Powiązane: gVisor | Agent Sandbox - gVisor i Kata | RuntimeClass | Model bezpieczeństwa Defence-in-Depth