{"id":34117238,"url":"https://github.com/kubeservice-stack/lxcfs-webhook","last_synced_at":"2026-03-09T08:32:25.498Z","repository":{"id":65163527,"uuid":"583266711","full_name":"kubeservice-stack/lxcfs-webhook","owner":"kubeservice-stack","description":"Deploy FUSE filesystem for LXC","archived":false,"fork":false,"pushed_at":"2026-03-04T11:54:22.000Z","size":8975,"stargazers_count":12,"open_issues_count":5,"forks_count":1,"subscribers_count":3,"default_branch":"main","last_synced_at":"2026-03-04T17:42:36.724Z","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":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kubeservice-stack.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-12-29T09:06:27.000Z","updated_at":"2026-03-04T10:48:17.000Z","dependencies_parsed_at":"2025-12-12T08:06:53.675Z","dependency_job_id":null,"html_url":"https://github.com/kubeservice-stack/lxcfs-webhook","commit_stats":{"total_commits":46,"total_committers":3,"mean_commits":"15.333333333333334","dds":0.06521739130434778,"last_synced_commit":"958de0d5260606a9c4f053fd5a58ea7a1f5dc016"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"purl":"pkg:github/kubeservice-stack/lxcfs-webhook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubeservice-stack%2Flxcfs-webhook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubeservice-stack%2Flxcfs-webhook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubeservice-stack%2Flxcfs-webhook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubeservice-stack%2Flxcfs-webhook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kubeservice-stack","download_url":"https://codeload.github.com/kubeservice-stack/lxcfs-webhook/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kubeservice-stack%2Flxcfs-webhook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30287840,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-09T02:57:19.223Z","status":"ssl_error","status_checked_at":"2026-03-09T02:56:26.373Z","response_time":61,"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-12-14T20:28:35.975Z","updated_at":"2026-03-09T08:32:25.478Z","avatar_url":"https://github.com/kubeservice-stack.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# lxcfs-webhook\n[![lxcfs docker publish](https://github.com/kubeservice-stack/lxcfs-webhook/actions/workflows/lxcfs.yml/badge.svg?branch=main)](https://github.com/kubeservice-stack/lxcfs-webhook/actions/workflows/lxcfs.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkubeservice-stack%2Flxcfs-webhook.svg?type=shield)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkubeservice-stack%2Flxcfs-webhook?ref=badge_shield)\n![GitHub release (latest by date including pre-releases)](https://img.shields.io/github/v/release/kubeservice-stack/lxcfs-webhook?include_prereleases)\n[![Last Commit](https://img.shields.io/github/last-commit/kubeservice-stack/lxcfs-webhook)](https://github.com/kubeservice-stack/lxcfs-webhook)\n[![Go Report Card](https://goreportcard.com/badge/github.com/kubeservice-stack/lxcfs-webhook)](https://goreportcard.com/report/github.com/kubeservice-stack/lxcfs-webhook)\n[![Go Reference](https://pkg.go.dev/badge/github.com/kubeservice-stack/lxcfs-webhook.svg)](https://pkg.go.dev/github.com/kubeservice-stack/lxcfs-webhook)\n\nAutomatically deploy LXCFS while mounted to the container\n\n## 设计\n[https://kubeservice.cn/2021/04/27/k8s-lxcfs-overview/](https://kubeservice.cn/2021/04/27/k8s-lxcfs-overview/)\n\n## 动机\nPod 容器内资源可见性：让Pod的资源视角真实、准确\n\n❓**是否有个发现：`Pod`中限定了`CPU`、`MEM`等资源大小，然而登入的`POD`中查询资源，却还是`Node`总的资源大小？**\n\n对于**业务上云**, java（识别`内存资源`开辟`堆`大小）、golang(识别`CPU个数`开启`runtime线程个数`) 等语言，在`OOM`、`GC`方面的问题，有时常发生的原因\n\n利用lxcfs将`容器`中读取出来的`CPU`、`MEM`、`disk`、`swaps`的信息是宿主机的信息，与容器实际分配和限制的资源量相同。 解决低层通过`os.syscall`获得的资源信息一致\n\n## 依赖\n\n* Kubernetes: \u003e= `1.16.0`\n* cert-manager (v1.2+) is installed.\n* helm v3 is installed.\n* glibc 2.28+\n\n## 部署\n\n1. 创建webhook证书\n```bash\nkubectl apply -f ./hack/deployment/certs/ .\n```\n\n2. 创建lxcfs daemonset.yaml\n```bash\nkubectl apply -f ./hack/deployment/lxcfs/ .\n```\n\n3. 创建webhook\n```bash\nkubectl apply -f ./hack/deployment/webhook/ .\n```\n\n## 使用\n\n### 设置\n对需要`namespaces` 添加 webhook label\n\n```bash\nkubectl label namespace default lxcfs-admission-webhook=enabled\n```\n\n### 验证\n\n```bash\nkubectl apply -f ./hack/examples/httpd-test.yaml\n```\n\n### 问题一\n\n在高版本centos中：\n```\nerror while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory\n```\n\n解决方式：\n```\nsudo ln -s /usr/lib64/libtinfo.so.6.1 /usr/lib64/libtinfo.so.5\n```\n### 问题二\n[Kubernetes LXCFS故障恢复后，对现有Pod 进行 remount 操作](https://kubeservice.cn/2022/04/13/k8s-lxcfs-remount/)\n\n### 问题三\nNode节点的glibc支持的GLIBC版本问题，要求支持`GLIBC_2.23`以上\n\n| lxcfs | GLIBC version |  |\n| ----- | ------------- | ------------- |\n| [v4.0.12-ubuntu16.04](https://hub.docker.com/r/dongjiang1989/lxcfs/tags) | GLIBC_2.23 | - |\n| [v4.0.12-centos](https://github.com/kubeservice-stack/lxcfs-webhook/pkgs/container/lxcfs) | GLIBC_2.17 | - |\n| [v6.0.3-ubuntu20.04](https://hub.docker.com/r/dongjiang1989/lxcfs/tags)  | GLIBC_2.31 | 支持fuse3 or fuse2.9.9+|\n\n```\n$ strings /lib64/libc.so.6 | grep GLIBC_\nGLIBC_2.16\nGLIBC_2.17\nGLIBC_2.18\nGLIBC_2.22\nGLIBC_2.23\nGLIBC_2.24\nGLIBC_2.25\nGLIBC_2.26\nGLIBC_2.27\nGLIBC_2.28\nGLIBC_2.29\nGLIBC_2.30\nGLIBC_PRIVATE\n```\n\nPS: 如果glibc支持的版本只能到2.17, 请使用旧版本镜像\n```\n$ docker pull ghcr.io/kubeservice-stack/lxcfs:v4.0.12\n$ docker pull ghcr.io/kubeservice-stack/lxcfs-webhook:latest\n```\n### 问题四\nremount inode需要业务容器中包含： `which` 和 `mount` 工具\n\n## License\n[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Fkubeservice-stack%2Flxcfs-webhook.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Fkubeservice-stack%2Flxcfs-webhook?ref=badge_large)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubeservice-stack%2Flxcfs-webhook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkubeservice-stack%2Flxcfs-webhook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkubeservice-stack%2Flxcfs-webhook/lists"}