lxcfs-webhook

module
v1.0.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 3, 2023 License: Apache-2.0

README

lxcfs-webhook

lxcfs docker publish License FOSSA Status GitHub release (latest by date including pre-releases) Last Commit Go Report Card

Automatically deploy LXCFS while mounted to the container

设计

https://kubeservice.cn/2021/04/27/k8s-lxcfs-overview/

动机

Pod 容器内资源可见性:让Pod的资源视角真实、准确

是否有个发现:Pod中限定了CPUMEM等资源大小,然而登入的POD中查询资源,却还是Node总的资源大小?

对于业务上云, java(识别内存资源开辟大小)、golang(识别CPU个数开启runtime线程个数) 等语言,在OOMGC方面的问题,有时常发生的原因

利用lxcfs将容器中读取出来的CPUMEMdiskswaps的信息是宿主机的信息,与容器实际分配和限制的资源量相同。 解决低层通过os.syscall获得的资源信息一致

依赖

  • Kubernetes: >= 1.16.0
  • cert-manager (v1.2+) is installed.
  • helm v3 is installed.

部署

  1. 创建webhook证书
kubectl apply -f ./hack/deployment/certs/ .
  1. 创建lxcfs daemonset.yaml
kubectl apply -f ./hack/deployment/lxcfs/ .
  1. 创建webhook
kubectl apply -f ./hack/deployment/webhook/ .

使用

设置

对需要namespaces 添加 webhook label

kubectl label namespace default lxcfs-admission-webhook=enabled
验证
kubectl apply -f ./hack/examples/httpd-test.yaml

License

FOSSA Status

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL