{"id":28600891,"url":"https://github.com/labring/cri-shim","last_synced_at":"2025-06-11T14:39:14.514Z","repository":{"id":251018719,"uuid":"836148780","full_name":"labring/cri-shim","owner":"labring","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-18T03:54:00.000Z","size":159,"stargazers_count":1,"open_issues_count":0,"forks_count":3,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-02-18T04:28:26.154Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/labring.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-07-31T08:50:46.000Z","updated_at":"2025-02-18T03:54:04.000Z","dependencies_parsed_at":"2024-10-25T06:27:11.922Z","dependency_job_id":"cd3a8633-de68-4baa-9741-c5c3ebb4583b","html_url":"https://github.com/labring/cri-shim","commit_stats":null,"previous_names":["labring/cri-shim"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fcri-shim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fcri-shim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fcri-shim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fcri-shim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/labring","download_url":"https://codeload.github.com/labring/cri-shim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/labring%2Fcri-shim/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259280921,"owners_count":22833476,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-06-11T14:39:13.641Z","updated_at":"2025-06-11T14:39:14.494Z","avatar_url":"https://github.com/labring.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Container Runtime shim for Kubernetes\n\nThis is a shim for containerd that implements the Kubernetes CRI (Container Runtime Interface).\n\n## Usage\n\nThe shim is a standalone binary that implements the Kubernetes CRI. It is designed to be run as a separate process from\ncontainerd. The shim listens on a UNIX socket for CRI requests from the kubelet. The shim forwards these requests to\ncontainerd using the containerd gRPC API.\n\n## Building\n\n```bash\nmake build\n```\n\n## Running\n\n### Run the shim\n\n```bash\nmkdir -p /var/run/sealos \u0026\u0026 touch /var/run/sealos/cri-shim.sock\nsudo ./bin/cri-shim --cri-socket=unix:///var/run/containerd/containerd.sock --shim-socket=/var/run/sealos/cri-shim.sock\n```\n\n### Update the kubelet configuration\n\nChange the kubelet configuration to use the shim, for example:\n\n```bash\nvim /etc/systemd/system/kubelet.service.d/10-kubeadm.conf\n\n# add flag --container-runtime-endpoint to the kubelet\n\ne.g:\nExecStart=/usr/bin/kubelet --container-runtime-endpoint=unix:///var/run/sealos/cri-shim.sock\n```\n\n### Restart the kubelet\n\n```bash\nsudo systemctl daemon-reload\nsudo systemctl restart kubelet\n```\n\n## Testing\n\nCreate a pod using yaml file: `test/busybox.yaml`, then after pod created, exec into the pod and run command create a\nfile in the pod directory.\n\n```bash\n# you may need to change the image registry addr, user, password and related env to the one you have\nkubectl apply -f test/busybox.yaml\nkubectl exec -it commit -n commit-test -c busybox-1 -- sh -c 'echo \"hello world\" \u003e /tmp/test \u0026\u0026 cat /tmp/test'\n```\n\nDelete the pod:\n\n```bash\nkubectl delete pod commit -n commit-test\n```\n\nSee the logs of the shim and check images in k8s.io namespace:\n\n```bash\ncrictl images\n```\n\nAfter the pod is deleted, the commit image should be generated.\n\nEdit the pod yaml file: `test/busybox.yaml`, change the image to `docker.io/labring/busybox-commit:dev`, then apply the\nyaml file again.\n\n```bash\nkubectl apply -f test/busybox.yaml\n```\n\nExec into the pod and check the file created before:\n\n```bash\nkubectl exec -it commit -n commit-test -c busybox-1 -- cat /tmp/test\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabring%2Fcri-shim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flabring%2Fcri-shim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flabring%2Fcri-shim/lists"}