<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Rancher on Zayn's Blog</title><link>https://blog.treesir.pub/tags/rancher/</link><description>Recent content in Rancher on Zayn's Blog</description><generator>Hugo -- gohugo.io</generator><language>zh-cn</language><managingEditor>yangzun@treesir.pub (Zayn)</managingEditor><webMaster>yangzun@treesir.pub (Zayn)</webMaster><copyright>2021-2026 Zayn</copyright><lastBuildDate>Tue, 08 Jun 2021 08:45:22 +0800</lastBuildDate><atom:link href="https://blog.treesir.pub/tags/rancher/index.xml" rel="self" type="application/rss+xml"/><item><title>修复 Rancher 单机部署升级后 Docker 无法启动问题</title><link>https://blog.treesir.pub/posts/rancher-upgrade-docker/</link><pubDate>Sat, 16 Jan 2021 14:39:59 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/rancher-upgrade-docker/</guid><description>&lt;h2 class="relative group">环境配置
&lt;div id="环境配置" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>操作系统&lt;/strong>：CentOS 7.9.2009&lt;/li>
&lt;li>&lt;strong>Docker 版本&lt;/strong>：18.09.9&lt;/li>
&lt;/ul>
&lt;h2 class="relative group">问题复现
&lt;div id="问题复现" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e9%97%ae%e9%a2%98%e5%a4%8d%e7%8e%b0" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;h2 class="relative group">安装 Rancher
&lt;div id="安装-rancher" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e5%ae%89%e8%a3%85-rancher" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" class="chroma">&lt;code class="language-bash" data-lang="bash">&lt;span class="line">&lt;span class="cl">docker pull rancher/rancher:v2.3.5
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">
&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">docker run -d &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>--restart&lt;span class="o">=&lt;/span>unless-stopped &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>--name rancher &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>-p 80:80 -p 443:443 &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>--privileged &lt;span class="se">\
&lt;/span>&lt;/span>&lt;/span>&lt;span class="line">&lt;span class="cl">&lt;span class="se">&lt;/span>rancher/rancher:v2.3.5
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>
&lt;figure>
&lt;img class="my-0 rounded-md" loading="lazy" alt="image-20210116134244336" src="https://cdn.treesir.pub/img/image-20210116134244336.png">
&lt;/figure>
&lt;/p></description></item><item><title>修复 Rancher 导入集群时 Scheduler 和 Controller Manager 不健康问题</title><link>https://blog.treesir.pub/posts/rancher-import-cluster-fix/</link><pubDate>Tue, 08 Jun 2021 08:45:22 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/rancher-import-cluster-fix/</guid><description>&lt;h2 class="relative group">环境配置
&lt;div id="环境配置" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Kubernetes 版本&lt;/strong>：v1.20.4 (KubeKey 部署)&lt;/li>
&lt;li>&lt;strong>操作系统&lt;/strong>：CentOS 7.9.2009&lt;/li>
&lt;li>&lt;strong>Rancher 版本&lt;/strong>：v2.4.15&lt;/li>
&lt;/ul>
&lt;h2 class="relative group">准备 Kubernetes 测试环境
&lt;div id="准备-kubernetes-测试环境" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e5%87%86%e5%a4%87-kubernetes-%e6%b5%8b%e8%af%95%e7%8e%af%e5%a2%83" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>本次使用 KubeKey 进行一键部署。KubeKey 底层集群部署基于 kubeadm，详细信息可参考 &lt;a
href="https://github.com/kubesphere/kubekey.git"
target="_blank"
>GitHub 地址&lt;/a>。&lt;/p></description></item><item><title>快速删除 Rancher 中失败的 Pod 资源</title><link>https://blog.treesir.pub/posts/quick-delete-rancher-failed-pod/</link><pubDate>Thu, 27 May 2021 08:59:56 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/quick-delete-rancher-failed-pod/</guid><description>&lt;h2 class="relative group">问题描述
&lt;div id="问题描述" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e9%97%ae%e9%a2%98%e6%8f%8f%e8%bf%b0" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;p>在 Rancher 管理的 Kubernetes 集群中，有时会出现副本集中的 Pod 部署失败的情况。如下图所示，失败的 Pod 数量可能达到上千个，手动逐一删除非常耗时。&lt;/p>
&lt;p>
&lt;figure>
&lt;img class="my-0 rounded-md" loading="lazy" alt="image-20210527085545254" src="https://cdn.treesir.pub/img/image-20210527085545254.png">
&lt;/figure>
&lt;/p>
&lt;h2 class="relative group">解决方案
&lt;div id="解决方案" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e8%a7%a3%e5%86%b3%e6%96%b9%e6%a1%88" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;h2 class="relative group">批量删除失败的 Pod
&lt;div id="批量删除失败的-pod" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e6%89%b9%e9%87%8f%e5%88%a0%e9%99%a4%e5%a4%b1%e8%b4%a5%e7%9a%84-pod" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;p>使用 kubectl 命令批量删除状态为 &lt;code>MatchNodeSelector&lt;/code> 的失败 Pod：&lt;/p></description></item><item><title>Rancher 开启监控后的，阈值告警配置说明 (三)</title><link>https://blog.treesir.pub/posts/rancher-monitor-config-third/</link><pubDate>Wed, 19 May 2021 08:41:26 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/rancher-monitor-config-third/</guid><description>&lt;h2 class="relative group">环境说明
&lt;div id="环境说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>此文档为 rancher &lt;code>monitor&lt;/code> 使用系列的 &lt;code>第三篇&lt;/code> ，主要介绍与 &lt;code>dingtalk&lt;/code> 关联配置告警通知、prometheus 告警阈值的配置使用&lt;/p>&lt;/blockquote>
&lt;h2 class="relative group">配置安装 dingtalk webhook
&lt;div id="配置安装-dingtalk-webhook" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e9%85%8d%e7%bd%ae%e5%ae%89%e8%a3%85-dingtalk-webhook" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>&lt;a
href="https://github.com/timonwong/prometheus-webhook-dingtalk"
target="_blank"
>webhook github 地址&lt;/a>&lt;/p></description></item><item><title>Rancher 开启监控，及生产应用的优化配置工作说明 (一)</title><link>https://blog.treesir.pub/posts/rancher-monitor-config-first/</link><pubDate>Mon, 17 May 2021 10:41:26 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/rancher-monitor-config-first/</guid><description>&lt;h2 class="relative group">环境说明
&lt;div id="环境说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;ul>
&lt;li>kubernetes version: &lt;code>v1.17.9&lt;/code>&lt;/li>
&lt;li>rancher dashboard: &lt;code>v2.3.5&lt;/code>&lt;/li>
&lt;li>操作系统: &lt;code>centos 7.8.2003 &lt;/code>&lt;/li>
&lt;/ul>
&lt;h2 class="relative group">基础环境配置
&lt;div id="基础环境配置" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e5%9f%ba%e7%a1%80%e7%8e%af%e5%a2%83%e9%85%8d%e7%bd%ae" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;h2 class="relative group">使用 kubekey 部署 kubernetes 集群
&lt;div id="使用-kubekey-部署-kubernetes-集群" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e4%bd%bf%e7%94%a8-kubekey-%e9%83%a8%e7%bd%b2-kubernetes-%e9%9b%86%e7%be%a4" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>由于篇幅原因，此处省略部署说明，请参考较早期的 &lt;a
href="http://hugo.blog:1313/post/kubekey-install-k8s/"
target="_blank"
>文档说明&lt;/a>&lt;/p></description></item><item><title>Rancher 开启监控后，exporter/metrics 的添加说明 (二)</title><link>https://blog.treesir.pub/posts/rancher-monitor-config-second/</link><pubDate>Mon, 17 May 2021 10:41:26 +0800</pubDate><author>yangzun@treesir.pub (Zayn)</author><guid>https://blog.treesir.pub/posts/rancher-monitor-config-second/</guid><description>&lt;h2 class="relative group">环境说明
&lt;div id="环境说明" class="anchor">&lt;/div>
&lt;span
class="absolute top-0 w-6 transition-opacity opacity-0 ltr:-left-6 rtl:-right-6 not-prose group-hover:opacity-100">
&lt;a class="group-hover:text-primary-300 dark:group-hover:text-neutral-700 !no-underline" href="#%e7%8e%af%e5%a2%83%e8%af%b4%e6%98%8e" aria-label="锚点">#&lt;/a>
&lt;/span>
&lt;/h2>
&lt;blockquote>
&lt;p>&lt;a
href="https://www.treesir.pub/post/rancher-monitor-config-first/"
target="_blank"
>&lt;code>上期&lt;/code>&lt;/a> 介绍了 &lt;code>rancher prometheus operator&lt;/code> 的安装和基础 targets 的修复工作。有的时候我们抓取的 exporter metrics 并不在同集群且与集群没有任何关联时，应该怎么和 rancher &lt;code>monitor&lt;/code> 进行关联配置呢？下面文档将配置展示部署外部 &lt;code>exporter &lt;/code>, 的安装说明、指标抓取、 和监控系统的关联。&lt;/p></description></item></channel></rss>