Skip to content

cndoit18/lxcfs-on-kubernetes

lxcfs-on-kubernetes

License Artifact Hub CodeQL FOSSA Status

This project will automatically deploy LXCFS while mounted to the container

Introduction

LXCFS is a small FUSE filesystem written with the intention of making Linux containers feel more like a virtual machine. It started as a side-project of LXC but is useable by any runtime.

LXCFS will take care that the information provided by crucial files in procfs such as:

/proc/cpuinfo
/proc/diskstats
/proc/meminfo
/proc/stat
/proc/swaps

/proc/uptime
/proc/slabinfo
/sys/devices/system/cpu
/sys/devices/system/cpu/online

are container aware such that the values displayed (e.g. in /proc/uptime) really reflect how long the container is running and not how long the host is running.

Prerequisites

  1. Kubernetes cluster (v1.19+) is running. For local development purpose, check Kind installation.
  2. cert-manager (v1.2+) is installed.
  3. helm v3 is installed.

Deploy

Run the helm command to install the lxcfs-on-kubernetes to your cluster:

helm repo add lxcfs-on-kubernetes https://cndoit18.github.io/lxcfs-on-kubernetes/

you can then do

helm upgrade --install lxcfs lxcfs-on-kubernetes/lxcfs-on-kubernetes -n lxcfs --create-namespace

For what settings you can override with --set, --set-string, --set-file or --values, you can refer to the values.yaml file.

you can enable the namespace for injection.

kubectl label namespace default mount-lxcfs=enabled

You can change it by setting matchLabels during installation

License

FOSSA Status