Skip to content

feat(al2023): add packer scripts to support Nitro Sandboxes - #2884

Merged
shvbsle merged 3 commits into
awslabs:mainfrom
shvbsle:al2023-nov-update-squashed
Nov 9, 2026
Merged

shvbsle merged 3 commits into
awslabs:mainfrom
shvbsle:al2023-nov-update-squashed

Conversation

@shvbsle

@shvbsle shvbsle commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Adds an opt-in Nitro Sandbox image variant for AL2023, gated on enable_pod_isolation (default false). Pods that use the isolated-sandbox or confidential-sandbox RuntimeClass run inside their own Firecracker microVM as a Nitro Enclave sidecar; every other pod keeps running under runc.

Build the AMI with pod-isolation like so:

make k8s=1.36 os_distro=al2023 enable_pod_isolation=true \
  aws_region=us-west-2 subnet_id=<subnet> iam_instance_profile=<profile> \
  associate_public_ip_address=true

Issue #, if available:

Description of changes:

install-pod-isolation.sh:

  • installs the containerd shim from the runtime release archive and the guest image (EIF plus its dm-verity disk) from the same bundle as the other node components through the aws_s3 helper (so a public bucket needs no instance profile), verifying each against its .sha256 sidecar
  • installs Firecracker and the jailer from the upstream Firecracker release (pod_isolation_firecracker_version, default v1.18.0), verifying the tarball against the release's published .sha256.txt
  • installs iproute-tc and erofs-utils, which the shim execs
  • asserts the stock kernel is at least pod_isolation_min_kernel, the first release with the Nitro sandbox extensions, so an older base image fails the build instead of producing nodes that refuse every sandboxed pod
  • reserves the enclave memory pool with nitro_enclaves.mempool
  • installs the CRI proxy unit, and a NodeConfig drop-in that registers both runtime handlers, keeps compressed layers (discard_unpacked_layers = false), points kubelet at the proxy and labels the node eks.amazonaws.com/nitro-sandbox=true

The image is built on an enclave-enabled instance and defaults to m8i.4xlarge / m8g.4xlarge. Supported for Kubernetes 1.36 and 1.37. Includes a unit test that the NodeConfig drop-in parses strictly.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Testing Done

Built with

make k8s=1.36 os_distro=al2023 enable_pod_isolation=true

(x86_64, resolved 1.36.5 / 2026-11-06). Firecracker v1.18.0 came from the GitHub release, and the runtime and guest image from s3://amazon-eks/1.36.5/2026-11-06/; all checksums verified. A node from the AMI joined a 1.36 cluster with the eks.amazonaws.com/nitro-sandbox=true label. isolated-sandbox and confidential-sandbox pods ran, with networking (hostPort, a service-backed app) and an EBS volume working. An isolated pod reports its own guest kernel, not the host's.

See this guide for recommended testing for PRs. Some tests may not apply. Completing tests and providing additional validation steps are not required, but it is recommended and may reduce review time and time to merge.

Adds an opt-in pod isolation image variant for AL2023, gated on
enable_pod_isolation (default false). Pods that use the isolated-sandbox
or confidential-sandbox RuntimeClass run inside their own Firecracker
microVM as a Nitro Enclave sidecar; every other pod keeps running under
runc.

install-pod-isolation.sh:
- installs the containerd shim from the runtime release archive and the
  guest image (EIF plus its dm-verity disk) from the same bundle as the
  other node components through the aws_s3 helper (so a public bucket
  needs no instance profile), verifying each against its .sha256 sidecar
- installs Firecracker and the jailer from the upstream Firecracker
  release (pod_isolation_firecracker_version, default v1.18.0), verifying
  the tarball against the release's published .sha256.txt
- installs iproute-tc and erofs-utils, which the shim execs
- asserts the stock kernel is at least pod_isolation_min_kernel, the first
  release with the Nitro sandbox extensions, so an older base image fails
  the build instead of producing nodes that refuse every sandboxed pod
- reserves the enclave memory pool with nitro_enclaves.mempool
- installs the CRI proxy unit, and a NodeConfig drop-in that registers both
  runtime handlers, keeps compressed layers (discard_unpacked_layers =
  false), points kubelet at the proxy and labels the node
  eks.amazonaws.com/nitro-sandbox=true

The image is built on an enclave-enabled instance and defaults to
m8i.4xlarge / m8g.4xlarge. Supported for Kubernetes 1.36 and 1.37.
Includes a unit test that the NodeConfig drop-in parses strictly.
@shvbsle shvbsle changed the title feat(al2023): add optional pod isolation runtime feat(al2023): add packer scripts to support Nitro Sandboxes Nov 9, 2026
Comment thread doc/usage/al2023.md Resolved
Comment thread doc/usage/al2023.md Resolved
Comment thread Makefile Resolved
- describe the memory pool the way the Nitro Sandbox docs do: reserved at
  boot with nitro_enclaves.mempool, each sandbox takes its full memory from
  it while running, and a sandbox fails to start without it
- drop iproute-tc: the shim no longer execs tc (DNS rate limiting moved to
  eBPF). Keep erofs-utils for mkfs.erofs
- drop rootfs_path and nitro_sandbox from nitro-sandbox.toml; the shim reads
  neither, and attaches rootfs.ext4 from the kernel's directory
- drop After=cri-proxy.service from the kubelet drop-in; Before= in
  cri-proxy.service already orders them
- drop the larger build instance default; the build itself is not heavy
pod_isolation_min_kernel and pod_isolation_enclave_mempool become constants
in install-pod-isolation.sh: they follow the kernel and the runtime, not the
builder.

pod_isolation_firecracker_version now defaults to "latest", resolved from
the release page, and the build fails if it resolves, or is set, to a
release older than v1.18.0, the first that can drive a Nitro Sandbox.
@shvbsle
shvbsle marked this pull request as ready for review November 9, 2026 17:44
@shvbsle
shvbsle requested a review from a team as a code owner November 9, 2026 17:44
@shvbsle
shvbsle requested a review from fletcherw November 9, 2026 17:50
@shvbsle

shvbsle commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Dependency Review fails on main as well; the gosec findings and the x/net advisory are pre-existing and outside this change. I'll raise a separate PR to fix those

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants