Sandbox Flashcards
FaaS adv and disadv
Advantages:
q No provisioning of servers.
q Automatic scaling.
q Reduction of costs.
q Underlying servers shared among different function invocations.
Disadvantages:
q Focused on stateless functions.
q Performance variations due to restart latencies.
q Not suitable for heavy compute-intensive workloads, own VMs might be cheaper.
q Limited security: shared VMs, no control over the network
Containers vs VMs
Containers
§ Using Linux primitives.
§ Share Linux Kernel.
§ Fast Starts, minimal overheads.
§ Flexible Isolation.
Virtual Machines
§ Virtualisation or emulate hardware components.
§ Completely separate kernels.
§ Slower starts, must boot kernel and set-up
hardware.
Container Ecosystem
CRI
Defines an API between K8s and the container runtime.
OCI
Specifications for container images and running containers.
Runc
Implementation of the OCI Spec.
Responsible for creating and running the container processes.
Containerd
Industry-standard container runtime.
Manages complete container lifecycle of its host system, e.g., image transfer and storage,
container execution and supervision.
Fully supports OCI runtime specification for running containers.
Supports snapshotting.
Supports running sandboxes through containerd-shims.
shim
Piece of software that resides between
containerd and a low-level container runtime
(runc, runsc).
Abstract low-level runtimes.
Lives as long as the container process.
In contrast, OCI runtimes just start a fork/exec
container process and then exits.
Intercepts container’s stdin, stdout and stderr
streams and redirects them to logs.
gVisor
Open-source, secure-container runtime, developed by Google
Sentry intercepts the syscalls made by the application
Only few syscalls are made by the sentry to the host linux kernel
Seccomp profile for filtering allowed syscalls by the sentry
Access to filesystem via a separate process called gofer.
Drawbacks:
* Not well suited for syscall heavy workloads
* Not all syscalls are implemented
* Uses containerd-shim-v1 API
AWS Firecracker
VMM that uses KVM to create and manage microVMs.
q Specifically designed for serverless computing.
Kata Containers
Secure and isolated containers with a seperate kernel
WebAssembly
Binary format, with alternative human-readable
text representation
WebAssembly module
Application code as WASM ISA
Defines functions, globals, memories, imports,
exports, static data
WebAssembly Embedder
Parses WASM modules and executes the
application code
Execution strategies:
* Interpreter (Blockchain Smart Contracts,
Browser)
* JIT (Browser, Standalone)
* AOT (Standalone)
krustlet
Enables running WebAssembly workloads natively on Kubernetes
Knative
Platform which deploys on top of K8s.
Knative Eventing enables event-driven
architecture for applications, e.g.,
producer/consumer
Knative Serving
Provides scale-to-zero, request-driven
functionality
Traditional CI/CD Push-based Workflow
Starts with the CI system and then continues its path through a series of encoded scripts
to push changes to the Kubernetes cluster.
Adv:
✚ ease of use
✚ Not bound to the specific tool
Disadv:
− Cluster credentials are inside the build
system, requires to open the firewall.
− CI/CD through scripts is not declarative and
takes effort to make idempotent and
reconcile the state.