<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/">
    <channel>
        <title>皈依的博客</title>
        <link>https://tangly1024.com/</link>
        <description>云原生小白</description>
        <lastBuildDate>Sun, 10 May 2026 03:36:55 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <language>zh-CN</language>
        <copyright>All rights reserved 2026, NotionNext</copyright>
        <item>
            <title><![CDATA[添加work节点]]></title>
            <link>https://tangly1024.com/article/318db897-8f81-80b1-8803-cec9e5f72800</link>
            <guid>https://tangly1024.com/article/318db897-8f81-80b1-8803-cec9e5f72800</guid>
            <pubDate>Wed, 04 Mar 2026 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-318db8978f8180b18803cec9e5f72800"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-318db8978f8180a395b4c76abdbe93ae" data-id="318db8978f8180a395b4c76abdbe93ae"><span><div id="318db8978f8180a395b4c76abdbe93ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f8180a395b4c76abdbe93ae" title="work节点进行初始化操作"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>work节点进行初始化操作</b></span></span></h2><div class="notion-text notion-block-318db8978f818010897ee643a1c7bee3">可参考笔记kubeadm安装部署章节环境准备、安装容器运行时操作，完成初始化工作</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-318db8978f818036b815de991f0dfb9b" data-id="318db8978f818036b815de991f0dfb9b"><span><div id="318db8978f818036b815de991f0dfb9b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f818036b815de991f0dfb9b" title="master节点查询join命令"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>master节点查询join命令</b></span></span></h2><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-318db8978f8180da9471f9245ef9a255" data-id="318db8978f8180da9471f9245ef9a255"><span><div id="318db8978f8180da9471f9245ef9a255" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f8180da9471f9245ef9a255" title="work节点执行join命令"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>work节点执行join命令</b></span></span></h2><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-318db8978f81801abc81c6415ac59310" data-id="318db8978f81801abc81c6415ac59310"><span><div id="318db8978f81801abc81c6415ac59310" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81801abc81c6415ac59310" title="master节点查看node信息"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>master节点查看node信息</b></span></span></h2><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-318db8978f8180aea846f767dc7c9cdb" data-id="318db8978f8180aea846f767dc7c9cdb"><span><div id="318db8978f8180aea846f767dc7c9cdb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f8180aea846f767dc7c9cdb" title="添加节点标签"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>添加节点标签</b></span></span></h2><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-318db8978f818064aaabc3b24e266ffa" data-id="318db8978f818064aaabc3b24e266ffa"><span><div id="318db8978f818064aaabc3b24e266ffa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f818064aaabc3b24e266ffa" title="节点INTERNAL-IP 不准确问题"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title"><b>节点INTERNAL-IP 不准确问题</b></span></span></h2><div class="notion-text notion-block-318db8978f81803fbe16ef309cc8f043">当节点存在多网卡的时候，kubectl get node -o wide 显示的节点 ip 可能存在不准确的问题</div><ol start="1" class="notion-list notion-list-numbered notion-block-318db8978f81803a96a8cd77885a4026" style="list-style-type:decimal"><li>修改配置文件/etc/default/kubelet (默认不存在该文件，需要新增创建）</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-318db8978f81809a9d34eee2e2e9df4b" style="list-style-type:decimal"><li>重启kubelet service</li></ol><ol start="1" class="notion-list notion-list-numbered notion-block-318db8978f81804bae86ddca6a8f4608" style="list-style-type:decimal"><li>确认修改生效</li></ol><div class="notion-text notion-block-318db8978f8180c38da1f8d19628e499"><code class="notion-inline-code">kubectl get node -o wide</code></div><div class="notion-blank notion-block-318db8978f81809ab483c800cbffd085"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[K8s部署Prometheus和Grafana监控平台]]></title>
            <link>https://tangly1024.com/article/8e6a1b5a-c432-43a4-9ad0-0f264b39cbb9</link>
            <guid>https://tangly1024.com/article/8e6a1b5a-c432-43a4-9ad0-0f264b39cbb9</guid>
            <pubDate>Mon, 19 Aug 2024 00:00:00 GMT</pubDate>
        </item>
        <item>
            <title><![CDATA[Kubernetes 驱逐 vs 封禁]]></title>
            <link>https://tangly1024.com/article/318db897-8f81-8052-a6e1-eb68b232063d</link>
            <guid>https://tangly1024.com/article/318db897-8f81-8052-a6e1-eb68b232063d</guid>
            <pubDate>Wed, 04 Mar 2026 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-318db8978f818052a6e1eb68b232063d"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-318db8978f81804cafc9d50b459d838f" data-id="318db8978f81804cafc9d50b459d838f"><span><div id="318db8978f81804cafc9d50b459d838f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81804cafc9d50b459d838f" title="概念对比"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">概念对比</span></span></h3><table class="notion-simple-table notion-block-318db8978f8180edb09acee6f81a7586"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-318db8978f818038abf1e1e26e2c87ac"><td class="" style="width:120px"><div class="notion-simple-table-cell">特性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">驱逐 (Eviction)</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">封禁 (Cordon)</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f8180a79f96fea4d67503a0"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>作用</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">强制删除 Pod</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">标记节点不可调度</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f8180cd9f1ce79c0d9b63a2"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>对象</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Pod</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">节点</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f8180a68622c23f24b2ae7e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>触发条件</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">资源不足、策略触发</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">手动执行</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f8180889720d64fa2fddf3e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Pod 状态</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">终止，重新调度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">保持运行</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f818031b557f61e86735d4a"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>是否可恢复</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Pod 会被重新调度到其他节点</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">可解封 (Uncordon)</div></td></tr></tbody></table><hr class="notion-hr notion-block-318db8978f8180d7badecd9228d701a1"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-318db8978f81809ab94ff2559c04b3d1" data-id="318db8978f81809ab94ff2559c04b3d1"><span><div id="318db8978f81809ab94ff2559c04b3d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81809ab94ff2559c04b3d1" title="详细解释"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">详细解释</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-318db8978f818068a41ef71ae9c72617" data-id="318db8978f818068a41ef71ae9c72617"><span><div id="318db8978f818068a41ef71ae9c72617" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f818068a41ef71ae9c72617" title="🔴 驱逐 (Eviction)"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">🔴 驱逐 (Eviction)</span></span></h4><div class="notion-text notion-block-318db8978f8180189671d52b31d4c0ef"><b>将 Pod 从节点上强制移除</b></div><div class="notion-text notion-block-318db8978f818006bee2c2618bbd6380"><b>触发原因：</b></div><ul class="notion-list notion-list-disc notion-block-318db8978f8180e6b056f5403bceee2d"><li>节点资源不足（内存、磁盘、CPU）</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f8180ae9b16c17fafa2bcba"><li>节点故障</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f8180ccba97f7dcdb472bb7"><li>手动执行 <code class="notion-inline-code">kubectl evict</code></li></ul><div class="notion-text notion-block-318db8978f8180af8cace51200a7a02d"><b>特点：</b></div><ul class="notion-list notion-list-disc notion-block-318db8978f818070ba09eccfd23bd65b"><li>Pod 会被删除</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f8180dbbdc2fcd4b5e4f608"><li>Deployment/StatefulSet 会自动重新创建 Pod</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f8180ccb172d68ba8f7e1fd"><li>Pod 会被调度到其他健康节点</li></ul><hr class="notion-hr notion-block-318db8978f81801387e4f987eb0d3152"/><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-318db8978f81805d8cb8feb13f8d8aba" data-id="318db8978f81805d8cb8feb13f8d8aba"><span><div id="318db8978f81805d8cb8feb13f8d8aba" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81805d8cb8feb13f8d8aba" title="🟡 封禁 (Cordon)"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">🟡 封禁 (Cordon)</span></span></h4><div class="notion-text notion-block-318db8978f818041b33fe3ed11152b39"><b>将节点标记为不可调度，新 Pod 不会分配到该节点</b></div><div class="notion-text notion-block-318db8978f8180538fe8d30aa79b1133"><b>触发原因：</b></div><ul class="notion-list notion-list-disc notion-block-318db8978f8180a497e9d10a5d1ea535"><li>节点维护</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f81806a97e0e3105e298b43"><li>节点准备下线</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f8180779b4fe9cb2b675985"><li>节点资源不足预警</li></ul><div class="notion-text notion-block-318db8978f8180f4b0f3d3870b9132cc"><b>特点：</b></div><ul class="notion-list notion-list-disc notion-block-318db8978f818083831bfb5daf3e436f"><li>节点上的现有 Pod 继续运行</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f8180eebab1c788285cd1d6"><li>新 Pod 不会被调度到该节点</li></ul><ul class="notion-list notion-list-disc notion-block-318db8978f81805e822fd57ece313f57"><li>可随时解封恢复</li></ul><hr class="notion-hr notion-block-318db8978f8180ada208ee3b4b823363"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-318db8978f818050888ffec66016cb78" data-id="318db8978f818050888ffec66016cb78"><span><div id="318db8978f818050888ffec66016cb78" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f818050888ffec66016cb78" title="图示对比"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">图示对比</span></span></h3><hr class="notion-hr notion-block-318db8978f818068b0c4f19ffc18c80d"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-318db8978f81806a9b56cc944d2edcb6" data-id="318db8978f81806a9b56cc944d2edcb6"><span><div id="318db8978f81806a9b56cc944d2edcb6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81806a9b56cc944d2edcb6" title="使用场景"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">使用场景</span></span></h3><table class="notion-simple-table notion-block-318db8978f81804096f9d56343a45709"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-318db8978f818042862cf65a03936d50"><td class="" style="width:120px"><div class="notion-simple-table-cell">场景</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">使用命令</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f81807db323d3ebf5521c6c"><td class="" style="width:120px"><div class="notion-simple-table-cell">节点故障，需要迁移 Pod</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl drain</code>（会驱逐 + 封禁）</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f81808a8ff3f98fb9471559"><td class="" style="width:120px"><div class="notion-simple-table-cell">节点维护，暂时不分配新 Pod</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl cordon</code></div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f818093a00eea48ff3ddfff"><td class="" style="width:120px"><div class="notion-simple-table-cell">节点永久下线</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl drain</code></div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f818036a58bdb69e2c4b36a"><td class="" style="width:120px"><div class="notion-simple-table-cell">资源不足触发自动驱逐</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">自动执行，无需手动</div></td></tr></tbody></table><hr class="notion-hr notion-block-318db8978f8180a7be27cd238c3be08f"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-318db8978f81800a930af461b85e6b85" data-id="318db8978f81800a930af461b85e6b85"><span><div id="318db8978f81800a930af461b85e6b85" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81800a930af461b85e6b85" title="注意事项"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">注意事项</span></span></h3><hr class="notion-hr notion-block-318db8978f818008ae85e40b903ed2fe"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-318db8978f81807796c2f3bf999dae06" data-id="318db8978f81807796c2f3bf999dae06"><span><div id="318db8978f81807796c2f3bf999dae06" class="notion-header-anchor"></div><a class="notion-hash-link" href="#318db8978f81807796c2f3bf999dae06" title="总结"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">总结</span></span></h3><table class="notion-simple-table notion-block-318db8978f81807890ccc43dd585d82c"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-318db8978f8180f59ee2dcdfe97ceaac"><td class="" style="width:120px"><div class="notion-simple-table-cell">操作</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">作用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">影响</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f81802bab81f145e00990e8"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Evict</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">删除 Pod</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Pod 重新调度</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f81805fadddec56ab42584e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Cordon</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">禁止调度</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">现有 Pod 继续运行</div></td></tr><tr class="notion-simple-table-row notion-block-318db8978f818027a9f8fb5dd17f591c"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Drain</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">驱逐 + 封禁</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">节点上 Pod 迁移，节点不可用</div></td></tr></tbody></table><div class="notion-blank notion-block-318db8978f818077a9addbf7aef5448f"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MariaDB on Kubernetes 部署实战]]></title>
            <link>https://tangly1024.com/article/26edb897-8f81-806e-bffc-c9dc3eea8029</link>
            <guid>https://tangly1024.com/article/26edb897-8f81-806e-bffc-c9dc3eea8029</guid>
            <pubDate>Mon, 15 Sep 2025 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-26edb8978f81806ebffcc9dc3eea8029"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-26edb8978f81806681eae32eefd50e47"><div>环境说明</div><ul class="notion-list notion-list-disc notion-block-26edb8978f81807da5ebc41edaf03346"><li>操作系统：openEuler 22.03 (LTS-SP4)</li></ul><ul class="notion-list notion-list-disc notion-block-26edb8978f8180acb7f7dd9195e8b2bf"><li>Kubernetes 版本：v1.25.1</li></ul><ul class="notion-list notion-list-disc notion-block-26edb8978f8180b19082cd50f17f2e8e"><li>容器运行时：Docker</li></ul><ul class="notion-list notion-list-disc notion-block-26edb8978f8180898c78e8bfc7f7aff2"><li>节点 IP：11.0.1.80</li></ul><ul class="notion-list notion-list-disc notion-block-26edb8978f81804496a8c9b0923b38b9"><li>应用名称：MariaDB 11.3.2</li></ul><ul class="notion-list notion-list-disc notion-block-26edb8978f8180c5ac9aeab1632d19a5"><li>命名空间：middleware</li></ul></blockquote><hr class="notion-hr notion-block-26edb8978f8180739e3aee13995d1964"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f8180a6a32fc60816069c7e" data-id="26edb8978f8180a6a32fc60816069c7e"><span><div id="26edb8978f8180a6a32fc60816069c7e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180a6a32fc60816069c7e" title="一、环境准备"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一、环境准备</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f818048a78cc36348f216fb" data-id="26edb8978f818048a78cc36348f216fb"><span><div id="26edb8978f818048a78cc36348f216fb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f818048a78cc36348f216fb" title="1.1 验证 Kubernetes 集群状态"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.1 验证 Kubernetes 集群状态</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180c7afe9c53efd0f3b10" data-id="26edb8978f8180c7afe9c53efd0f3b10"><span><div id="26edb8978f8180c7afe9c53efd0f3b10" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180c7afe9c53efd0f3b10" title="1.2 创建专用命名空间"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.2 创建专用命名空间</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f818050a1a6e4f982220250" data-id="26edb8978f818050a1a6e4f982220250"><span><div id="26edb8978f818050a1a6e4f982220250" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f818050a1a6e4f982220250" title="1.3 验证 Docker 运行时"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">1.3 验证 Docker 运行时</span></span></h3><hr class="notion-hr notion-block-26edb8978f8180dcb374e5259ace079d"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f8180248042ef18f43bcee7" data-id="26edb8978f8180248042ef18f43bcee7"><span><div id="26edb8978f8180248042ef18f43bcee7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180248042ef18f43bcee7" title="二、部署 MariaDB 服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二、部署 MariaDB 服务</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180cc89a4e3b321853724" data-id="26edb8978f8180cc89a4e3b321853724"><span><div id="26edb8978f8180cc89a4e3b321853724" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180cc89a4e3b321853724" title="2.1 创建持久化存储 (PVC)"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 创建持久化存储 (PVC)</span></span></h3><div class="notion-text notion-block-26edb8978f8180438bd7c49b621639a9"><b>验证 PVC 状态：</b></div><blockquote class="notion-quote notion-block-26edb8978f818047a8fbc6825787cb02"><div>重要提示</div><ul class="notion-list notion-list-disc notion-block-26edb8978f8180b8aa91e5e33b3a1861"><li>若 PVC 未绑定，请检查 <code class="notion-inline-code">pixiu-localstorage</code> 存储类配置</li></ul><ul class="notion-list notion-list-disc notion-block-26edb8978f818058b80adf2d79e756e6"><li>确保节点有足够本地存储空间（至少 20Gi）</li></ul></blockquote><hr class="notion-hr notion-block-26edb8978f8180918860c00f6337ee47"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180859909f726be1df8a7" data-id="26edb8978f8180859909f726be1df8a7"><span><div id="26edb8978f8180859909f726be1df8a7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180859909f726be1df8a7" title="2.2 部署 MariaDB 应用"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 部署 MariaDB 应用</span></span></h3><hr class="notion-hr notion-block-26edb8978f8180b883b1ed717f7e9701"/><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f818076aeccd6f190d6c358" data-id="26edb8978f818076aeccd6f190d6c358"><span><div id="26edb8978f818076aeccd6f190d6c358" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f818076aeccd6f190d6c358" title="2.3 创建服务暴露端点"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.3 创建服务暴露端点</span></span></h3><hr class="notion-hr notion-block-26edb8978f8180f08332c0f69a8ec3b4"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f8180e09d86f4694a58e1d9" data-id="26edb8978f8180e09d86f4694a58e1d9"><span><div id="26edb8978f8180e09d86f4694a58e1d9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180e09d86f4694a58e1d9" title="三、部署验证"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、部署验证</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180ee88cac6d5c0330a16" data-id="26edb8978f8180ee88cac6d5c0330a16"><span><div id="26edb8978f8180ee88cac6d5c0330a16" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180ee88cac6d5c0330a16" title="3.1 检查资源状态"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 检查资源状态</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180978988c3eb124a8f45" data-id="26edb8978f8180978988c3eb124a8f45"><span><div id="26edb8978f8180978988c3eb124a8f45" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180978988c3eb124a8f45" title="3.2 测试数据库连接"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 测试数据库连接</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180a0a9e8d1e6c25b09ca" data-id="26edb8978f8180a0a9e8d1e6c25b09ca"><span><div id="26edb8978f8180a0a9e8d1e6c25b09ca" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180a0a9e8d1e6c25b09ca" title="3.3 验证持久化存储"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.3 验证持久化存储</span></span></h3><hr class="notion-hr notion-block-26edb8978f818005924ed11d7b0eff96"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f8180b48d3dcc49c633e70c" data-id="26edb8978f8180b48d3dcc49c633e70c"><span><div id="26edb8978f8180b48d3dcc49c633e70c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180b48d3dcc49c633e70c" title="四、关键配置说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四、关键配置说明</span></span></h2><table class="notion-simple-table notion-block-26edb8978f8180689933f893714234c7"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-26edb8978f8180558b6bd070c42820d0"><td class="" style="width:120px"><div class="notion-simple-table-cell">配置项</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">值</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">说明</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f81803aa145cae2dcf70cb1"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>镜像仓库</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/mariadb:11.3.2-jammy</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">华为云镜像加速</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f81802d9425ebf081b765e7"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Root 密码</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">123456</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>生产环境必须修改</b></div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f8180c7888fcfe79d54368d"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>时区</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Asia/Shanghai</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">匹配中国时区</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f8180188d41cf4117086c43"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>存储大小</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">20Gi</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">PVC 请求容量</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f81809586a0d710b829806e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>资源限制</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">CPU 500m / 内存 1Gi</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">防止单节点资源耗尽</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f8180928dfbf13941bbb13e"><td class="" style="width:120px"><div class="notion-simple-table-cell"><b>Service 类型</b></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">NodePort</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">通过 30306 端口暴露服务</div></td></tr></tbody></table><hr class="notion-hr notion-block-26edb8978f8180bdb367e9265efc628d"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f818094b7b6ef96d9158320" data-id="26edb8978f818094b7b6ef96d9158320"><span><div id="26edb8978f818094b7b6ef96d9158320" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f818094b7b6ef96d9158320" title="五、生产环境优化建议"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五、生产环境优化建议</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180b882d2e99fe683b19d" data-id="26edb8978f8180b882d2e99fe683b19d"><span><div id="26edb8978f8180b882d2e99fe683b19d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180b882d2e99fe683b19d" title="5.1 安全加固"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 安全加固</span></span></h3><div class="notion-text notion-block-26edb8978f818095a23cdc6d6386bdf0"><b>创建 Secret：</b></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f818036aca3fabb36430677" data-id="26edb8978f818036aca3fabb36430677"><span><div id="26edb8978f818036aca3fabb36430677" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f818036aca3fabb36430677" title="5.2 高可用配置（生产环境必需）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2 高可用配置（生产环境必需）</span></span></h3><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f8180a4ae45d54caeaf218e" data-id="26edb8978f8180a4ae45d54caeaf218e"><span><div id="26edb8978f8180a4ae45d54caeaf218e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180a4ae45d54caeaf218e" title="六、故障排查指南"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">六、故障排查指南</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180a49c35f3a8c934e395" data-id="26edb8978f8180a49c35f3a8c934e395"><span><div id="26edb8978f8180a49c35f3a8c934e395" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180a49c35f3a8c934e395" title="常见问题解决方案"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">常见问题解决方案</span></span></h3><table class="notion-simple-table notion-block-26edb8978f8180558af2c5e1d6d0b2be"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-26edb8978f818052aabae101c3c70076"><td class="" style="width:120px"><div class="notion-simple-table-cell">问题现象</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">诊断命令</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">解决方案</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f81800a8868f7107d40e52e"><td class="" style="width:120px"><div class="notion-simple-table-cell">PVC 未绑定</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl describe pvc -n middleware mariadb-pvc</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">检查存储类配置/节点磁盘空间</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f81806fb850dc53b16e2c8a"><td class="" style="width:120px"><div class="notion-simple-table-cell">Pod 启动失败</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl logs -n middleware &lt;pod-name&gt; --previous</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">检查密码格式/存储权限</div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f81807d981cee039c145399"><td class="" style="width:120px"><div class="notion-simple-table-cell">连接拒绝</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">telnet 11.0.1.80 30306</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">检查防火墙：<code class="notion-inline-code">firewall-cmd --list-ports</code></div></td></tr><tr class="notion-simple-table-row notion-block-26edb8978f8180f98d5ecb911fece70b"><td class="" style="width:120px"><div class="notion-simple-table-cell">数据丢失</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">ls /var/lib/kubelet/pods/&lt;uid&gt;/volumes/</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">验证 PV 挂载路径</div></td></tr></tbody></table><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f8180979c38dacf7cb33c3c" data-id="26edb8978f8180979c38dacf7cb33c3c"><span><div id="26edb8978f8180979c38dacf7cb33c3c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180979c38dacf7cb33c3c" title="openEuler 特定检查"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">openEuler 特定检查</span></span></h3><hr class="notion-hr notion-block-26edb8978f81803fa597c59c2256882e"/><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-26edb8978f8180b2853ccfc937d7ac99" data-id="26edb8978f8180b2853ccfc937d7ac99"><span><div id="26edb8978f8180b2853ccfc937d7ac99" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f8180b2853ccfc937d7ac99" title="七、维护操作"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">七、维护操作</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f818047876ec2007db7aeab" data-id="26edb8978f818047876ec2007db7aeab"><span><div id="26edb8978f818047876ec2007db7aeab" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f818047876ec2007db7aeab" title="7.1 备份数据库"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.1 备份数据库</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-26edb8978f81809888dee02365afa9d7" data-id="26edb8978f81809888dee02365afa9d7"><span><div id="26edb8978f81809888dee02365afa9d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26edb8978f81809888dee02365afa9d7" title="7.2 升级 MariaDB"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">7.2 升级 MariaDB</span></span></h3><hr class="notion-hr notion-block-26edb8978f8180a78a8ec2c5d0177b15"/><blockquote class="notion-quote notion-block-26edb8978f8180448ec9fb8f30805630"><div>重要安全提示</div><ol start="1" class="notion-list notion-list-numbered notion-block-26edb8978f8180788998c163f95516b1" style="list-style-type:decimal"><li>本文档使用测试密码 <code class="notion-inline-code">123456</code>，<b>生产环境必须修改</b></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-26edb8978f8180b793a0d3e81ed69706" style="list-style-type:decimal"><li>NodePort 暴露方式仅适用于测试环境，生产环境建议使用 Ingress + TLS</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-26edb8978f818088ab9ac08db418ad46" style="list-style-type:decimal"><li>定期执行 <code class="notion-inline-code">mysql_secure_installation</code> 安全加固</li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-26edb8978f8180c5a600e1c2a43bb4ab" style="list-style-type:decimal"><li>敏感信息务必通过 Kubernetes Secrets 管理</li></ol></blockquote></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Redis on Kubernetes 部署实战]]></title>
            <link>https://tangly1024.com/article/270db897-8f81-80ef-aff3-ddc15e1f1baf</link>
            <guid>https://tangly1024.com/article/270db897-8f81-80ef-aff3-ddc15e1f1baf</guid>
            <pubDate>Tue, 16 Sep 2025 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-270db8978f8180efaff3ddc15e1f1baf"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f818027b018fd82fc50ecdb" data-id="270db8978f818027b018fd82fc50ecdb"><span><div id="270db8978f818027b018fd82fc50ecdb" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818027b018fd82fc50ecdb" title="文档说明"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">文档说明</span></span></h3><div class="notion-text notion-block-270db8978f8180599895d227977fa993">本文档详细记录了在 <b>openEuler 22.03 (LTS-SP4)</b> 系统上，基于 <b>Kubernetes 1.25.1</b> 和 <b>Docker</b> 环境部署 Redis 服务及 <b>RedisInsight 可视化管理工具</b>的完整流程。<b>精准整合配置管理与可视化监控</b>，确保生产环境部署可靠性。</div><hr class="notion-hr notion-block-270db8978f8180558efcf2c21acbd6f4"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f8180ff8315c7a6c51dc599" data-id="270db8978f8180ff8315c7a6c51dc599"><span><div id="270db8978f8180ff8315c7a6c51dc599" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180ff8315c7a6c51dc599" title="一、环境概览"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">一、环境概览</span></span></h3><table class="notion-simple-table notion-block-270db8978f81807faa25ee2139b70770"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-270db8978f8180fabe9bdacdabab1d76"><td class="" style="width:120px"><div class="notion-simple-table-cell">组件</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">版本/配置</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">说明</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180e8be96d4c553d871b2"><td class="" style="width:120px"><div class="notion-simple-table-cell">操作系统</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">openEuler 22.03 (LTS-SP4)</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">生产环境推荐版本</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f818090a36cf20fd4471ecc"><td class="" style="width:120px"><div class="notion-simple-table-cell">Kubernetes</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">v1.25.1</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">集群节点 IP：11.0.1.80</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81800eb412d7743e58da57"><td class="" style="width:120px"><div class="notion-simple-table-cell">容器运行时</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Docker</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">默认运行时环境</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81809399ecf880249f68f9"><td class="" style="width:120px"><div class="notion-simple-table-cell">Redis 镜像</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/redis:7.4.5-alpine</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">官方 Alpine 基础镜像</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180828311c1abb199a7b5"><td class="" style="width:120px"><div class="notion-simple-table-cell">RedisInsight</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">swr.cn-north-4.myhuaweicloud.com/ddn-k8s/docker.io/redislabs/redisinsight:2.56</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">可视化管理工具</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81802296bad1f3a719dc68"><td class="" style="width:120px"><div class="notion-simple-table-cell">命名空间</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">middleware</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">专用中间件命名空间</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81809080add4228cc6a2ed"><td class="" style="width:120px"><div class="notion-simple-table-cell">存储类</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">pixiu-localstorage</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">本地存储类（需提前配置）</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180f7b71fd61af8e08dad"><td class="" style="width:120px"><div class="notion-simple-table-cell">Redis 端口</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">NodePort 30030</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">外部访问端口</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180ed8b44c02bfe78577f"><td class="" style="width:120px"><div class="notion-simple-table-cell">RedisInsight</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Ingress <code class="notion-inline-code">redisinsight.k8s.cn</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">可视化管理入口</div></td></tr></tbody></table><hr class="notion-hr notion-block-270db8978f81808cba65d246a9f78d91"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f8180018726e169a37bc90d" data-id="270db8978f8180018726e169a37bc90d"><span><div id="270db8978f8180018726e169a37bc90d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180018726e169a37bc90d" title="二、部署前准备"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">二、部署前准备</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180cbb7b6fc73494f69fe" data-id="270db8978f8180cbb7b6fc73494f69fe"><span><div id="270db8978f8180cbb7b6fc73494f69fe" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180cbb7b6fc73494f69fe" title="2.1 验证基础环境"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.1 验证基础环境</span></span></h4><div class="notion-text notion-block-270db8978f8180d1b706c750a36c311e">✅ <b>成功标志</b>：</div><ul class="notion-list notion-list-disc notion-block-270db8978f8180d8b18ce2cf96e5faa1"><li>返回存储类定义，包含 <code class="notion-inline-code">volumeBindingMode: WaitForFirstConsumer</code></li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180d2b623f2aec08efce5" data-id="270db8978f8180d2b623f2aec08efce5"><span><div id="270db8978f8180d2b623f2aec08efce5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180d2b623f2aec08efce5" title="2.2 创建专用命名空间"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">2.2 创建专用命名空间</span></span></h4><hr class="notion-hr notion-block-270db8978f8180db9d3aecf071fc6aa7"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f818066b3e1cb6a1f3e7daf" data-id="270db8978f818066b3e1cb6a1f3e7daf"><span><div id="270db8978f818066b3e1cb6a1f3e7daf" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818066b3e1cb6a1f3e7daf" title="三、Redis 服务部署"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">三、Redis 服务部署</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180f2aa90f167f06cc93c" data-id="270db8978f8180f2aa90f167f06cc93c"><span><div id="270db8978f8180f2aa90f167f06cc93c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180f2aa90f167f06cc93c" title="3.1 部署持久化存储 (PVC)"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.1 部署持久化存储 (PVC)</span></span></h4><div class="notion-text notion-block-270db8978f8180cc8baefdc2329a8f98"><b>redis-pvc.yaml</b>：</div><div class="notion-text notion-block-270db8978f81807aadf4ed995d7541a9"><b>部署命令：</b></div><div class="notion-text notion-block-270db8978f8180688cd1e9c7db56b3a3"><b>验证 PVC 状态：</b></div><div class="notion-text notion-block-270db8978f8180009520d1e663005537">✅ <b>正确状态变化流程</b>：</div><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f8180ba9f00e226fb4d3b74" style="list-style-type:decimal"><li>创建后立即查看：<code class="notion-inline-code">STATUS</code> 为 <code class="notion-inline-code"><b>Pending</b></code></li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f8180e4a7f7f46062b5381b" style="list-style-type:decimal"><li><b>无需等待</b>，继续下一步部署</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-270db8978f818032836bed6637d86377" style="list-style-type:decimal"><li>当 Pod 进入 <code class="notion-inline-code">ContainerCreating</code> 状态时：<code class="notion-inline-code">STATUS</code> <b>自动变为 </b><code class="notion-inline-code"><b>Bound</b></code></li></ol><ol start="4" class="notion-list notion-list-numbered notion-block-270db8978f8180cd8bd9c6151ec0f7a6" style="list-style-type:decimal"><li>最终 Pod 进入 <code class="notion-inline-code">Running</code> 状态</li></ol><blockquote class="notion-quote notion-block-270db8978f8180d49525e8ea77930048"><div>⚠️ 关键说明：</div><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f8180c5b5c7f01b75a7f64e" style="list-style-type:decimal"><li><b>PVC 不会立即变为 Bound</b>，必须等待 Pod 调度（这是 <code class="notion-inline-code">WaitForFirstConsumer</code> 模式的核心特性）</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f8180da8a22d249f25324ad" style="list-style-type:decimal"><li><b>验证时机</b>：在创建 Deployment 后，当 Pod 状态为 <code class="notion-inline-code">ContainerCreating</code> 时检查 PVC</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-270db8978f818013b13ff241e9024700" style="list-style-type:decimal"><li>使用以下命令监控状态变化：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f818013b13ff241e9024700" style="list-style-type:lower-alpha"></ol></ol></blockquote><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818029a3a5fd0c0167212e" data-id="270db8978f818029a3a5fd0c0167212e"><span><div id="270db8978f818029a3a5fd0c0167212e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818029a3a5fd0c0167212e" title="3.2 部署 Redis 服务（含配置管理）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2 部署 Redis 服务（含配置管理）</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81806696d9e7c28225ff7e" data-id="270db8978f81806696d9e7c28225ff7e"><span><div id="270db8978f81806696d9e7c28225ff7e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81806696d9e7c28225ff7e" title="3.2.1 创建 Redis 配置 ConfigMap"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2.1 创建 Redis 配置 ConfigMap</span></span></h4><div class="notion-text notion-block-270db8978f8180499e52fbc9e54f67c8"><b>redis-config.yaml</b>：</div><div class="notion-text notion-block-270db8978f8180be9cfdfd5d714e46f7"><b>部署命令：</b></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180b397f3ce8ab84b0e24" data-id="270db8978f8180b397f3ce8ab84b0e24"><span><div id="270db8978f8180b397f3ce8ab84b0e24" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180b397f3ce8ab84b0e24" title="3.2.2 部署 Redis 服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.2.2 部署 Redis 服务</span></span></h4><div class="notion-text notion-block-270db8978f8180d68a28d4f6454df564"><b>redis-deploy.yaml</b>：</div><div class="notion-text notion-block-270db8978f8180288926c2eca443ea5a"><b>部署命令：</b></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180f889e7c33439d61345" data-id="270db8978f8180f889e7c33439d61345"><span><div id="270db8978f8180f889e7c33439d61345" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180f889e7c33439d61345" title="3.3 创建 Redis 服务暴露端点"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">3.3 创建 Redis 服务暴露端点</span></span></h4><div class="notion-text notion-block-270db8978f81804a8f13d91a772f9bd7"><b>redis-svc.yaml</b>：</div><div class="notion-text notion-block-270db8978f8180c28ba5e83c59a564b8"><b>部署命令：</b></div><hr class="notion-hr notion-block-270db8978f8180879c31ee6fb7737df5"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f818019ba40e4d08803c3cd" data-id="270db8978f818019ba40e4d08803c3cd"><span><div id="270db8978f818019ba40e4d08803c3cd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818019ba40e4d08803c3cd" title="四、RedisInsight 部署（可视化管理工具）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">四、RedisInsight 部署（可视化管理工具）</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818085b653f254ac0bb71a" data-id="270db8978f818085b653f254ac0bb71a"><span><div id="270db8978f818085b653f254ac0bb71a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818085b653f254ac0bb71a" title="4.1 部署 RedisInsight 持久化存储"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.1 部署 RedisInsight 持久化存储</span></span></h4><div class="notion-text notion-block-270db8978f818080abc1c47a9f7308ff"><b>redisinsight-pvc.yaml</b>：</div><div class="notion-text notion-block-270db8978f818048a591ee7a18705b9e"><b>部署命令：</b></div><div class="notion-text notion-block-270db8978f818087bd4cd443be3b6322">✅ <b>验证状态</b>：</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818079a818fe57befb4629" data-id="270db8978f818079a818fe57befb4629"><span><div id="270db8978f818079a818fe57befb4629" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818079a818fe57befb4629" title="4.2 部署 RedisInsight 服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.2 部署 RedisInsight 服务</span></span></h4><div class="notion-text notion-block-270db8978f8180928f79c4f7f5f0fbb0"><b>redisinsight-deploy.yaml</b>：</div><div class="notion-text notion-block-270db8978f8180d3ba2ff6cf0d07ec87"><b>部署命令：</b></div><div class="notion-text notion-block-270db8978f8180539088d2fbe7ec0c40">✅ <b>验证状态</b>：</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818073bba3f59690e84111" data-id="270db8978f818073bba3f59690e84111"><span><div id="270db8978f818073bba3f59690e84111" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818073bba3f59690e84111" title="4.3 创建 RedisInsight 服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.3 创建 RedisInsight 服务</span></span></h4><div class="notion-text notion-block-270db8978f8180c19ef1c811101241f4"><b>redisinsight-svc.yaml</b>：</div><div class="notion-text notion-block-270db8978f81805bb017c14277646d49"><b>部署命令：</b></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818028a270c6b4379902a1" data-id="270db8978f818028a270c6b4379902a1"><span><div id="270db8978f818028a270c6b4379902a1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818028a270c6b4379902a1" title="4.4 配置 Ingress 暴露访问"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">4.4 配置 Ingress 暴露访问</span></span></h4><div class="notion-text notion-block-270db8978f818018a85adcabd4e8af29"><b>redisinsight-ingress.yaml</b>：</div><div class="notion-text notion-block-270db8978f8180f986ffddeb0e5b6d16"><b>部署命令：</b></div><div class="notion-text notion-block-270db8978f8180c984b7d0073ee78b6d">✅ <b>验证 Ingress</b>：</div><blockquote class="notion-quote notion-block-270db8978f81804b8188e3993adea905"><div>⚠️ 关键配置说明：</div><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f818094be39c0357081acb5" style="list-style-type:decimal"><li><code class="notion-inline-code">runAsUser: 0</code>：RedisInsight 需要 root 权限访问存储</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f818015bd4fe5c3885947fe" style="list-style-type:decimal"><li>Ingress 需要提前配置好 <code class="notion-inline-code">nginx</code> ingress controller</li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-270db8978f81808d94c0f3bf2f59748c" style="list-style-type:decimal"><li>访问前需在 hosts 文件添加：<code class="notion-inline-code">11.0.1.80 redisinsight.k8s.cn</code></li></ol></blockquote><hr class="notion-hr notion-block-270db8978f8180c986acc35289fc334e"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f81800eba34c2435304e965" data-id="270db8978f81800eba34c2435304e965"><span><div id="270db8978f81800eba34c2435304e965" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81800eba34c2435304e965" title="五、服务验证"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">五、服务验证</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180cb80c7e96168255767" data-id="270db8978f8180cb80c7e96168255767"><span><div id="270db8978f8180cb80c7e96168255767" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180cb80c7e96168255767" title="5.1 Redis 服务验证"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.1 Redis 服务验证</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180b7916be2ef234bd03e" data-id="270db8978f8180b7916be2ef234bd03e"><span><div id="270db8978f8180b7916be2ef234bd03e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180b7916be2ef234bd03e" title="5.2 RedisInsight 服务验证"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2 RedisInsight 服务验证</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81804cb5dfc0976454c749" data-id="270db8978f81804cb5dfc0976454c749"><span><div id="270db8978f81804cb5dfc0976454c749" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81804cb5dfc0976454c749" title="5.2.1 基础连通性测试"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2.1 基础连通性测试</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81801f8ca2d77d78ba35bf" data-id="270db8978f81801f8ca2d77d78ba35bf"><span><div id="270db8978f81801f8ca2d77d78ba35bf" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81801f8ca2d77d78ba35bf" title="5.2.2 可视化访问验证"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2.2 可视化访问验证</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f818049a91cca00ad8c60f3" style="list-style-type:decimal"><li>在本地 hosts 添加：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f818049a91cca00ad8c60f3" style="list-style-type:lower-alpha"></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f8180dea257c4b405ddcb7f" style="list-style-type:decimal"><li>浏览器访问：<code class="notion-inline-code">http://redisinsight.k8s.cn</code></li></ol><ol start="3" class="notion-list notion-list-numbered notion-block-270db8978f81809b9822f19957ee6e01" style="list-style-type:decimal"><li>首次启动需等待 2-3 分钟初始化</li></ol><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180768edfd25ece1c9b00" data-id="270db8978f8180768edfd25ece1c9b00"><span><div id="270db8978f8180768edfd25ece1c9b00" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180768edfd25ece1c9b00" title="5.2.3 连接 Redis 服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">5.2.3 连接 Redis 服务</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f81800692f0c5516836648b" style="list-style-type:decimal"><li>登录 RedisInsight 后点击 &quot;Add Redis Database&quot;</li></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f818023868ef70f788e4142" style="list-style-type:decimal"><li>配置参数：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f818023868ef70f788e4142" style="list-style-type:lower-alpha"><ul class="notion-list notion-list-disc notion-block-270db8978f818059b97cf826a7440816"><li>Name: <code class="notion-inline-code">k8s-redis</code></li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f8180adb06ad5398b113afa"><li>Host: <code class="notion-inline-code">redis-svc.middleware.svc.cluster.local</code></li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f8180f59bbfe8f25f244676"><li>Port: <code class="notion-inline-code">6379</code></li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f8180afa44edc1b6f1c0a3e"><li>Password: <code class="notion-inline-code">your_strong_password</code></li></ul></ol></ol><ol start="3" class="notion-list notion-list-numbered notion-block-270db8978f8180579fc8fca15990b574" style="list-style-type:decimal"><li>点击 &quot;Add Redis Database&quot; 完成连接</li></ol><div class="notion-text notion-block-270db8978f8180aebbbfe5fa6431e947">✅ <b>成功标志</b>：</div><ul class="notion-list notion-list-disc notion-block-270db8978f818020851fdeb64a42e637"><li>在 RedisInsight 界面看到连接状态为 &quot;Connected&quot;</li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f8180f1bcefe7f7f91e0a64"><li>可查看 Key 数量、内存使用等监控指标</li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f81805ea172c288c4230aa7"><li>可执行命令操作 Redis 数据</li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-270db8978f81806bab8ace73ecfb401f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://imgbed.qilincsp.cn/file/1758026786358_image.png?spaceId=cf59df04-521c-41ae-8f6a-a8e28ced330a&amp;t=270db897-8f81-806b-ab8a-ce73ecfb401f" alt="image.png" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-270db8978f818014a203ff5975047082"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column"><img src="https://imgbed.qilincsp.cn/file/1758026793978_image.png?spaceId=cf59df04-521c-41ae-8f6a-a8e28ced330a&amp;t=270db897-8f81-8014-a203-ff5975047082" alt="image.png" loading="lazy" decoding="async"/></div></figure><hr class="notion-hr notion-block-270db8978f81803c8ff2c24c7395068f"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f81808f9604e8875b27c7d6" data-id="270db8978f81808f9604e8875b27c7d6"><span><div id="270db8978f81808f9604e8875b27c7d6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81808f9604e8875b27c7d6" title="六、关键运维操作"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">六、关键运维操作</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81804da649e2e68e3b15f6" data-id="270db8978f81804da649e2e68e3b15f6"><span><div id="270db8978f81804da649e2e68e3b15f6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81804da649e2e68e3b15f6" title="6.1 PVC 状态验证流程（核心修正）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.1 PVC 状态验证流程（核心修正）</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81801c94efdff8c3be3a5a" data-id="270db8978f81801c94efdff8c3be3a5a"><span><div id="270db8978f81801c94efdff8c3be3a5a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81801c94efdff8c3be3a5a" title="验证步骤（实操指南）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">验证步骤（实操指南）</span></span></h4><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f8180b3ac23c0fc2cf1af99" style="list-style-type:decimal"><li><b>监控 Redis 和 RedisInsight 的 PVC 状态</b>：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f8180b3ac23c0fc2cf1af99" style="list-style-type:lower-alpha"></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f8180508c2bdd578e4a1cf5" style="list-style-type:decimal"><li><b>关键观察点</b>：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f8180508c2bdd578e4a1cf5" style="list-style-type:lower-alpha"></ol></ol><div class="notion-text notion-block-270db8978f8180b2a8c0e74a5dac388a">✅ <b>精准成功标志</b>：</div><ul class="notion-list notion-list-disc notion-block-270db8978f818064a1effbfea410d045"><li><b>RedisInsight PVC 在 Pod 进入 </b><code class="notion-inline-code"><b>ContainerCreating</b></code><b> 时变为 </b><code class="notion-inline-code"><b>Bound</b></code></li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f8180b49076ebc1f95ab6be"><li>RedisInsight Pod 进入 Running 状态后可通过 Ingress 访问</li></ul><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180cf82e2c0dff1ed62d1" data-id="270db8978f8180cf82e2c0dff1ed62d1"><span><div id="270db8978f8180cf82e2c0dff1ed62d1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180cf82e2c0dff1ed62d1" title="6.2 RedisInsight 连接配置最佳实践"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">6.2 RedisInsight 连接配置最佳实践</span></span></h4><blockquote class="notion-quote notion-block-270db8978f8180aab7e5eb165edd0df8"><div>重要提示：</div><div class="notion-text notion-block-270db8978f81808689e3fb7ae455f3d9">RedisInsight 需要正确配置 Redis 服务地址才能管理 Redis 实例：</div></blockquote><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f8180748b81cbe25fa809b8" data-id="270db8978f8180748b81cbe25fa809b8"><span><div id="270db8978f8180748b81cbe25fa809b8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180748b81cbe25fa809b8" title="服务发现配置"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">服务发现配置</span></span></h4><table class="notion-simple-table notion-block-270db8978f81804cbf48d2b638085bc6"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-270db8978f818014aeadeed268d93945"><td class="" style="width:120px"><div class="notion-simple-table-cell">配置项</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">生产环境值</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">说明</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180da9fd1c79310e0be8f"><td class="" style="width:120px"><div class="notion-simple-table-cell">Host</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">redis-svc.middleware.svc.cluster.local</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Kubernetes 内部 DNS 地址</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81806e83e5effbdb929689"><td class="" style="width:120px"><div class="notion-simple-table-cell">Port</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">6379</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">Redis 服务端口</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f818042a314ea56653d6b55"><td class="" style="width:120px"><div class="notion-simple-table-cell">TLS</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">Disabled</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">根据安全需求配置</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180538d92ce7afd03f9b6"><td class="" style="width:120px"><div class="notion-simple-table-cell">Password</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">your_strong_password</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">与 redis.conf 一致</div></td></tr></tbody></table><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818090945acee4572451b0" data-id="270db8978f818090945acee4572451b0"><span><div id="270db8978f818090945acee4572451b0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818090945acee4572451b0" title="连接测试命令"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">连接测试命令</span></span></h4><hr class="notion-hr notion-block-270db8978f81808aa093c0f77d19a144"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f8180c3ba84c4bc96595210" data-id="270db8978f8180c3ba84c4bc96595210"><span><div id="270db8978f8180c3ba84c4bc96595210" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180c3ba84c4bc96595210" title="七、故障排查指南"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">七、故障排查指南</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81801a824bf39e0a792e77" data-id="270db8978f81801a824bf39e0a792e77"><span><div id="270db8978f81801a824bf39e0a792e77" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81801a824bf39e0a792e77" title="RedisInsight 问题排查表"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">RedisInsight 问题排查表</span></span></h4><table class="notion-simple-table notion-block-270db8978f8180c594bcff5357678a4c"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-270db8978f81802a855fc2214f6bfbc5"><td class="" style="width:120px"><div class="notion-simple-table-cell">问题现象</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">原因</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">解决方案</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81800f8c4bfcfdbb57f388"><td class="" style="width:120px"><div class="notion-simple-table-cell">Ingress 无法访问</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">DNS 未配置或 Ingress 未生效</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">1. 检查 hosts 文件&lt;br&gt;2. <code class="notion-inline-code">kubectl describe ingress redisinsight</code></div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180a98668effd7a50b810"><td class="" style="width:120px"><div class="notion-simple-table-cell">RedisInsight 启动失败</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">PVC 权限问题</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">添加 <code class="notion-inline-code">fsGroup: 0</code> 到 Deployment spec</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81807abd92e67d2f0d7862"><td class="" style="width:120px"><div class="notion-simple-table-cell">无法连接 Redis</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">网络策略限制</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">1. 检查 NetworkPolicy&lt;br&gt;2. 验证 DNS 解析</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180a8af05e48ff4e88c40"><td class="" style="width:120px"><div class="notion-simple-table-cell">数据加载缓慢</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">资源限制过低</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">调整 resources.limits 内存至 2Gi</div></td></tr></tbody></table><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81807fa54bcfc7d634228a" data-id="270db8978f81807fa54bcfc7d634228a"><span><div id="270db8978f81807fa54bcfc7d634228a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81807fa54bcfc7d634228a" title="诊断命令集（增强版）"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">诊断命令集（增强版）</span></span></h4><hr class="notion-hr notion-block-270db8978f8180349e7dc253bf1b1c66"/><h3 class="notion-h notion-h2 notion-h-indent-0 notion-block-270db8978f8180dcba4af924e0a6ce2f" data-id="270db8978f8180dcba4af924e0a6ce2f"><span><div id="270db8978f8180dcba4af924e0a6ce2f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f8180dcba4af924e0a6ce2f" title="八、附录"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">八、附录</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f818002b4c1f7e5c15a3f7b" data-id="270db8978f818002b4c1f7e5c15a3f7b"><span><div id="270db8978f818002b4c1f7e5c15a3f7b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f818002b4c1f7e5c15a3f7b" title="附录 A：RedisInsight 安全加固建议"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">附录 A：RedisInsight 安全加固建议</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-270db8978f81808781cbfdcbb412884c" data-id="270db8978f81808781cbfdcbb412884c"><span><div id="270db8978f81808781cbfdcbb412884c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#270db8978f81808781cbfdcbb412884c" title="附录 B：生产环境检查清单"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">附录 B：生产环境检查清单</span></span></h4><table class="notion-simple-table notion-block-270db8978f8180c5a889e65051b4a560"><tbody><tr class="notion-simple-table-row notion-simple-table-header-row notion-block-270db8978f8180079939d418720fb475"><td class="" style="width:120px"><div class="notion-simple-table-cell">项目</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">检查命令</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">预期结果</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180fa9467fda6d33038ad"><td class="" style="width:120px"><div class="notion-simple-table-cell">Redis PVC 状态</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl -n middleware get pvc redis-pvc</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">STATUS=Bound</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180b1883dc6114ea2dd6c"><td class="" style="width:120px"><div class="notion-simple-table-cell">RedisInsight PVC 状态</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl -n middleware get pvc redisinsight-pvc</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">STATUS=Bound</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180aa870ac0b3ebb3835b"><td class="" style="width:120px"><div class="notion-simple-table-cell">Redis 服务可用</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">kubectl -n middleware exec -it redis-xxx -- redis-cli ping</code></div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">PONG</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f81800181bed0193a193a90"><td class="" style="width:120px"><div class="notion-simple-table-cell">RedisInsight 健康检查</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">curl &lt;http://redisinsight:5540/health</code>&gt;</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">{&quot;status&quot;:&quot;UP&quot;}</div></td></tr><tr class="notion-simple-table-row notion-block-270db8978f8180738863f632f6fd6d79"><td class="" style="width:120px"><div class="notion-simple-table-cell">Ingress 可访问性</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell"><code class="notion-inline-code">curl -H &quot;Host: redisinsight.k8s.cn&quot; &lt;http://11.0.1.80</code>&gt;</div></td><td class="" style="width:120px"><div class="notion-simple-table-cell">HTTP 200</div></td></tr></tbody></table><hr class="notion-hr notion-block-270db8978f81802ca82fd57de1e62ee9"/><blockquote class="notion-quote notion-block-270db8978f8180dc941bc77163ce7075"><div>运维关键提示：</div><ol start="1" class="notion-list notion-list-numbered notion-block-270db8978f8180879ee3e0e1ef6f301c" style="list-style-type:decimal"><li><b>RedisInsight 连接关键</b>：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f8180879ee3e0e1ef6f301c" style="list-style-type:lower-alpha"><ul class="notion-list notion-list-disc notion-block-270db8978f8180e1be44f1e062e9600a"><li>使用 Kubernetes 内部 DNS 地址 <code class="notion-inline-code">redis-svc.middleware.svc.cluster.local</code></li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f81806884d9e9ae420f6971"><li><b>不要使用 NodePort 地址</b>（可能导致连接问题）</li></ul></ol></ol><ol start="2" class="notion-list notion-list-numbered notion-block-270db8978f8180309895e045cfce0344" style="list-style-type:decimal"><li><b>PVC 状态验证核心原则</b>：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f8180309895e045cfce0344" style="list-style-type:lower-alpha"><ul class="notion-list notion-list-disc notion-block-270db8978f8180b1a85fe4e38aba1a07"><li><b>当 Pod 进入 </b><code class="notion-inline-code"><b>ContainerCreating</b></code><b> 时，PVC 应已变为 </b><code class="notion-inline-code"><b>Bound</b></code></li></ul></ol></ol><ol start="3" class="notion-list notion-list-numbered notion-block-270db8978f8180f3abe5d5c03164d579" style="list-style-type:decimal"><li>生产环境建议：</li><ol class="notion-list notion-list-numbered notion-block-270db8978f8180f3abe5d5c03164d579" style="list-style-type:lower-alpha"><ul class="notion-list notion-list-disc notion-block-270db8978f8180948ad8e3ab59101e1c"><li>为 RedisInsight 配置 TLS 加密</li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f81809bbc24fe4697291be4"><li>添加资源限制防止资源耗尽</li></ul><ul class="notion-list notion-list-disc notion-block-270db8978f8180fe9afdfae9f87ed7b4"><li>设置自动备份策略</li></ul></ol></ol></blockquote></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[动态pv]]></title>
            <link>https://tangly1024.com/article/72e48141-c8f7-4cf9-9b4f-37fdfc23afd5</link>
            <guid>https://tangly1024.com/article/72e48141-c8f7-4cf9-9b4f-37fdfc23afd5</guid>
            <pubDate>Tue, 20 Aug 2024 00:00:00 GMT</pubDate>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-72e48141c8f74cf99b4f37fdfc23afd5"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><blockquote class="notion-quote notion-block-6480e4889a78471e8e6926185975e536"><div>SC的主要作用在于，自动创建PV，从而实现PVC按需自动绑定PV。</div><div class="notion-text notion-block-870ac3b2df854456bafa11dd2bae91d0">下面我们通过创建一个基于NFS的SC来演示SC的作用。</div><div class="notion-text notion-block-0ee6734955654316849c17443e3b9df9">要想使用NFS的SC，还需要安装一个NFS provisioner，provisioner里会定义NFS相关的信息（服务器IP、共享目录等）</div><div class="notion-text notion-block-7c748abdce824d65b76fa492b91d04be">github地址： <a class="notion-link" href="https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes-sigs/nfs-subdir-external-provisioner</a></div></blockquote><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-337887f593164f3eb8856d203cd251ec" data-id="337887f593164f3eb8856d203cd251ec"><span><div id="337887f593164f3eb8856d203cd251ec" class="notion-header-anchor"></div><a class="notion-hash-link" href="#337887f593164f3eb8856d203cd251ec" title="动态pv部署"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">动态pv部署</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-0d1bba9ed7194fc7bb883c13254a1e1d" data-id="0d1bba9ed7194fc7bb883c13254a1e1d"><span><div id="0d1bba9ed7194fc7bb883c13254a1e1d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0d1bba9ed7194fc7bb883c13254a1e1d" title="master节点配置nfs服务"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">master节点配置nfs服务</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-67e7b592a10b42a291345db95397a8db" data-id="67e7b592a10b42a291345db95397a8db"><span><div id="67e7b592a10b42a291345db95397a8db" class="notion-header-anchor"></div><a class="notion-hash-link" href="#67e7b592a10b42a291345db95397a8db" title="在node节点安装 nfs客户端"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">在node节点安装 nfs客户端</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-6eb528a1b7fa46dabf7e516eeb0883ca" data-id="6eb528a1b7fa46dabf7e516eeb0883ca"><span><div id="6eb528a1b7fa46dabf7e516eeb0883ca" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6eb528a1b7fa46dabf7e516eeb0883ca" title="创建rbac"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建rbac</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-9ab97c55c5d14af1a8f062befdf6392f" data-id="9ab97c55c5d14af1a8f062befdf6392f"><span><div id="9ab97c55c5d14af1a8f062befdf6392f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9ab97c55c5d14af1a8f062befdf6392f" title="创建deployment"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建deployment</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f294eea6dbe0496ca373081876ad769b" data-id="f294eea6dbe0496ca373081876ad769b"><span><div id="f294eea6dbe0496ca373081876ad769b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f294eea6dbe0496ca373081876ad769b" title="创建sc"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建sc</span></span></h3><div class="notion-text notion-block-138a989dbf9a4adfa8ee81cf249977c7"><code class="notion-inline-code">vim class.yaml</code></div><div class="notion-text notion-block-221719bee3b24764a7c7d3ff89117e5c"><code class="notion-inline-code">验证</code></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-e4f95f7a6de64affb7a4ef62f1f2afcd" data-id="e4f95f7a6de64affb7a4ef62f1f2afcd"><span><div id="e4f95f7a6de64affb7a4ef62f1f2afcd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e4f95f7a6de64affb7a4ef62f1f2afcd" title="创建pvc"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建pvc</span></span></h3><blockquote class="notion-quote notion-block-06c2f0ba34f74a0388d98537d9713b1a"><div>在创建PVC时，你可以通过storageClassName 字段指定存储类名称</div></blockquote><div class="notion-text notion-block-f413053921c34fe6b0c64db7b39123c9"><code class="notion-inline-code">vim app2-pvc.yaml</code></div><div class="notion-text notion-block-9d76887cb16f4da093d613dcae577293"><code class="notion-inline-code">验证</code></div><blockquote class="notion-quote notion-block-00a00e0422514d3a8a8065393794ba32"><div>pvc-5d73108c-2b54-4736-8a16-7ce4168329a2的<code class="notion-inline-code">PV</code>由<code class="notion-inline-code">NFS</code>供给程序自动创建,<code class="notion-inline-code">STORAGECLASS</code>列也显示相对应的储存类名称。此外，供给程序在NFS程序在NFS服务器共享路径为该PV创建一个独立目录，以确保PV数据的隔离性。目录命名格式为&quot;命名空间-PVC名称-PV名称&quot;，如下图</div></blockquote><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-941ed95a2dcf4f95acd15356f0d68109" data-id="941ed95a2dcf4f95acd15356f0d68109"><span><div id="941ed95a2dcf4f95acd15356f0d68109" class="notion-header-anchor"></div><a class="notion-hash-link" href="#941ed95a2dcf4f95acd15356f0d68109" title="创建pod绑定pvc"><svg viewBox="0 0 16 16" width="16" height="16"><path fill-rule="evenodd" d="M7.775 3.275a.75.75 0 001.06 1.06l1.25-1.25a2 2 0 112.83 2.83l-2.5 2.5a2 2 0 01-2.83 0 .75.75 0 00-1.06 1.06 3.5 3.5 0 004.95 0l2.5-2.5a3.5 3.5 0 00-4.95-4.95l-1.25 1.25zm-4.69 9.64a2 2 0 010-2.83l2.5-2.5a2 2 0 012.83 0 .75.75 0 001.06-1.06 3.5 3.5 0 00-4.95 0l-2.5 2.5a3.5 3.5 0 004.95 4.95l1.25-1.25a.75.75 0 00-1.06-1.06l-1.25 1.25a2 2 0 01-2.83 0z"></path></svg></a><span class="notion-h-title">创建pod绑定pvc</span></span></h3><blockquote class="notion-quote notion-block-d15632243d8941b6b41b5e85f9a21449"><div>将 claimName 改成 pvc名</div></blockquote><div class="notion-text notion-block-4173583678d7435a83debda6efdc12f9"><code class="notion-inline-code">vim app2-deploy.yaml</code></div><div class="notion-text notion-block-2214cacc965745cea2dc6c80bc801357"><code class="notion-inline-code">验证</code></div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>