{"id":26932098,"url":"https://github.com/ctrox/zeropod","last_synced_at":"2026-01-16T03:34:12.925Z","repository":{"id":180530149,"uuid":"655283919","full_name":"ctrox/zeropod","owner":"ctrox","description":"pod that scales down to zero","archived":false,"fork":false,"pushed_at":"2026-01-12T19:57:04.000Z","size":2893,"stargazers_count":827,"open_issues_count":15,"forks_count":31,"subscribers_count":6,"default_branch":"main","last_synced_at":"2026-01-13T00:19:26.646Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ctrox.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-06-18T12:52:51.000Z","updated_at":"2026-01-12T19:47:11.000Z","dependencies_parsed_at":null,"dependency_job_id":"5413cf5c-2bbd-40fe-ab08-9b194b0c4dd9","html_url":"https://github.com/ctrox/zeropod","commit_stats":null,"previous_names":["ctrox/zeropod"],"tags_count":23,"template":false,"template_full_name":null,"purl":"pkg:github/ctrox/zeropod","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrox%2Fzeropod","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrox%2Fzeropod/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrox%2Fzeropod/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrox%2Fzeropod/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ctrox","download_url":"https://codeload.github.com/ctrox/zeropod/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ctrox%2Fzeropod/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28477204,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-16T03:13:13.607Z","status":"ssl_error","status_checked_at":"2026-01-16T03:11:47.863Z","response_time":107,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-02T08:01:09.391Z","updated_at":"2026-01-16T03:34:12.912Z","avatar_url":"https://github.com/ctrox.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# zeropod - pod that scales down to zero\n\nZeropod is a Kubernetes runtime (or more specifically a containerd shim) that\nautomatically checkpoints containers to disk after a certain amount of time of\nthe last TCP connection. While in scaled down state, it will listen on the same\nport the application inside the container was listening on and will restore the\ncontainer on the first incoming connection. Depending on the memory size of the\ncheckpointed program this happens in tens to a few hundred milliseconds,\nvirtually unnoticeable to the user. As all the memory contents are stored to\ndisk during checkpointing, all state of the application is restored. [It adjusts\nresource requests](#in-place-resource-scaling) in scaled down state in-place if\nthe cluster supports it. To prevent huge resource usage spikes when draining a\nnode, scaled down pods can be [migrated between nodes](#zeropodctroxdevmigrate)\nwithout needing to start up. There is also a more experimental [live migration\nfeature](./docs/experimental/migration.md#live-migration) that stretches the\nscaling use cases of zeropod.\n\n## Use cases\n\n* Low traffic sites\n* Dev/Staging environments\n* Providing a small tier on Heroku-like platforms\n* \"Mostly static\" sites that still need some server component\n\n## How it works\n\nFirst off, what is this containerd shim? The shim sits between containerd and\nthe container sandbox. Each pod has such a long-running process that calls out\nto runc to manage the lifecycle of all containers of a pod.\n\n\u003cdetails\u003e\u003csummary\u003eshow containerd architecture\u003c/summary\u003e\n\n![containerd architecture](https://github.com/containerd/containerd/blob/81bc6ce6e9f8f74af1bbbf25126db3b461cb0520/docs/cri/architecture.png)\n\n\u003c/details\u003e\n\nThere are several components that make zeropod work but here are the most\nimportant ones:\n\n* Checkpointing is done using [CRIU](https://github.com/checkpoint-restore/criu).\n* After checkpointing, a userspace TCP proxy (activator) is created on a\n  random port and an eBPF program is loaded to redirect packets destined to\n  the checkpointed container to the activator. The activator then accepts the\n  connection, restores the process, signals to disable the eBPF redirect and\n  then proxies the initial request(s) to the restored application. See\n  [activation sequence](#activation-sequence) for more details.\n* All subsequent connections go directly to the application without any\n  proxying and performance impact.\n* The redirector eBPF program is also used to track the last TCP activity\n  targeting the running application. This helps zeropod delay checkpointing if\n  there is recent activity. This avoids too much flapping on a service that is\n  frequently used.\n* To the container runtime (e.g. Kubernetes), the container appears to be\n  running even though the process is technically not. This is required to\n  prevent the runtime from trying to restart the container.\n* When running `kubectl exec` on to the scaled down container, it will be\n  restored and the exec should work just as with any normal Kubernetes\n  container.\n* Metrics are recorded continuously within each shim and the zeropod-manager\n  process that runs once per node (DaemonSet) is responsible to collect and\n  merge all metrics from the different shim processes. The shim exposes a unix\n  socket for the manager to connect. The manager exposes the merged metrics on\n  an HTTP endpoint.\n\n### Activation sequence\n\nThis diagram shows what happens when a user initiates a connection to a\ncheckpointed container.\n\n\u003cdetails\u003e\u003csummary\u003eshow diagram\u003c/summary\u003e\n\n```mermaid\nsequenceDiagram\n    actor User\n    participant Redirector\n    participant Activator\n    participant Container\n    Note over Container: checkpointed\n    Note over Activator: listening on port 41234\n    User-\u003e\u003eRedirector: TCP connect to port 80\n    Note right of User: local port 12345\n    Redirector-\u003e\u003eRedirector: redirect to port 41234\n    Redirector-\u003e\u003eActivator: TCP connect\n    Activator-\u003e\u003eActivator: TCP accept\n    Activator-\u003e\u003eContainer: restore\n    loop every millisecond\n        Activator-\u003e\u003eContainer: TCP connect to port 80\n    end\n    Note over Container: restored\n    Container--\u003e\u003eActivator: TCP accept\n    Activator--\u003e\u003eRedirector: TCP accept\n    Redirector--\u003e\u003eRedirector: redirect to port 12345\n    Redirector--\u003e\u003eUser: TCP accept\n    Note right of User: connection between user\u003cbr\u003eand container established\n    User-\u003e\u003eContainer: TCP connect to port 80\n    Note over Redirector: pass\n    Container--\u003e\u003eUser: TCP accept\n    Note over Redirector: pass\n```\n\n\u003c/details\u003e\n\n## Compatibility\n\nMost programs should to just work with zeropod out of the box. The\n[examples](./config/examples) directory contains a variety of software that have been\ntested successfully. If something fails, the containerd logs can prove useful\nto figuring out what went wrong as it will output the CRIU log on\ncheckpoint/restore failure. What has proven somewhat flaky sometimes are some\narm64 workloads running in a linux VM on top of Mac OS. If you run into any\nissues with your software, please don't hesitate to create an issue.\n\n## Docs\n\nFor more resources and documentation, head to the [docs](./docs/README.md).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrox%2Fzeropod","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fctrox%2Fzeropod","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fctrox%2Fzeropod/lists"}