Correct the linux container's CGroup-view by LXCFS and kubernetes admission webhook
Explore the docs »
Report Bug
·
Request Feature
Table of Contents
LXCFS is a simple userspace filesystem designed to work around some current limitations of the Linux kernel.
This project run LXCFS as kubernetes daemonset and expose a set of files which can be bind-mounted over kubernetes pod's /proc originals to provide CGroup-aware values.
Also provide a kubernetes admission webhook make the pod which need to correct their CGroup-view to auto bind-mount LXCFS files.
This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.
- Kubernetes version
Kubernetes v1.16 or above with the
admissionregistration.k8s.io/v1
API enabled. Verify that by the following command:The result should be:kubectl api-versions | grep admissionregistration.k8s.io/v1
The APIadmissionregistration.k8s.io/v1
admissionregistration.k8s.io/v1beta1
not tested, not recommended.
-
Clone the repo
git clone https://github.com/ymping/lxcfs-admission-webhook.git
-
Run install script
Default install webhook and LXCFS service in kubernetes namespace
lxcfs
, useinstall.sh --namespace your_ns
to deploy service in specify namespace.cd deploy ./install.sh
-
Go to usage section see how to usage
-
Uninstall
Default uninstall webhook and LXCFS service in kubernetes namespace
lxcfs
, useuninstall.sh --namespace your_ns
to uninstall service in specify namespace.cd deploy ./uninstall.sh
- Add lable
lxcfs-admission-webhook=enabled
to namespace which you want to correct the linux container's CGroup-view.kubectl label namespaces your_namespace lxcfs-admission-webhook=enabled
- If you want disable this feature on some specify pod,
add an annotation
mutating.lxcfs-admission-webhook.io/enable
to the pod, the webhook will skip patch this pod when create it.
- Support helm installation
See the open issues for a full list of proposed features (and known issues).
Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request.
Distributed under the Apache License 2.0. See LICENSE
for more information.
ymping - ympiing@gmail.com
Project Link: https://github.com/ymping/lxcfs-admission-webhook
-
'unknown revision v0.0.0' errors during development, run
go-get-k8s-pkg.sh vXXX
to fix,vXXX
is kubernetes version, examplego-get-k8s-pkg.sh v1.23.3