<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Admission-Webhook on Zayn's Blog</title><link>https://blog.treesir.pub/tags/admission-webhook/</link><description>Recent content in Admission-Webhook on Zayn's Blog</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>yangzun@treesir.pub (Zayn)</managingEditor><webMaster>yangzun@treesir.pub (Zayn)</webMaster><copyright>2021-2026 Zayn</copyright><lastBuildDate>Fri, 30 Apr 2021 14:10:31 +0800</lastBuildDate><atom:link href="https://blog.treesir.pub/tags/admission-webhook/index.xml" rel="self" type="application/rss+xml"/><item><title>K8s 部署 Lxcfs 准入控制器，实现容器中资源单独可见</title><link>https://blog.treesir.pub/posts/k8s-lxcfs-admissionhook/</link><pubDate>Fri, 30 Apr 2021 14:10:31 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/k8s-lxcfs-admissionhook/</guid><description>&lt;h2 class="relative group">环境说明
&lt;div id="环境说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;ul>
&lt;li>kubernetes version: v1.17.9 (&lt;code>kubeadm&lt;/code>)&lt;/li>
&lt;li>os: 7.8.2003 (Core)&lt;/li>
&lt;li>kubernetes dashboard: rancher &lt;code>v2.4.15&lt;/code>&lt;/li>
&lt;/ul>
&lt;h2 class="relative group">概述
&lt;div id="概述" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e6%a6%82%e8%bf%b0" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>docker 使用 linux 内核中的 &lt;code>cgroup&lt;/code> 实现了对 容器使用资源的限制，默认容器启动后依旧挂载了宿主机的 &lt;code>/proc&lt;/code> 目录，其中包涵了，&lt;code>meminfo&lt;/code>、&lt;code>cpuinfo&lt;/code>、&lt;code>stat&lt;/code>、&lt;code>uptime&lt;/code> 等资源信息。一些监控工具如 &lt;code>free&lt;/code>、&lt;code>top&lt;/code>、&lt;code>htop&lt;/code> 或 &lt;code>业务应用&lt;/code> 还依赖 &lt;code>/proc&lt;/code> 下文件内容获取资源配置和使用情况。当它们在容器中运行时，实际还是查看到的是宿主机的资源使用，导致资源使用展示源不对，目前社区主流的解决方法是使用 &lt;code>lxcfs&lt;/code> 的方法进行解决。&lt;/p></description></item></channel></rss>