<?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>Madd Blog</title>
        <link>https://blog.madd.cloudns.org/</link>
        <description>这个人很懒，什么也没有留下</description>
        <lastBuildDate>Wed, 06 May 2026 03:34:40 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, 穿尿不湿的派大星</copyright>
        <item>
            <title><![CDATA[开始K8S操作]]></title>
            <link>https://blog.madd.cloudns.org/article/studyK8s</link>
            <guid>https://blog.madd.cloudns.org/article/studyK8s</guid>
            <pubDate>Sun, 07 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[学习K8S第二站]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-4c557f8a0aaf410cbed70a397f2370a4"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-7fe2716cb66a42d881e46c668cb58188" data-id="7fe2716cb66a42d881e46c668cb58188"><span><div id="7fe2716cb66a42d881e46c668cb58188" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7fe2716cb66a42d881e46c668cb58188" 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>概述</b></b></span></span></h2><div class="notion-text notion-block-0580d09cfebc4083a2751267418b2518">  Kubernetes 是一个可移植、可扩展的开源平台，用于管理容器化的工作负载和服务，可促进声明式配置和自动化。 Kubernetes 拥有一个庞大且快速增长的生态，其服务、支持和工具的使用范围相当广泛。</div><figure class="notion-asset-wrapper notion-asset-wrapper-embed notion-block-202b0fb642ed4c5f88e276cfcf782441"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:320px"><iframe class="notion-asset-object-fit" src="https://kubernetes.io/zh-cn/?spaceId=3e4b7a91-4f6f-435a-aa15-c60a064ef62a" title="iframe embed" frameBorder="0" allowfullscreen="" loading="lazy" scrolling="auto"></iframe></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-4ceaa1f704e449fab37abecba4500794" data-id="4ceaa1f704e449fab37abecba4500794"><span><div id="4ceaa1f704e449fab37abecba4500794" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4ceaa1f704e449fab37abecba4500794" title="K8S操作命令"><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">K8S操作命令</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-2d6d52b4fdf348079ba78d5b55345958" data-id="2d6d52b4fdf348079ba78d5b55345958"><span><div id="2d6d52b4fdf348079ba78d5b55345958" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2d6d52b4fdf348079ba78d5b55345958" title="Pod操作"><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操作</span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-d6f1793d9b9b492cb03ca2b91d020912" data-id="d6f1793d9b9b492cb03ca2b91d020912"><span><div id="d6f1793d9b9b492cb03ca2b91d020912" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d6f1793d9b9b492cb03ca2b91d020912" 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><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-6ff70e085e534282b2cc8d61a0deaeed" data-id="6ff70e085e534282b2cc8d61a0deaeed"><span><div id="6ff70e085e534282b2cc8d61a0deaeed" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6ff70e085e534282b2cc8d61a0deaeed" title="Pod扩缩容"><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扩缩容</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-69386e2d300844c9965fd1d7391da7d8" data-id="69386e2d300844c9965fd1d7391da7d8"><span><div id="69386e2d300844c9965fd1d7391da7d8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#69386e2d300844c9965fd1d7391da7d8" title="临时修改镜像应用 [docker commit、push]"><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">临时修改镜像应用 [docker commit、push]</span></span></h4><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a520976d17e046148223c05c6d1b1dac" data-id="a520976d17e046148223c05c6d1b1dac"><span><div id="a520976d17e046148223c05c6d1b1dac" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a520976d17e046148223c05c6d1b1dac" 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><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-71fa0540c111401ca5c10dea8e76e848" data-id="71fa0540c111401ca5c10dea8e76e848"><span><div id="71fa0540c111401ca5c10dea8e76e848" class="notion-header-anchor"></div><a class="notion-hash-link" href="#71fa0540c111401ca5c10dea8e76e848" title="Service【SVC】"><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">Service【SVC】</span></span></h3><div class="notion-text notion-block-250b14cace274cff933d0f99f3460e94">作用：通过label将外部流量引入到Pod里面</div><div class="notion-text notion-block-d5a8df0e5cb244e1b7ce518f41c00c59">通常情况下k8s集群内部可以自由访问svc数据，svc通过label指向Pod的label中</div><div class="notion-text notion-block-b7515451717e416c82c6d64d21e72699">外部用户无法访问，通过配置NodePort进行端口映射，才可以访问svc</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-d51b259cf89e42d5bf3efa256b064a3a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F8366367e-3614-4e5d-b841-35197651bfb9%2FUntitled.png?table=block&amp;id=d51b259c-f89e-42d5-bf3e-fa256b064a3a&amp;t=d51b259c-f89e-42d5-bf3e-fa256b064a3a&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-8dbfc6716a4747279ab48b8f2fbe082c">SVC的能力是由组件kube-proxy来实现的，转换成iptables规则</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-c07193011273479aad3262d75e122a42" data-id="c07193011273479aad3262d75e122a42"><span><div id="c07193011273479aad3262d75e122a42" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c07193011273479aad3262d75e122a42" title="SVC创建"><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">SVC创建</span></span></h4><div class="notion-text notion-block-67812d1957cf47daab9dacd6391bba26">方式一：命令方式 -expose</div><div class="notion-text notion-block-951bc2b547394c1ba745bb67a58dcddf">方式二：yaml清单方式 -apply</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-790b87dc86644e459c14119224884684" data-id="790b87dc86644e459c14119224884684"><span><div id="790b87dc86644e459c14119224884684" class="notion-header-anchor"></div><a class="notion-hash-link" href="#790b87dc86644e459c14119224884684" 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><div class="notion-text notion-block-462bf8f9eddd419383ac5ffd618869d6">k8s应用数据类型和步骤解析【网图】</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-64d10784678a4d16814ab906a6069ca4"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F95229638-bea6-4a88-96a3-ac9b4c1e1294%2FUntitled.png?table=block&amp;id=64d10784-678a-4d16-814a-b906a6069ca4&amp;t=64d10784-678a-4d16-814a-b906a6069ca4&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5c4c02d3524c42a0ae979d02241e330c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Ff65fc79c-5308-4096-8ea8-a70cbc927ca6%2FUntitled.png?table=block&amp;id=5c4c02d3-524c-42a0-ae97-9d02241e330c&amp;t=5c4c02d3-524c-42a0-ae97-9d02241e330c&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5b9c88aa195042ee9e83f5f1155ae808"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Ff7c2b5c6-b38d-4c5b-b1d3-dd41e9d6f1c8%2FUntitled.png?table=block&amp;id=5b9c88aa-1950-42ee-9e83-f5f1155ae808&amp;t=5b9c88aa-1950-42ee-9e83-f5f1155ae808&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-f22dbfa09fac4e83a3be5f21f8b5c7de"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F3083ada5-03a1-4801-89a2-deb5b2997271%2FUntitled.png?table=block&amp;id=f22dbfa0-9fac-4e83-a3be-5f21f8b5c7de&amp;t=f22dbfa0-9fac-4e83-a3be-5f21f8b5c7de&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-113d2d082f964bd4aa5a326ff5f63544"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F0375006b-808d-4fa3-a17b-74b0b58ed29d%2FUntitled.png?table=block&amp;id=113d2d08-2f96-4bd4-aa5a-326ff5f63544&amp;t=113d2d08-2f96-4bd4-aa5a-326ff5f63544&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-5200758457d9486f9d57a02d983cd473">示例1:emptyDir</div><div class="notion-text notion-block-0657a942c74548a49a4463daf54608a6">Pod madd-emptydir 中两个容器 nginx-web,change-index</div><div class="notion-text notion-block-922c9b73c804489c830c8cb78d6e11f1">共用一个数据卷 nginx-index，每两秒下change-index容器命令修改数据卷index页面信息，查看nginx-web页面会根据change-index容器的修改而变化</div><div class="notion-text notion-block-4568d8069e0d483089292030a0131dc5">示例2:hostPath</div><div class="notion-text notion-block-7e3ed064c07e44038039e2c560da79c0">下面几种不再赘述</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-26b1eae236714f1ba2d2eb67a0aa9f6e" data-id="26b1eae236714f1ba2d2eb67a0aa9f6e"><span><div id="26b1eae236714f1ba2d2eb67a0aa9f6e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#26b1eae236714f1ba2d2eb67a0aa9f6e" 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><div class="notion-text notion-block-54239162b3fe4a5582cff3962f2491f2"><b>示例一：configMap[通过代理svc取根据configMap 访问不同的容器]</b></div><div class="notion-text notion-block-c30f9de6ae264eccbedb021b692e8900"><b>示例二：secret</b></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-456cd7a9b1494768bd7122fe9452bfcc" data-id="456cd7a9b1494768bd7122fe9452bfcc"><span><div id="456cd7a9b1494768bd7122fe9452bfcc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#456cd7a9b1494768bd7122fe9452bfcc" title="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">Ingress</span></span></h3><div class="notion-text notion-block-fa43da3456524335b2bbf1b813328f65">Ingress是授权入站连接到达集群服务的规则集合。
从外部流量调度到nodeport上的service
从service调度到ingress-controller
ingress-controller根据ingress[Pod]中的定义（虚拟主机或者后端的url）
根据虚拟主机名直接调度到后端的一组应用pod中</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5e91038248b349c3a5f44b88a886648e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F0b800163-bcf8-4c3f-9fd8-21d06e8334d4%2FUntitled.png?table=block&amp;id=5e910382-48b3-49c3-a5f4-4b88a886648e&amp;t=5e910382-48b3-49c3-a5f4-4b88a886648e&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-aff64b7ce86f44a8bdd5152a696435b6">第一层service，用于接收流量</div><div class="notion-text notion-block-b49413894f42498aaacfc878202f468a">第二次service，用于【分组】分发流量指定pod</div><div class="notion-text notion-block-5c90e2b364524b36b733fbbb34627144">ingress需要专门的控制器环境</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-637dba38c7a24765b6312a22a03c5921" data-id="637dba38c7a24765b6312a22a03c5921"><span><div id="637dba38c7a24765b6312a22a03c5921" class="notion-header-anchor"></div><a class="notion-hash-link" href="#637dba38c7a24765b6312a22a03c5921" title="部署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">部署ingress环境</span></span></h4><div class="notion-text notion-block-6fbcd6d6e5294d5eb20eca14c4fa8de7"><a class="notion-link" href="https://kubernetes.github.io/ingress-nginx/deploy/" target="_blank" rel="noopener noreferrer">ingress-nginx官网</a></div><div class="notion-text notion-block-d7aa8bc0d9a34a36a0a1b7821aa7d886"><b>Ingress 属性解读</b></div><div class="notion-text notion-block-2065d8c820cd413d851da0ca68301e43"><code class="notion-inline-code">annotations</code> 注释的信息，表明是什么ingress环境，</div><div class="notion-text notion-block-9ed90305589b45dabef19935aa03db6c">对于k8s1.24+ 采用：<code class="notion-inline-code">spec.ingressClassName</code>: nginx</div><div class="notion-text notion-block-65d0f8aeb172402ea84e821c5aa65f27"><code class="notion-inline-code">rules</code>:实现根据<code class="notion-inline-code">path</code>的url关键字和svc的绑定</div><div class="notion-text notion-block-2439c7911be84e06a8561601165a96ae"><code class="notion-inline-code">pathType</code>:匹配方式</div><div class="notion-text notion-block-d89e91a7412c436fa1bd12fa5e1b3143"><span class="notion-red"><b>访问ingres，基于请求头</b></span><code class="notion-inline-code"><span class="notion-red"><b>host</b></span></code><span class="notion-red"><b>来进行数据匹配,如果使用IP地址访问必须携带请求头</b></span></div><div class="notion-blank notion-block-bab49f170fbc4063a979f65bbbc69485"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[搭建kubeneters集群]]></title>
            <link>https://blog.madd.cloudns.org/article/buildK8s</link>
            <guid>https://blog.madd.cloudns.org/article/buildK8s</guid>
            <pubDate>Fri, 22 Mar 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[学习K8S第一站]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-98c37ef60ba94a82ba6dc1817cac085c"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-598437c8fcce4168bf11d50ea2845ca0" data-id="598437c8fcce4168bf11d50ea2845ca0"><span><div id="598437c8fcce4168bf11d50ea2845ca0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#598437c8fcce4168bf11d50ea2845ca0" 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>概述</b></b></span></span></h2><div class="notion-text notion-block-ee605c24654c4db19cacb0c95b0fd396">  Kubernetes 是一个可移植、可扩展的开源平台，用于管理容器化的工作负载和服务，可促进声明式配置和自动化。 Kubernetes 拥有一个庞大且快速增长的生态，其服务、支持和工具的使用范围相当广泛。</div><figure class="notion-asset-wrapper notion-asset-wrapper-embed notion-block-2424b118aa204b7e84e62a52e66fac8d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:320px"><iframe class="notion-asset-object-fit" src="https://kubernetes.io/zh-cn/?spaceId=3e4b7a91-4f6f-435a-aa15-c60a064ef62a" title="iframe embed" frameBorder="0" allowfullscreen="" loading="lazy" scrolling="auto"></iframe></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-f75c8eac103a4b5082ea8f4a2a5c624c" data-id="f75c8eac103a4b5082ea8f4a2a5c624c"><span><div id="f75c8eac103a4b5082ea8f4a2a5c624c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f75c8eac103a4b5082ea8f4a2a5c624c" title="开始搭建K8S集群"><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">开始搭建K8S集群</span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-97f5a8be481543628c0722b319874c4b" data-id="97f5a8be481543628c0722b319874c4b"><span><div id="97f5a8be481543628c0722b319874c4b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#97f5a8be481543628c0722b319874c4b" 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>先决条件</b></b></span></span></h3><div class="notion-text notion-block-24550360a7fe488eaef08c03e5a3d93f">这里将通过虚拟机安装3台centos stream 9服务器，并组成kubeneters集群（1个master，2个worker节点）,以下是本次实践的基本环境信息：</div><ul class="notion-list notion-list-disc notion-block-9845676ca2bc48f9b83936baaf90dd07"><li>VMware Fusion <b>专业版 13.5.1 (23298085)</b></li></ul><ul class="notion-list notion-list-disc notion-block-ca86b9c74b9944a382e5b757dd04ebd8"><li>操作系统：centos stream 9</li></ul><ul class="notion-list notion-list-disc notion-block-9d83acc917ec4c04bca929f01dafbb77"><li>下载地址： <a class="notion-link" href="https://mirrors.centos.org/mirrorlist?path=/9-stream/BaseOS/aarch64/iso/CentOS-Stream-9-latest-aarch64-dvd1.iso&amp;redirect=1&amp;protocol=https" target="_blank" rel="noopener noreferrer">CentOS-Stream-9-latest-aarch64-dvd1.iso</a></li></ul><ul class="notion-list notion-list-disc notion-block-04405fa48618495ab227a51b9669144c"><li>k8s版本：v1.28.2</li></ul><ul class="notion-list notion-list-disc notion-block-e33a8dd27c644d84b1612578df3e27e3"><li>k8s网络插件：flannel</li></ul><ul class="notion-list notion-list-disc notion-block-7113de2e4cef4253af5a5286239650e2"><li>k8s存储插件：nfs</li></ul><ul class="notion-list notion-list-disc notion-block-37891b6adfc44ebeb422c306fa6275d0"><li>以下命令皆在<code class="notion-inline-code">root</code>用户下操作，非root权限用户，如果遇到命令操作没权限可以<code class="notion-inline-code">sudo </code>开始</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-835db577308748c78dd3c067c236d547" data-id="835db577308748c78dd3c067c236d547"><span><div id="835db577308748c78dd3c067c236d547" class="notion-header-anchor"></div><a class="notion-hash-link" href="#835db577308748c78dd3c067c236d547" title="一、在虚拟机（VMware Fusion）上安装操作系统"><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>一、在虚拟机（VMware </b>Fusion<b>）上安装操作系统</b></span></span></h2><div class="notion-text notion-block-00213e70ebb34d859d15f0618266b6f5"><b>在虚拟机中按安装3台服务器（内存2G，处理器数量1，处理器内核数量2，网络NAT模式）：</b></div><ul class="notion-list notion-list-disc notion-block-8a0c0100dab44de7a21aef55d7b3483a"><li>172.16.55.144 k8s-master</li></ul><ul class="notion-list notion-list-disc notion-block-c899e237b18a4f108e2311f8fcbc1aa4"><li>172.16.55.145 k8s-node1</li></ul><ul class="notion-list notion-list-disc notion-block-f4a80b30bfb545308ef7c372cf986ae9"><li>172.16.55.146 k8s-node2</li></ul><ul class="notion-list notion-list-disc notion-block-bf4fc5274f49441dbcc5101b644b502c"><li><code class="notion-inline-code">虚拟机</code>安装过程省略。。。</li></ul><ul class="notion-list notion-list-disc notion-block-11b9be29c7844371b3f97cebaf5ecf9e"><li><code class="notion-inline-code">docker</code>安装过程省略。。。</li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-2164272ba95240ecad12576219243774" data-id="2164272ba95240ecad12576219243774"><span><div id="2164272ba95240ecad12576219243774" class="notion-header-anchor"></div><a class="notion-hash-link" href="#2164272ba95240ecad12576219243774" title="二、安装k8s前的系统配置准备"><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>二、安装k8s前的系统配置准备</b></b></span></span></h2><div class="notion-text notion-block-ea8ec2d9e55d445aaa01b139f80db16f">在安装k8s前，通过官方文档了解到有一些服务器的配置工作，来保证k8s能顺利创建和工作。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-93204d58f9fe4ebcab67fb87961197d8" data-id="93204d58f9fe4ebcab67fb87961197d8"><span><div id="93204d58f9fe4ebcab67fb87961197d8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#93204d58f9fe4ebcab67fb87961197d8" title="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"><b>1、修改主机名称(每个节点)</b></span></span></h4><div class="notion-text notion-block-6a40f08f3292486d9cb8a1644ad85619">或者</div><div class="notion-text notion-block-e4481676b4254023bad963b05d80a902">修改主机名称，使用以下命令</div><div class="notion-text notion-block-cda7e4add4164cdfb37efd67270fef9c">将master主节点命名为<code class="notion-inline-code">k8s-master</code>、工作节点worker1命名为<code class="notion-inline-code">k8s-node1</code>、工作节点worker2命名为<code class="notion-inline-code">k8s-node2</code></div><div class="notion-text notion-block-ff6f6cc873d84e47b12ee9426e765cd0"><span class="notion-red">以master节点</span>为例；<span class="notion-red">其他两个节点执行同样</span>操作！</div><div class="notion-text notion-block-87d7facc605f4c75b3abeba4431ca43e">或者使用vim进行修改文件内容</div><div class="notion-text notion-block-87079f87fcd34c3780033560ff92df62">针对服务器可以使用<code class="notion-inline-code">shutdown -r</code>来安全重启机器，对于本地虚拟机则手动关机重启即可</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-b3d2dc892fc64b47bb14bdd00f08b614" data-id="b3d2dc892fc64b47bb14bdd00f08b614"><span><div id="b3d2dc892fc64b47bb14bdd00f08b614" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b3d2dc892fc64b47bb14bdd00f08b614" title="2、主机名与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>2、主机名与ip绑定(每个节点)</b></span></span></h4><div class="notion-text notion-block-660a148044084111a4cc9ea2454b1311"><span class="notion-red">以master节点</span>为例；<span class="notion-red">其他两个节点执行同样</span>操作！</div><div class="notion-text notion-block-90b8596b9257474d88c8c40a3b5ab702">添加参数，将主机与ip绑定</div><div class="notion-text notion-block-d8f95a6c3e4b40e59e4f1e2fd73b86e1">或者使用vim命令修改文件，将ip与名称参数填入</div><div class="notion-text notion-block-df027fa6d5e74b8882e19365a73f81df">或者使用echo</div><div class="notion-text notion-block-292a0005a48748e7b72a2aec1dccfd33">添加后查看如下</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-c1682f995e9749d890ea370f4f77e424" data-id="c1682f995e9749d890ea370f4f77e424"><span><div id="c1682f995e9749d890ea370f4f77e424" class="notion-header-anchor"></div><a class="notion-hash-link" href="#c1682f995e9749d890ea370f4f77e424" title="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"><b>3、关闭防火墙(每个节点)</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-b9fc323e2c7f4f37b4281f05121529e9" data-id="b9fc323e2c7f4f37b4281f05121529e9"><span><div id="b9fc323e2c7f4f37b4281f05121529e9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b9fc323e2c7f4f37b4281f05121529e9" title="4、关闭selinux(每个节点)"><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>4、关闭selinux(每个节点)</b></span></span></h4><div class="notion-text notion-block-96c42e4aff3445c1be56a6fb2813b06b">如果关闭失败，可直接修改<code class="notion-inline-code"><span class="notion-red">/etc/selinux/config</span></code><span class="notion-red"> </span><span class="notion-default">SELINUX=disabled</span></div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-600621f419304f10ac6dd452a4caf822" data-id="600621f419304f10ac6dd452a4caf822"><span><div id="600621f419304f10ac6dd452a4caf822" class="notion-header-anchor"></div><a class="notion-hash-link" href="#600621f419304f10ac6dd452a4caf822" title="5、关闭swap(每个节点)"><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>5、关闭swap(每个节点)</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-889acabc9a114bd88285de980016b786" data-id="889acabc9a114bd88285de980016b786"><span><div id="889acabc9a114bd88285de980016b786" class="notion-header-anchor"></div><a class="notion-hash-link" href="#889acabc9a114bd88285de980016b786" title="6、将桥接的 IPv4 流量传递到 iptables 的链(每个节点)"><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>6、将桥接的 IPv4 流量传递到 iptables 的链(每个节点)</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-5348191488d24fc59817db5cf38be366" data-id="5348191488d24fc59817db5cf38be366"><span><div id="5348191488d24fc59817db5cf38be366" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5348191488d24fc59817db5cf38be366" title="7、时间同步设置(每个节点)"><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>7、时间同步设置(每个节点)</b></span></span></h4><div class="notion-text notion-block-d0d7e768944a410b94c482c615e10cb3">先查看同步状态</div><ul class="notion-list notion-list-disc notion-block-439262d351c44f468923f7268a5ebf07"><li>时区参数<code class="notion-inline-code">Time zone: Asia/Shanghai(CST, +0800)</code>Asia/Shanghai表示上海时区</li></ul><ul class="notion-list notion-list-disc notion-block-68289dfdb20d4a74bcdfe92a08782762"><li>时钟是否同步参数<code class="notion-inline-code">System clock synchronized: yes</code>yes为同步</li></ul><ul class="notion-list notion-list-disc notion-block-6668cf2f07754d8b954d501a309709ad"><li>时钟同步服务是否开启<code class="notion-inline-code">NTP service: active</code>active为已开启</li></ul><div class="notion-text notion-block-a4d2ced9b9d24716ae496345732d594e">如未同步，则执行以下命令设置</div><div class="notion-text notion-block-46c4461e9d524ee5993f22d647611f49">设置时区（上海时区）</div><div class="notion-text notion-block-fa67fc6d370141229e8d8c4f33da25d2">设置时间同步</div><div class="notion-text notion-block-af7904da65bd41cc810fcb887a4987b9">或</div><div class="notion-text notion-block-e58e06d80c734475b8460ff652349043">然后输入date命令查看时间验证</div><div class="notion-text notion-block-d7cd8f5b897144669dece5726a9e9774">如果是本地创建的虚拟机则还需执行以下命令，如果是云服务器则可忽略</div><div class="notion-text notion-block-755cf9a531ef4717bc77dce4ab7fa6c8">当前UTC时间写入硬件时钟</div><div class="notion-text notion-block-b25f762e25b94c229ade30459ab68f5d">重启系统时间服务</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-bd48f84704464116888d063b70212186" data-id="bd48f84704464116888d063b70212186"><span><div id="bd48f84704464116888d063b70212186" class="notion-header-anchor"></div><a class="notion-hash-link" href="#bd48f84704464116888d063b70212186" title="8、容器配置加速器文件(每个节点)"><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">8、容器配置加速器文件<b>(每个节点)</b></span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-d8c1a0fa66364e4aa2a628e0f538f0e0" data-id="d8c1a0fa66364e4aa2a628e0f538f0e0"><span><div id="d8c1a0fa66364e4aa2a628e0f538f0e0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d8c1a0fa66364e4aa2a628e0f538f0e0" title="9、安装containerd"><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>9、安装containerd</b></span></span></h4><div class="notion-text notion-block-f0198ba20453473bb2d6bcd0e4715c2a">k8s依赖容器运行时（v1.24 弃用 dockershim）（如果需要使用docker，需要安装cri-dockerd组件），我们这里直接使用containerd。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-815592744cd74270b27b83e3d24ede4b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F911f0c5b-8437-4520-9f9b-4cb8a2fd00bd%2FUntitled.png?table=block&amp;id=81559274-4cd7-4270-b27b-83e3d24ede4b&amp;t=81559274-4cd7-4270-b27b-83e3d24ede4b&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3fbea1e7610c4d6bb0ee8aa041c69c1b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F20a33504-04df-4ad1-b19b-d37e5cb21009%2FUntitled.png?table=block&amp;id=3fbea1e7-610c-4d6b-b0ee-8aa041c69c1b&amp;t=3fbea1e7-610c-4d6b-b0ee-8aa041c69c1b&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cc9156daba7c40469cd3a725c605b969"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fea84f943-1583-4fb6-b956-9254c6e191c0%2FUntitled.png?table=block&amp;id=cc9156da-ba7c-4046-9cd3-a725c605b969&amp;t=cc9156da-ba7c-4046-9cd3-a725c605b969&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-6fb9874403b141c099afb28f1003d0d5" data-id="6fb9874403b141c099afb28f1003d0d5"><span><div id="6fb9874403b141c099afb28f1003d0d5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6fb9874403b141c099afb28f1003d0d5" title="10、更换国内清华大学Yum源"><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>10、更换国内清华大学Yum源</b></span></span></h4><ul class="notion-list notion-list-disc notion-block-60c6baf8ced846748ceb98739d0854b3"><li><b>备份系统自带的Yum源配置文件</b></li></ul><ul class="notion-list notion-list-disc notion-block-d628343144034287b08803097ad28d8c"><li><b>新建清华大学Yum源配置</b></li></ul><div class="notion-text notion-block-06c9349fb508496c95a19ff7821d2eff">填入如下内容</div><ul class="notion-list notion-list-disc notion-block-a69ec471e0d64edaa7e199c061b254ee"><li><b>重新清理和生成Yum源配置文件的缓存</b></li></ul><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-f69912f8cef6472a80a44251dd37ff4d" data-id="f69912f8cef6472a80a44251dd37ff4d"><span><div id="f69912f8cef6472a80a44251dd37ff4d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f69912f8cef6472a80a44251dd37ff4d" title="三、安装k8s集群及网络插件（flannel）"><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>三、安装k8s集群及网络插件（flannel）</b></span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-23a12a62274c4c28bd1f7e2e37eba1ae" data-id="23a12a62274c4c28bd1f7e2e37eba1ae"><span><div id="23a12a62274c4c28bd1f7e2e37eba1ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#23a12a62274c4c28bd1f7e2e37eba1ae" title="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"><b>1、添加kubernetes仓库(每个节点)</b></span></span></h3><div class="notion-text notion-block-728096cbaf9e4d9e834fbb9ce425251a">下面命令行中：以自己服务器类型而定，我这里是aarch64;
<code class="notion-inline-code">baseurl=https://mirrors.aliyun.com/kubernetes/yum/repos/kubernetes-el7-aarch64/</code></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5817739f1cc34d5186ee1a587b4f1d50"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fe988b6ea-1365-40d0-b145-973b705f984f%2FUntitled.png?table=block&amp;id=5817739f-1cc3-4d51-86ee-1a587b4f1d50&amp;t=5817739f-1cc3-4d51-86ee-1a587b4f1d50&amp;width=1820&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-ad55ee797a864f269d1396882251511f" data-id="ad55ee797a864f269d1396882251511f"><span><div id="ad55ee797a864f269d1396882251511f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#ad55ee797a864f269d1396882251511f" title="2、安装Kubernetes modules(每个节点)"><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>2、安装Kubernetes modules(每个节点)</b></span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-444b7b149df1449e9038154e5791b2f7" data-id="444b7b149df1449e9038154e5791b2f7"><span><div id="444b7b149df1449e9038154e5791b2f7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#444b7b149df1449e9038154e5791b2f7" title="3、部署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"><b>3、部署kubernetes集群</b></span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-40d7636c1675463dbc277c738b496d44" data-id="40d7636c1675463dbc277c738b496d44"><span><div id="40d7636c1675463dbc277c738b496d44" class="notion-header-anchor"></div><a class="notion-hash-link" href="#40d7636c1675463dbc277c738b496d44" title="在k8s-master节点上初始化集群"><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">在k8s-master节点上初始化集群</span></span></h4><div class="notion-text notion-block-15674caa1c6c463d8cab98ab94909505">kubeadm join从输出的末尾复制命令并将其保存在安全的地方。稍后我们将使用此命令来允许工作节点加入集群。如果您忘记复制该命令，或者找不到它，您可以使用以下命令重新生成它：</div><div class="notion-text notion-block-18e0dfd941db4809beb674dde11372f0">接下来按照输出提示创建和声明目录</div><div class="notion-text notion-block-ee3cba16252242f78d5756184360b874">将pod网络部署到集群</div><div class="notion-text notion-block-f63abc15ce35415a854ac7f5f16748f6">验证主节点现在是否准备就绪：</div><div class="notion-text notion-block-214002d308844bc6a6f9a15be8e29b5b">建议检查所有 Pod 是否正常运行：</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-b135487a146943ef965c93b1153307a6" data-id="b135487a146943ef965c93b1153307a6"><span><div id="b135487a146943ef965c93b1153307a6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b135487a146943ef965c93b1153307a6" title="在子节点（k8s-node1、k8s-node2）按照上面的提示添加工作节点"><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">在子节点（k8s-node1、k8s-node2）按照上面的提示添加工作节点</span></span></h4><div class="notion-text notion-block-f27af76c2a3842479bfbe4b7008a15a2">运行第（1）步kubeadm join的命令，将节点加入集群：</div><div class="notion-text notion-block-56562ce033ca4a19a08f254ca69a47b5"><code class="notion-inline-code">时间同步</code>、<code class="notion-inline-code">防火墙</code>、<code class="notion-inline-code">SELinux</code>、以及<code class="notion-inline-code">/etc/hosts</code>映射关系会影响节点的加入</div><div class="notion-text notion-block-a32a062d9a0e48c190ab942eaf5efef5">两个节点加入完成后，在k8s-master节点上验证：</div><div class="notion-text notion-block-194d3b43f0594368929beadf8e1aa74c">将子节点设置为worker角色：</div><div class="notion-text notion-block-34c9b9b9d99f4c08b4b6ee8520bbcea5">完成后，再次查看节点，可以看到ROLES变为了worker，至此，我们的集群就准备就绪了。</div><div class="notion-text notion-block-1ba20c00220746698793913b376f77bc">如果需要在子节点访问kubernetes集群</div><div class="notion-text notion-block-2f512f3e83ff400a8560b561bf8576ce">在子节点创建文件夹</div><div class="notion-text notion-block-a1405434edb345efbeb555a812f32909">在主节点执行如下命令</div><div class="notion-text notion-block-071b057297d14481a1a254aa73dfd72d">在子节点进行验证</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-eab44601115240f4ae9d31e0db2f6835" data-id="eab44601115240f4ae9d31e0db2f6835"><span><div id="eab44601115240f4ae9d31e0db2f6835" class="notion-header-anchor"></div><a class="notion-hash-link" href="#eab44601115240f4ae9d31e0db2f6835" title="四、安装Dashboard[主分支]"><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>四、安装Dashboard[主分支]</b></span></span></h2><div class="notion-text notion-block-f2ffe10a13c54c84a2035dbb5ace6ff0">Kubernetes Dashboard 是 Kubernetes 的官方 Web UI。它提供了集群的详细信息和管理功能。以下是安装和使用 Kubernetes Dashboard 的步骤：</div><div class="notion-text notion-block-0229b2480c034b559fe105ba4e52bc81">安装前需要先选择与你安装的Kubernetes对应版本的Dashboard，不然会出现各种问题。每个releases都会有一张对应表，如下图：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-bb0197446e3944e3b46143772b7935f9"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F44740335-97e2-478f-a374-20baf9b71591%2FUntitled.png?table=block&amp;id=bb019744-6e39-44e3-b461-43772b7935f9&amp;t=bb019744-6e39-44e3-b461-43772b7935f9&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-10b289359ca84f29acb7c30e11521518">安装Kubernetes Dashboard 7.X</div><div class="notion-text notion-block-c261476378dc428ca0f9ea8bebe75e84"><a class="notion-link" href="https://github.com/kubernetes/dashboard/releases" target="_blank" rel="noopener noreferrer">https://github.com/kubernetes/dashboard/releases</a></div><div class="notion-text notion-block-b2837ee8c3ce4b0d8416bf3a3365d72e">从7.x版开始，不再支持基于Manifest的安装。现在只支持基于<code class="notion-inline-code">Helm</code>的安装。由于多容器设置和对Kong网关API代理的严重依赖 要轻松支持基于清单安装是不可行的。</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-e8861ca2155441f29815061b1b0c45dc" data-id="e8861ca2155441f29815061b1b0c45dc"><span><div id="e8861ca2155441f29815061b1b0c45dc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e8861ca2155441f29815061b1b0c45dc" title="1、通过官方脚本安装Helm："><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>1、通过官方脚本安装Helm：</b></span></span></h4><div class="notion-text notion-block-0f6f2030cd564dfeada7eab5dfa1b2ff">安装成功后：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-cdbab013622e4493be20b13993f41973"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fcd7feac4-eacc-4769-80d4-c47529dbcd0c%2FUntitled.png?table=block&amp;id=cdbab013-622e-4493-be20-b13993f41973&amp;t=cdbab013-622e-4493-be20-b13993f41973&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-eca63bb170884961bc4bbc9e4a6c04b2"><b>查看svc</b>是否完成：</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-7e4824b1a94941898b5fa189560521d6" data-id="7e4824b1a94941898b5fa189560521d6"><span><div id="7e4824b1a94941898b5fa189560521d6" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7e4824b1a94941898b5fa189560521d6" title="2、修改NodePort端口，支持远程调用"><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>2、修改NodePort端口，支持远程调用</b></span></span></h4><div class="notion-blank notion-block-5ce322ea59874f3f8630c3178459b7cb"> </div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-686221d161ec4fd5bbf517eacadb45ed"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F2eb2b370-c3b9-4cd5-9d63-612b23f5d77f%2FUntitled.png?table=block&amp;id=686221d1-61ec-4fd5-bbf5-17eacadb45ed&amp;t=686221d1-61ec-4fd5-bbf5-17eacadb45ed&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-a9939e29423a462dbea9afda90ddc7c5">此时通过 https 访问 31946 端口即可打开 dashboard 控制台，需要 使用token登录</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-63ffd0b1c9c342538905b4770795b285"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Faf44f314-b979-4824-bf80-bad5d46827a8%2FUntitled.png?table=block&amp;id=63ffd0b1-c9c3-4253-8905-b4770795b285&amp;t=63ffd0b1-c9c3-4253-8905-b4770795b285&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-5224257fd7ab4ff890c697a5ba957369" data-id="5224257fd7ab4ff890c697a5ba957369"><span><div id="5224257fd7ab4ff890c697a5ba957369" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5224257fd7ab4ff890c697a5ba957369" title="3、创建token"><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、创建token</span></span></h4><div class="notion-text notion-block-01837a833a3c477fbdaea5acfc8654da"><b>kubernetes v1.24.0 更新之后进行创建 ServiceAccount 不会自动生成 Secret 需要对其手动创建</b></div><div class="notion-text notion-block-3c00996a801045d08b6ba514bc44fd9d">创建 Secret 资源并与 ServiceAccount 关联</div><div class="notion-text notion-block-0a757cc8da50480c8a53168e551db25d">绑定默认cluster-admin管理员集群角色</div><h4 class="notion-h notion-h3 notion-h-indent-1 notion-block-f982bcd29fb745da8ce37f29911808ed" data-id="f982bcd29fb745da8ce37f29911808ed"><span><div id="f982bcd29fb745da8ce37f29911808ed" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f982bcd29fb745da8ce37f29911808ed" title="4、创建长期Token"><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、创建长期Token</span></span></h4><div class="notion-text notion-block-34507c53c42240689694654b8d451f76">登录成功后可正常使用;在集群中找到Nodes可查看集群节点相关信息</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3013299ed75d49319f766e0086d249e7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F04f467dc-da1d-46bf-b7e0-954a871e7a63%2FUntitled.png?table=block&amp;id=3013299e-d75d-4931-9f76-6e0086d249e7&amp;t=3013299e-d75d-4931-9f76-6e0086d249e7&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-0ba98ae85e2544fe9150c1ebcf70d3d7" data-id="0ba98ae85e2544fe9150c1ebcf70d3d7"><span><div id="0ba98ae85e2544fe9150c1ebcf70d3d7" class="notion-header-anchor"></div><a class="notion-hash-link" href="#0ba98ae85e2544fe9150c1ebcf70d3d7" title="五、搭建kuboard[第三方可视化界面][主分支]"><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>五、搭建kuboard[第三方可视化界面][主分支]</b></span></span></h2><div class="notion-text notion-block-eb803fc90fc34e33ade1aef939ce7b01"><a class="notion-link" href="https://kuboard.cn/" target="_blank" rel="noopener noreferrer">kuboard官网地址</a></div><div class="notion-text notion-block-79e6198ea6ec4fff921c0bb08591d02e"><a class="notion-link" href="https://kuboard.cn/install/v3/install-in-k8s.html#%E5%AE%89%E8%A3%85" target="_blank" rel="noopener noreferrer">kuboard官网安装链接</a></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-4f064d3b9ff44f9f9af43b67b6f63e1f" data-id="4f064d3b9ff44f9f9af43b67b6f63e1f"><span><div id="4f064d3b9ff44f9f9af43b67b6f63e1f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#4f064d3b9ff44f9f9af43b67b6f63e1f" title="1、使用 hostPath 提供持久化"><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>1、使用 hostPath 提供持久化</b></span></span></h3><div class="notion-text notion-block-d72d6396f62b4986b74629666a522e95">执行下面快捷安装指令</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-b23e2f91d46c4d0892414c4e4017c130" data-id="b23e2f91d46c4d0892414c4e4017c130"><span><div id="b23e2f91d46c4d0892414c4e4017c130" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b23e2f91d46c4d0892414c4e4017c130" title="2、访问 Kuboard"><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>2、访问 Kuboard</b></span></span></h3><ul class="notion-list notion-list-disc notion-block-3ae6c4b5c32d4e1da047f1388cbfcdef"><li>在浏览器中打开链接 <code class="notion-inline-code">http://your-node-ip-address:30080</code></li></ul><ul class="notion-list notion-list-disc notion-block-82758f0de90c483d88ad1fc31bdb670e"><li>输入初始用户名和密码，并登录</li><ul class="notion-list notion-list-disc notion-block-82758f0de90c483d88ad1fc31bdb670e"><li>用户名： <code class="notion-inline-code">admin</code></li><li>密码： <code class="notion-inline-code">Kuboard123</code></li></ul></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b06c9468cbee473294af35b07d9545a6"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F07c851e3-c16e-443c-9ef2-2d3e4a8983be%2FUntitled.png?table=block&amp;id=b06c9468-cbee-4732-94af-35b07d9545a6&amp;t=b06c9468-cbee-4732-94af-35b07d9545a6&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a51cb3927ef94c54b9323e2155c370ae" data-id="a51cb3927ef94c54b9323e2155c370ae"><span><div id="a51cb3927ef94c54b9323e2155c370ae" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a51cb3927ef94c54b9323e2155c370ae" title="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、<b>卸载</b></span></span></h3><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-3b178d148e554a02b10cb478a07b8563" data-id="3b178d148e554a02b10cb478a07b8563"><span><div id="3b178d148e554a02b10cb478a07b8563" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3b178d148e554a02b10cb478a07b8563" 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><div class="notion-text notion-block-a1aa3177feb34c70bcd531536dfc3039">在 master 节点以及带有 <code class="notion-inline-code">k8s.kuboard.cn/role=etcd</code> 标签的节点上执行</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-d0eddc5cd8224e03bc2940abaece9588" data-id="d0eddc5cd8224e03bc2940abaece9588"><span><div id="d0eddc5cd8224e03bc2940abaece9588" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d0eddc5cd8224e03bc2940abaece9588" title="六、搭建私有仓库Harbor[主分支]"><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>六、搭建私有仓库Harbor[主分支]</b></span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f9fd83f754fa406893ffee310a1266f9" data-id="f9fd83f754fa406893ffee310a1266f9"><span><div id="f9fd83f754fa406893ffee310a1266f9" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f9fd83f754fa406893ffee310a1266f9" title="1、安装docker-compose"><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、安装docker-compose</span></span></h3><div class="notion-text notion-block-35d74b2f7b314905805acdbc3813ca14">下载地址：<a class="notion-link" href="https://github.com/docker/compose/releases" target="_blank" rel="noopener noreferrer">docker-compose</a></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-7eaa7d15e85d449da7ad2f71b49fd4e1" data-id="7eaa7d15e85d449da7ad2f71b49fd4e1"><span><div id="7eaa7d15e85d449da7ad2f71b49fd4e1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7eaa7d15e85d449da7ad2f71b49fd4e1" title="2、安装Harbor"><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、安装Harbor</span></span></h3><div class="notion-text notion-block-e1d9cd8b4a7e41e3a09c8a7571ebed8c">下面命令行中：以自己服务器类型而定，我这里是aarch64;</div><ul class="notion-list notion-list-disc notion-block-ca6f27ce7118419291a6b06e7c516947"><li>aarch64： <a class="notion-link" href="https://github.com/wise2c-devops/build-harbor-aarch64/releases" target="_blank" rel="noopener noreferrer">harbor-offline-installer-aarch64</a></li></ul><ul class="notion-list notion-list-disc notion-block-125dee570d064e47a35e2a42efd66633"><li>X86-64：<a class="notion-link" href="https://github.com/goharbor/harbor/releases" target="_blank" rel="noopener noreferrer">harbor-offline-installer</a></li></ul><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8487c8fbd9c04d9bad7a13a6e2d05b0e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F07190855-060a-4129-a6f5-4916138b2f95%2FUntitled.png?table=block&amp;id=8487c8fb-d9c0-4d9b-ad7a-13a6e2d05b0e&amp;t=8487c8fb-d9c0-4d9b-ad7a-13a6e2d05b0e&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-3ac1426ad5964ce78d567cc9b753e49d">账号admin，密码为<code class="notion-inline-code">harbor_admin_password</code> 对应的值，登录后可创建新角色用户</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-5af2a48e11a9493a8d300645a3b5164d" data-id="5af2a48e11a9493a8d300645a3b5164d"><span><div id="5af2a48e11a9493a8d300645a3b5164d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#5af2a48e11a9493a8d300645a3b5164d" title="3、定制Harbor服务启动文件"><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、定制Harbor服务启动文件</span></span></h3><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-268e07c30d3b4d2eab00aaa9895db16f" data-id="268e07c30d3b4d2eab00aaa9895db16f"><span><div id="268e07c30d3b4d2eab00aaa9895db16f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#268e07c30d3b4d2eab00aaa9895db16f" title="4、上传Harbor仓库[以nginx为例]"><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、上传Harbor仓库[以nginx为例]</span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-49da5ac3d440444f9aec3c3e21d2cb78"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fa8cb3607-38aa-4947-b18d-53861b821a25%2FUntitled.png?table=block&amp;id=49da5ac3-d440-444f-9aec-3c3e21d2cb78&amp;t=49da5ac3-d440-444f-9aec-3c3e21d2cb78&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-898a1c2771c24284a7dacc8d1cafc191" data-id="898a1c2771c24284a7dacc8d1cafc191"><span><div id="898a1c2771c24284a7dacc8d1cafc191" class="notion-header-anchor"></div><a class="notion-hash-link" href="#898a1c2771c24284a7dacc8d1cafc191" title="5、K8S拉取私有仓库镜像部署[集群中分支均可]"><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>5、K8S拉取私有仓库镜像部署[集群中分支均可]</b></span></span></h3><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5b1ccba319ae4c5ea511794521f9a3cc"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F92a2b8fb-2b35-4530-b3cc-fc7c86742a3d%2FUntitled.png?table=block&amp;id=5b1ccba3-19ae-4c5e-a511-794521f9a3cc&amp;t=5b1ccba3-19ae-4c5e-a511-794521f9a3cc&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1dfdcea973454cb4927f211d9bf41f02"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F3f80e97f-3460-4af4-a979-3f1a8337e125%2FUntitled.png?table=block&amp;id=1dfdcea9-7345-4cb4-927f-211d9bf41f02&amp;t=1dfdcea9-7345-4cb4-927f-211d9bf41f02&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-661e81ccf0294cf9b1ad0aca344b1e3e"> </div><div class="notion-blank notion-block-8632879f71c74615b11c2482f73b3064"> </div><div class="notion-blank notion-block-8f576b9a68dc47578999f20eb3872fd7"> </div><div class="notion-blank notion-block-4838127373f24b97b262f889e4ce712a"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DevOps]]></title>
            <link>https://blog.madd.cloudns.org/article/devOps</link>
            <guid>https://blog.madd.cloudns.org/article/devOps</guid>
            <pubDate>Mon, 22 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[学习DevOps第一站]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-76f5410f1ca547e0834705762c096064"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-b87a896ca88e41149d1bfeba42e76105" data-id="b87a896ca88e41149d1bfeba42e76105"><span><div id="b87a896ca88e41149d1bfeba42e76105" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b87a896ca88e41149d1bfeba42e76105" title="devOps"><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">devOps</span></span></h2><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-1aeee49fe0804df2b530a2ea05346afc" data-id="1aeee49fe0804df2b530a2ea05346afc"><span><div id="1aeee49fe0804df2b530a2ea05346afc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#1aeee49fe0804df2b530a2ea05346afc" title="一、DevOps介绍"><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>一、DevOps介绍</b></span></span></h2><div class="notion-text notion-block-3148440804e94ba299cd5d21bcee4107">软件开发最开始是由两个团队组成:
  开发计划由开发团队从头开始设计和整体系统的构建。需要系统不停的迭代更新。
  运维团队将开发团队的Code进行测试后部署上线。希望系统稳定安全运行。</div><div class="notion-text notion-block-8b407d9a09924796a7cf9abada1e9960">这看似两个目标不同的团队需要协同完成一个软件的开发。<div class="notion-text-children"><div class="notion-text notion-block-4e4d31929588454bace92d546167f052">在开发团队指定好计划并完成coding后，需要提供到运维团队。
运维团队向开发团队反馈需要修复的BUG以及一些需要返工的任务。</div></div></div><div class="notion-text notion-block-d571b73be4d043ccb1a4e236e21a7ea1">  这时开发团队需要经常等待运维团队的反馈。这无疑延长了事件并推迟了整个软件开发的周期。</div><div class="notion-text notion-block-c7e6b04eec404e488988e2c123693db5">  会有一种方式，在开发团队等待的时候，让开发团队转移到下一个项目中。等待运维团队为之前的代码提供反馈。可是这样就意味着一个完整的项目需要一个更长的周期才可以开发出最终代码。</div><div class="notion-text notion-block-055c1fb20be24ff484ba6d0ee7b924c9">  基于现在的互联网现状，更推崇敏捷式开发，这样就导致项目的迭代速度更快，但是由于开发团队与运维团队的沟通问题，会导致新版本上线的时间成本很高。这又违背的敏捷式开发的最初的目的。</div><div class="notion-text notion-block-17cb8df3799d4db890228a6d349882b3">  那么如果让开发团队和运维团队整合到成一个团队，协同应对一套软件呢?这就被称为DevOps。</div><div class="notion-text notion-block-f7db7069bccb41f09882c7ee5f4caf81">  DevOps，字面意思是Development &amp;Operations的缩写，也就是开发&amp;运维。虽然字面意思只涉及到了开发团队和运维团队，其实QA测试团队也是参与其中的。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-3e0fdf91be744c35a86be46b587346bd"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F37f4468a-275c-4e9f-b1b9-223ab1947b71%2FdevOps.jpeg?table=block&amp;id=3e0fdf91-be74-4c35-a86b-e46b587346bd&amp;t=3e0fdf91-be74-4c35-a86b-e46b587346bd&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-2ef3c16205fd43dd8dfd9ec12c9c1d87">核心就在于简化Dev和Ops团队之间的流程，使整体软件开发过程更快速。 整体的软件开发流程包括:</div><ul class="notion-list notion-list-disc notion-block-3de5fe27f11140d2993dba4c9c5d14c3"><li>PLAN:开发团队根据客户的目标制定开发计划 </li></ul><ul class="notion-list notion-list-disc notion-block-3dc34a4cdcd34cd4a883f5517e4554db"><li>CODE:根据PLAN开始编码过程，需要将不同版本的代码存储在一个库中。</li></ul><ul class="notion-list notion-list-disc notion-block-0a8c9dfc04b9437d92407f15aa7306b1"><li>BUILD:编码完成后，需要将代码构建并且运行。 </li></ul><ul class="notion-list notion-list-disc notion-block-35fbaf17ec9741c383c2310685458ed1"><li>TEST:成功构建项目后，需要测试代码是否存在BUG或错误。 </li></ul><ul class="notion-list notion-list-disc notion-block-b46284fb487440c5aea9acc33d0d1c36"><li>DEPLOY:代码经过手动测试和自动化测试后，认定代码已经准备好部署并且交给运维团队。 </li></ul><ul class="notion-list notion-list-disc notion-block-4e1a8c77976b4a4b95ae9c4ab055bc1b"><li>OPERATE:运维团队将代码部署到生产环境中。 </li></ul><ul class="notion-list notion-list-disc notion-block-4b90c5368fa44cd79f59b3cc020183eb"><li>MONITOR:项目部署上线后，需要持续的监控产品。</li></ul><ul class="notion-list notion-list-disc notion-block-2a06a29f2a3c49e8a446677cf3db4341"><li>INTEGRATE:然后将监控阶段收到的反馈发送回PLAN阶段，整体反复的流程就是DevOps的核 心，即持续集成、持续部署。</li></ul><div class="notion-text notion-block-93c902c328cc4efd95c6e8778329ba0f">DevOps 强调的是高效组织团队之间如何通过自动化的工具协作和沟通 来完成软件的生命周期管理，从而更快、更频繁地交付更稳定的软件。</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-068c7a912d044961852ea09beada1367" data-id="068c7a912d044961852ea09beada1367"><span><div id="068c7a912d044961852ea09beada1367" class="notion-header-anchor"></div><a class="notion-hash-link" href="#068c7a912d044961852ea09beada1367" title="二、Code阶段工具"><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>二、Code阶段工具</b></span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-fdfac2dea9f74260ae7babd6157c2c9b" data-id="fdfac2dea9f74260ae7babd6157c2c9b"><span><div id="fdfac2dea9f74260ae7babd6157c2c9b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#fdfac2dea9f74260ae7babd6157c2c9b" 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>先决条件</b></b></span></span></h3><div class="notion-text notion-block-2613dfc5115d438f9d1ec8a6e2b215d3">这里将通过虚拟机安装3台centos stream 9服务器，并组成kubeneters集群（1个master，2个worker节点）,以下是本次实践的基本环境信息：</div><ul class="notion-list notion-list-disc notion-block-22eb807811e44eed892c5903c6acc0dd"><li>VMware Fusion <b>专业版 13.5.1 (23298085)</b></li></ul><ul class="notion-list notion-list-disc notion-block-7d368a3350a24ddf8f03a27b7e564591"><li>操作系统：centos stream 9</li></ul><ul class="notion-list notion-list-disc notion-block-effa226893754aea87927e593ca37971"><li>下载地址： <a class="notion-link" href="https://mirrors.centos.org/mirrorlist?path=/9-stream/BaseOS/aarch64/iso/CentOS-Stream-9-latest-aarch64-dvd1.iso&amp;redirect=1&amp;protocol=https" target="_blank" rel="noopener noreferrer">CentOS-Stream-9-latest-aarch64-dvd1.iso</a></li></ul><ul class="notion-list notion-list-disc notion-block-c59651c0bda54963bfc26b8255fe364c"><li>k8s版本：v1.28.2</li></ul><ul class="notion-list notion-list-disc notion-block-08951318a6794c1a89720c6a10694803"><li>k8s网络插件：flannel</li></ul><ul class="notion-list notion-list-disc notion-block-37264f5610c9417f900944700d07b6fb"><li>k8s存储插件：nfs</li></ul><ul class="notion-list notion-list-disc notion-block-3257cb886a854e398d7270872fd3484b"><li>以下命令皆在<code class="notion-inline-code">root</code>用户下操作，非root权限用户，如果遇到命令操作没权限可以<code class="notion-inline-code">sudo </code>开始</li></ul><div class="notion-text notion-block-95d8371baa8b49849c25887cb5637dba"><b>在虚拟机中按安装3台服务器（内存4G，处理器数量1，处理器内核数量4，网络NAT模式）：</b></div><ul class="notion-list notion-list-disc notion-block-97122ab2669a4262a833ebf49f1d8e0d"><li>172.16.55.147 k8s-gitlab</li></ul><ul class="notion-list notion-list-disc notion-block-4432460e08dc411b9ed11db9927c4a92"><li>172.16.55.148 k8s-jenkins</li></ul><ul class="notion-list notion-list-disc notion-block-d47fceb43b794673a828b2865ea6c5a0"><li>docker、docker-compose 安装略</li></ul><div class="notion-blank notion-block-63305c545220443a909c3c20f1b4c0f9"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-f9337892f8904b26a83f352c1327d6b2" data-id="f9337892f8904b26a83f352c1327d6b2"><span><div id="f9337892f8904b26a83f352c1327d6b2" class="notion-header-anchor"></div><a class="notion-hash-link" href="#f9337892f8904b26a83f352c1327d6b2" title="1.centos stream9 修改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">1.centos stream9 修改IP方式</span></span></h3><div class="notion-blank notion-block-6c2edcd480854396a274f94908de0fb3"> </div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-771fd201ad054d909ab8f178ccb62639" data-id="771fd201ad054d909ab8f178ccb62639"><span><div id="771fd201ad054d909ab8f178ccb62639" class="notion-header-anchor"></div><a class="notion-hash-link" href="#771fd201ad054d909ab8f178ccb62639" title="2.1 Git安装"><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 Git安装</span></span></h3><div class="notion-text notion-block-bc747435df5a4c0cbd6a774084f16be6"><a class="notion-link" href="https://git-scm.com/" target="_blank" rel="noopener noreferrer">https://git-scm.com/</a>(傻瓜式安装)</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-56ad84f56d9e4b2cb1e8b9fdd7f68719" data-id="56ad84f56d9e4b2cb1e8b9fdd7f68719"><span><div id="56ad84f56d9e4b2cb1e8b9fdd7f68719" class="notion-header-anchor"></div><a class="notion-hash-link" href="#56ad84f56d9e4b2cb1e8b9fdd7f68719" title="2.2 GitLab安装[k8s-gitlab节点]"><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 GitLab安装[k8s-gitlab节点]</span></span></h3><div class="notion-text notion-block-e784bed56a6343e8a28c7fbb98d12b35">准备docker-compose.yml文件</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-e35bbc9ef12c42e5ae6aa309a79a6f22" data-id="e35bbc9ef12c42e5ae6aa309a79a6f22"><span><div id="e35bbc9ef12c42e5ae6aa309a79a6f22" class="notion-header-anchor"></div><a class="notion-hash-link" href="#e35bbc9ef12c42e5ae6aa309a79a6f22" title="三、Build阶段工具"><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>三、Build阶段工具</b></span></span></h2><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-06c806d4294449a4962d388b7054182d" data-id="06c806d4294449a4962d388b7054182d"><span><div id="06c806d4294449a4962d388b7054182d" class="notion-header-anchor"></div><a class="notion-hash-link" href="#06c806d4294449a4962d388b7054182d" title="下载jdk和maven[k8s-jenkins节点]"><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">下载jdk和maven<b>[k8s-jenkins节点]</b></span></span></h3><div class="notion-text notion-block-ce5c4fb6301f447d82e15ebf205637ec">jdk:
<a class="notion-link" href="https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html" target="_blank" rel="noopener noreferrer">JDK8下载地址</a></div><div class="notion-text notion-block-67261a6e93684e93a4435e9d92ebd860">maven:</div><div class="notion-text notion-block-c590d51acfc34444be5e9b5a88021f77"><a class="notion-link" href="https://maven.apache.org/download.cgi" target="_blank" rel="noopener noreferrer">MAVEN下载地址</a></div><div class="notion-text notion-block-2efa49295e034523bc954145e9480bcc">文件解压缩到<code class="notion-inline-code">/usr/local</code></div><div class="notion-text notion-block-cbace20a304a4bc69da9ab9abd13492c">修改maven <code class="notion-inline-code">setting.xml</code> 文件配置</div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-3ad8ca090cb7475eaa31d239800c78d8" data-id="3ad8ca090cb7475eaa31d239800c78d8"><span><div id="3ad8ca090cb7475eaa31d239800c78d8" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3ad8ca090cb7475eaa31d239800c78d8" title="四、Integrate工具"><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>四、Integrate工具</b></span></span></h2><div class="notion-text notion-block-4b8ea70d0dca43aba8f35ad02b2d7ce6">持续集成、持续部署的工具很多，其中Jenkins是一个开源的持续集成平台。
Jenkins涉及到将编写完毕的代码发布到测试环境和生产环境的任务，并且还涉及到了构建项目等任务。
Jenkins需要大量的插件保证工作，安装成本较高，下面会基于Docker搭建Jenkins。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-671f24ef58294bfea9afe74a5bd7d6bc" data-id="671f24ef58294bfea9afe74a5bd7d6bc"><span><div id="671f24ef58294bfea9afe74a5bd7d6bc" class="notion-header-anchor"></div><a class="notion-hash-link" href="#671f24ef58294bfea9afe74a5bd7d6bc" title="4.1 Jenkins介绍"><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>4.1 Jenkins介绍</b></span></span></h3><div class="notion-text notion-block-ae0f0bb12ca44972b7008eeaa1fbb963">Jenkins是一个开源软件项目，是基于Java开发的一种持续集成工具</div><div class="notion-text notion-block-e7723fb6e1c24d869a78e681c75564cd">Jenkins应用广泛，大多数互联网公司都采用Jenkins配合GitLab、Docker、K8s作为实现DevOps的核心
工具。</div><div class="notion-text notion-block-1263874700524d21b75e62590688b08b">Jenkins最强大的就在于插件，Jenkins官方提供了大量的插件库，来自动化CI/CD过程中的各种琐碎功能。</div><div class="notion-text notion-block-23ef7315a999402293f04b7c26d3d9b0">Jenkins最主要的工作就是将GitLab上可以构建的工程代码拉取并且进行构建，再根据流程可以选择发布到测试环境或是生产环境。
一般是GitLab上的代码经过大量的测试后，确定发行版本，再发布到生产环境。
CI/CD可以理解为:</div><div class="notion-text notion-block-c2de93142c94444ca6df00899727c404">CI过程即是通过Jenkins将代码拉取、构建、制作镜像交给测试人员测试。
   持续集成:让软件代码可以持续的集成到主干上，并自动构建和测试。</div><div class="notion-text notion-block-9032a368e6944f4f8fa1a4d173e22dee">CD过程即是通过Jenkins将打好标签的发行版本代码拉取、构建、制作镜像交给运维人员部署。
   持续交付:让经过持续集成的代码可以进行手动部署。     </div><div class="notion-text notion-block-e9fb1a2dc449418b86f0e2f7ff677d38">   持续部署:让可以持续交付的代码随时随地的自动化部署。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-635e29f7ce3d47ce90ff71a5752ff948" data-id="635e29f7ce3d47ce90ff71a5752ff948"><span><div id="635e29f7ce3d47ce90ff71a5752ff948" class="notion-header-anchor"></div><a class="notion-hash-link" href="#635e29f7ce3d47ce90ff71a5752ff948" title="4.2 Jenkins安装"><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>4.2 Jenkins安装</b></span></span></h3><div class="notion-text notion-block-bcf82b7693a84c6493d5a1b91760183b">准备docker-compose.yml文件</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-926f5b6d4f774ff3baceaba6b4faf940"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Faa4c3c43-f7a9-4206-9a13-29de3351fa7d%2FUntitled.png?table=block&amp;id=926f5b6d-4f77-4ff3-bace-aba6b4faf940&amp;t=926f5b6d-4f77-4ff3-bace-aba6b4faf940&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-83bcb30847974ca5a5e11b22ffffd92a">密码就是日志中的<code class="notion-inline-code">78c8fc14a64542f9ad7fdd50f4256c55</code></div><div class="notion-text notion-block-eab4fc61ee154ffcbee64bfc9f711f14">选择插件来安装</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e01d57eebb2b4c3c864fab17e7f85eb5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F380b1603-50d4-4898-bb6b-1c8f9f9a60ee%2FUntitled.png?table=block&amp;id=e01d57ee-bb2b-4c3c-864f-ab17e7f85eb5&amp;t=e01d57ee-bb2b-4c3c-864f-ab17e7f85eb5&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-92f84a6b4be449e28f85bf54cf327c56"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F07ea19ff-87ad-4bfd-84ca-3a2114032b09%2FUntitled.png?table=block&amp;id=92f84a6b-4be4-49e2-8f85-bf54cf327c56&amp;t=92f84a6b-4be4-49e2-8f85-bf54cf327c56&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-0efd26132dfd404d95a74ecb473edbf5">等待插件安装，如果网络不好，可以使用国内镜像源</div><div class="notion-text notion-block-d98780074f414e90b86d64cce62163d4">然后重启jenkins下载插件。</div><div class="notion-text notion-block-0773cf6b42b44f9d87294de6588a7a3b">除了上面的默认插件，还需要安装插件：</div><div class="notion-text notion-block-6e9a59dc25f245ce8cac5449312d9f1d">Git Parameter</div><div class="notion-text notion-block-00f9a47634a54ea5b5b741c07c459838">Publish Over SSH</div><div class="notion-text notion-block-46d4942f32624fa48434347d2d684fec">Environment Injector</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-845f66ccc19844abb76f362a24445c0a" data-id="845f66ccc19844abb76f362a24445c0a"><span><div id="845f66ccc19844abb76f362a24445c0a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#845f66ccc19844abb76f362a24445c0a" title="4.3 Jenkins配置"><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>4.3 Jenkins配置</b></span></span></h3><div class="notion-text notion-block-de4401c8071b48dc840d869797c2987a">JDK、MAVEN全局配置，应用并保存</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-4827c5713a624021970308325fa3737e"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F4a75b9da-11cd-4eb3-890a-82d200dfa035%2FUntitled.png?table=block&amp;id=4827c571-3a62-4021-9703-08325fa3737e&amp;t=4827c571-3a62-4021-9703-08325fa3737e&amp;width=2396&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-42f95b14daee4803a204fb3e0eece1ec"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F1303fb5e-37af-445f-8435-a092e7ea3e5a%2FUntitled.png?table=block&amp;id=42f95b14-daee-4803-a204-fb3e0eece1ec&amp;t=42f95b14-daee-4803-a204-fb3e0eece1ec&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-84879ae66c604fc5835cb0a37a66418a">系统管理配置：指定服务器中构建文件存放地址</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-dca7720c1e1f467cbb0f76d6071b3927"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fa7b0c8fa-d64a-4286-a6eb-43fa2ca949f0%2FUntitled.png?table=block&amp;id=dca7720c-1e1f-467c-bb0f-76d6071b3927&amp;t=dca7720c-1e1f-467c-bb0f-76d6071b3927&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-a6d590a130d8457ba127df288a7c837f" data-id="a6d590a130d8457ba127df288a7c837f"><span><div id="a6d590a130d8457ba127df288a7c837f" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a6d590a130d8457ba127df288a7c837f" title="4.4 Jenkins项目示例"><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>4.4 Jenkins项目示例</b></span></span></h3><div class="notion-text notion-block-83699da923194e3ea0673d24ee5904ac">创建一个基础简单的项目：springboot-shiro,[可自定义简单项目，用于区分不同分支下构建的校验]
在gitlab中创建，并指定两个分支</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-1162e321b6bc4c9aa9616b29db1fb0c3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F970a09cf-5178-48dd-b2b3-91c213788ac1%2FUntitled.png?table=block&amp;id=1162e321-b6bc-4c9a-a961-6b29db1fb0c3&amp;t=1162e321-b6bc-4c9a-a961-6b29db1fb0c3&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-f7993f520e044ff284f1c42226a01c00">代码信息：</div><div class="notion-text notion-block-594854da00dc41bb9f2a4d980d99f589">添加docker信息</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-7cf988647af04a4f8ae61c18a3f852f7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F628e05b1-e561-471d-8bb2-b661171c4223%2FUntitled.png?table=block&amp;id=7cf98864-7af0-4a4f-8ae6-1c18a3f852f7&amp;t=7cf98864-7af0-4a4f-8ae6-1c18a3f852f7&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-78ea896810de46f7a89fdc0bcb3163f6">docker-compose.yml</div><div class="notion-text notion-block-208660f54374456e8c0186f774e4fe20">Dockerfile</div><div class="notion-blank notion-block-ba7dd05383244c5cbf57f59c65950aa7"> </div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-92a78c7d6bc14b38926473ae8b4ab9bc"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fb93cb268-b574-4cfd-8e10-a58db911ff09%2FUntitled.png?table=block&amp;id=92a78c7d-6bc1-4b38-9264-73ae8b4ab9bc&amp;t=92a78c7d-6bc1-4b38-9264-73ae8b4ab9bc&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-acf7a6152bf0464597cf624294610ddc"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fb4ed8c98-6ad6-4dca-86f8-df4d4ecf09f8%2FUntitled.png?table=block&amp;id=acf7a615-2bf0-4645-97cf-624294610ddc&amp;t=acf7a615-2bf0-4645-97cf-624294610ddc&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b767f83583344ec882a44fea80233cd1"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F2fb81b02-9717-4822-a6c7-2d08f7538846%2FUntitled.png?table=block&amp;id=b767f835-8334-4ec8-82a4-4fea80233cd1&amp;t=b767f835-8334-4ec8-82a4-4fea80233cd1&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-67ee06fd71b34c3fac7871920108ea0b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F2db2b8ba-f8db-4ca5-a30b-639d09afa63e%2FUntitled.png?table=block&amp;id=67ee06fd-71b3-4c3f-ac78-71920108ea0b&amp;t=67ee06fd-71b3-4c3f-ac78-71920108ea0b&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b3d0a5d6e42a45b698bf08c2742e1ce3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F89bda003-ad24-44a0-8275-814d94a1ffda%2FUntitled.png?table=block&amp;id=b3d0a5d6-e42a-45b6-98bf-08c2742e1ce3&amp;t=b3d0a5d6-e42a-45b6-98bf-08c2742e1ce3&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-334d18bf40134690b82601a12387b279"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fab9c82af-8c84-45ec-8853-1b7734ddf68f%2FUntitled.png?table=block&amp;id=334d18bf-4013-4690-b826-01a12387b279&amp;t=334d18bf-4013-4690-b826-01a12387b279&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8098a8b8fbbf4bb6906b92e0f3065dbc"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fe1acaebc-cfd9-4a16-b0a1-2cdf59c3bad5%2FUntitled.png?table=block&amp;id=8098a8b8-fbbf-4bb6-906b-92e0f3065dbc&amp;t=8098a8b8-fbbf-4bb6-906b-92e0f3065dbc&amp;width=2800&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-a5e15ee4e98644879c574043717a5129"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F1dd47a73-1154-4c09-bb02-ba307d06d50d%2FUntitled.png?table=block&amp;id=a5e15ee4-e986-4487-9c57-4043717a5129&amp;t=a5e15ee4-e986-4487-9c57-4043717a5129&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-e2dd1c31db4543ae96650a2701cc0c12">看一下docker容器，已经发布到docker容器中</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-31e30a443cde47aeb00417128208aa22" data-id="31e30a443cde47aeb00417128208aa22"><span><div id="31e30a443cde47aeb00417128208aa22" class="notion-header-anchor"></div><a class="notion-hash-link" href="#31e30a443cde47aeb00417128208aa22" title="sonarqube安装"><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>sonarqube安装</b></span></span></h4><div class="notion-text notion-block-803f1ef5a43c45de878e22d74e182776">访问9000端口，原始账号密码admin/admin</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-2548fbf7d1d643459add9bd2be802bf7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Ffc106dfc-ff65-4b61-8a14-2d7718b1dcc9%2FUntitled.png?table=block&amp;id=2548fbf7-d1d6-4345-9add-9bd2be802bf7&amp;t=2548fbf7-d1d6-4345-9add-9bd2be802bf7&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-77fa2e245e7a4ab59684549b7452c566">安装中文插件：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-287cea7ab4f043b5ace1b149a10f4e6d"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F7a44ba53-ffe7-4981-938d-40018f185a40%2FUntitled.png?table=block&amp;id=287cea7a-b4f0-43b5-ace1-b149a10f4e6d&amp;t=287cea7a-b4f0-43b5-ace1-b149a10f4e6d&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-d7758f99b243498393649617958d42bd" data-id="d7758f99b243498393649617958d42bd"><span><div id="d7758f99b243498393649617958d42bd" class="notion-header-anchor"></div><a class="notion-hash-link" href="#d7758f99b243498393649617958d42bd" title="sonar-scanner安装"><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">sonar-scanner安装</span></span></h4><div class="notion-text notion-block-fc2adf2c2b4a46f0b728972de50f428a">服务器中安装sonar-scanner</div><div class="notion-text notion-block-5ac4c655ed78464d8ded12ac1c1b7bb4"><a class="notion-link" href="https://docs.sonarsource.com/sonarqube/latest/analyzing-source-code/scanners/sonarscanner/" target="_blank" rel="noopener noreferrer">sonar-scanner下载地址</a></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-fc80764481334ec2a829fbc5e7d0408c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F04c2aada-50de-4cf9-9dba-0ce1e4be9615%2FUntitled.png?table=block&amp;id=fc807644-8133-4ec2-a829-fbc5e7d0408c&amp;t=fc807644-8133-4ec2-a829-fbc5e7d0408c&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-9e95c45119824edc8858c616273367a8">jenkins 安装插件 <a class="notion-link" href="https://plugins.jenkins.io/sonar" target="_blank" rel="noopener noreferrer"><b>SonarQube ScannerVersion</b></a></div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-26287aa9339b489e864fcbaf60fb87ac"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F3ef476b0-5439-49fd-b793-2f09b3a74a23%2FUntitled.png?table=block&amp;id=26287aa9-339b-489e-864f-cbaf60fb87ac&amp;t=26287aa9-339b-489e-864f-cbaf60fb87ac&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-4f5faf09506645ac85deb5c4531c3485">记住token <code class="notion-inline-code">squ_e3bf74290deebf7f92595e45ff4441b46bfOcdf6</code></div><div class="notion-text notion-block-dcb466e741534f5a9fbd6e2bdbbdaef1">在jenkins中配置全局凭证</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-07f5cfa83f1a4019b6621c48994525ae"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fc6556b01-7e76-42fe-9145-e2662687f887%2FUntitled.png?table=block&amp;id=07f5cfa8-3f1a-4019-b662-1c48994525ae&amp;t=07f5cfa8-3f1a-4019-b662-1c48994525ae&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-b5afb9e3c7874a2f800a6c7b15bc9753"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F7fef539a-fc55-4bc3-bc61-105323be99d1%2FUntitled.png?table=block&amp;id=b5afb9e3-c787-4a2f-800a-6c7b15bc9753&amp;t=b5afb9e3-c787-4a2f-800a-6c7b15bc9753&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-d8113211f58e45efafd4615b43273b97">jenkins项目配置,在maven build之后配置</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-f6c9e02e03f94fc5b51bd9a62a0c6251"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fb706131c-f20f-462c-aba9-43a797cc3c49%2FUntitled.png?table=block&amp;id=f6c9e02e-03f9-4fc5-b51b-d9a62a0c6251&amp;t=f6c9e02e-03f9-4fc5-b51b-d9a62a0c6251&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-3bce01a24468438bb597ba3fe6a2c4fe" data-id="3bce01a24468438bb597ba3fe6a2c4fe"><span><div id="3bce01a24468438bb597ba3fe6a2c4fe" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3bce01a24468438bb597ba3fe6a2c4fe" title="配置jenkins容器支持操作宿主机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">配置jenkins容器支持操作宿主机docker配置【示例二适用】</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-9fecaf5dc8fb4926a71fd5840cc52ba1" data-id="9fecaf5dc8fb4926a71fd5840cc52ba1"><span><div id="9fecaf5dc8fb4926a71fd5840cc52ba1" class="notion-header-anchor"></div><a class="notion-hash-link" href="#9fecaf5dc8fb4926a71fd5840cc52ba1" title="修改jenkins项目配置"><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">修改jenkins项目配置</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-896024b68aa441678e94a95b3d93ca84"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fced24e7a-6aa6-4e94-8100-7807b98e5d83%2FUntitled.png?table=block&amp;id=896024b6-8aa4-4167-8e94-a95b3d93ca84&amp;t=896024b6-8aa4-4167-8e94-a95b3d93ca84&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-22cccc99fed5483d9a81bcccc6eb670e" data-id="22cccc99fed5483d9a81bcccc6eb670e"><span><div id="22cccc99fed5483d9a81bcccc6eb670e" class="notion-header-anchor"></div><a class="notion-hash-link" href="#22cccc99fed5483d9a81bcccc6eb670e" title="编写jenkins执行脚本文件【示例二适用】"><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">编写jenkins执行脚本文件【示例二适用】</span></span></h4><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-70155bc3302042958085cb32c206eda4" data-id="70155bc3302042958085cb32c206eda4"><span><div id="70155bc3302042958085cb32c206eda4" class="notion-header-anchor"></div><a class="notion-hash-link" href="#70155bc3302042958085cb32c206eda4" title="添加jenkins 构建后操作"><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">添加jenkins 构建后操作</span></span></h4><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-39199efd03544863bf9190344962c424"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F3ee8c965-56fb-48a1-8521-98317669c4c6%2FUntitled.png?table=block&amp;id=39199efd-0354-4863-bf91-90344962c424&amp;t=39199efd-0354-4863-bf91-90344962c424&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-4ba841072e2844679465f34e85c24283">其中的${BRANCH}来源于【构建环境】步骤中的配置</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-dc79fd7fa32c48f690816b2a717a59d0" data-id="dc79fd7fa32c48f690816b2a717a59d0"><span><div id="dc79fd7fa32c48f690816b2a717a59d0" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dc79fd7fa32c48f690816b2a717a59d0" title="4.5、Jenkins示例二（流水线）"><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.5、Jenkins示例二（流水线）</span></span></h3><div class="notion-text notion-block-f25fadb8d07349198a0e8a50ef2be83c">新建流水线任务：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-aaefa0975425448c9814d8066048898b"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fa17ef490-2b3f-45bb-87e7-2f41de767b86%2FUntitled.png?table=block&amp;id=aaefa097-5425-448c-9814-d8066048898b&amp;t=aaefa097-5425-448c-9814-d8066048898b&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-519c46d5285546dc8f14470ab04c8878">下面的git地址是Jenkinsfile的git地址，我是把这个文件放到了这个项目里，所以直接用这个项目的git地址：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-5aa0305175b94b149123bc504471e1b7"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F0519dbc2-fa50-4018-8dbd-67322a2e906d%2FUntitled.png?table=block&amp;id=5aa03051-75b9-4b14-9123-bc504471e1b7&amp;t=5aa03051-75b9-4b14-9123-bc504471e1b7&amp;width=2304&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-067d92ef50d440a9834b82b4b1ae441f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F5c1d52f5-952e-46e7-9886-d44c88b5107c%2FUntitled.png?table=block&amp;id=067d92ef-50d4-40a9-834b-82b4b1ae441f&amp;t=067d92ef-50d4-40a9-834b-82b4b1ae441f&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-89b7c00cae0c4a03a1e4722bd1a39cdd"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fa2a3b200-69eb-4296-aba9-52f1b8e9373a%2FUntitled.png?table=block&amp;id=89b7c00c-ae0c-4a03-a1e4-722bd1a39cdd&amp;t=89b7c00c-ae0c-4a03-a1e4-722bd1a39cdd&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-4bc49e4aec314cfc94ba3bc53b06e899">编辑Jenkinsfile,就是把示例一中的步骤通过这个脚本文件执行</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8da8cf7b45134fb18d9c69e5c24cb314"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F06a6ffa1-3544-4f69-9d2c-0e78c8979326%2FUntitled.png?table=block&amp;id=8da8cf7b-4513-4fb1-8d9c-69e5c24cb314&amp;t=8da8cf7b-4513-4fb1-8d9c-69e5c24cb314&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-86fc79908a2b45ef9e16e3518101f60b" data-id="86fc79908a2b45ef9e16e3518101f60b"><span><div id="86fc79908a2b45ef9e16e3518101f60b" class="notion-header-anchor"></div><a class="notion-hash-link" href="#86fc79908a2b45ef9e16e3518101f60b" title="4.6 钉钉通知配置"><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.6 钉钉通知配置</span></span></h3><div class="notion-text notion-block-f4024266aa1945318222d1b04a0ac215">下载插件DingTalk,我下载的是【2.7.3版本】，不同版本配置有差异；</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-ef08a73b684f490382f9a79aee681075"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F3f9518fb-ddfe-4514-a99a-cb3da4eba10e%2FUntitled.png?table=block&amp;id=ef08a73b-684f-4903-82f9-a79aee681075&amp;t=ef08a73b-684f-4903-82f9-a79aee681075&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-f075c5cb123b40e19ed94f6d864f69c5"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fdc80aab1-2fac-4008-9917-0e5e4e6761ea%2FUntitled.png?table=block&amp;id=f075c5cb-123b-40e1-9ed9-4f6d864f69c5&amp;t=f075c5cb-123b-40e1-9ed9-4f6d864f69c5&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-1a9c524bb7ff465d9b7cdb4a68481f41">钉钉群里面添加一个自定义机器人：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-8aac9925afc24d71b08d5685a1ad2f50"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F530b47ec-aafd-4f44-862e-a12da9528652%2FUntitled.png?table=block&amp;id=8aac9925-afc2-4d71-b08d-5685a1ad2f50&amp;t=8aac9925-afc2-4d71-b08d-5685a1ad2f50&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-58d041d646df4dee87dfca85d14e98d3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F90f2f13d-a087-4205-a428-e0f8b316bc84%2FUntitled.png?table=block&amp;id=58d041d6-46df-4dee-87df-ca85d14e98d3&amp;t=58d041d6-46df-4dee-87df-ca85d14e98d3&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-399dd5fdea8c489a844844a5f301b9af"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Ffaa9e516-5764-4d3d-86fd-52c3e4c9f4a1%2FUntitled.png?table=block&amp;id=399dd5fd-ea8c-489a-8448-44a5f301b9af&amp;t=399dd5fd-ea8c-489a-8448-44a5f301b9af&amp;width=2424&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-963e50c116344c5382aa7e0be55efe77">配置好后，可以右下角点击测试看一下</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-947e78cf54ad4829a70f6b31e36bf59c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F289c5944-4e5a-4bb7-9693-8900963e66b4%2FUntitled.png?table=block&amp;id=947e78cf-54ad-4829-a70f-6b31e36bf59c&amp;t=947e78cf-54ad-4829-a70f-6b31e36bf59c&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-fafea9ab6fc44524a733109f53789889">在示例二为例：[钉钉插件2.7.3版本，无需配置流水线脚本post{}]</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-023263f2f4f34571ae7d2c364d3ba285"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F048f306a-286c-46e6-b81e-4cb690d21347%2FUntitled.png?table=block&amp;id=023263f2-f4f3-4571-ae7d-2c364d3ba285&amp;t=023263f2-f4f3-4571-ae7d-2c364d3ba285&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-bf628767061644d5a3c565c0f511ff3a"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Faf7c130f-2a25-4c6d-8a4d-1c4088798d74%2FUntitled.png?table=block&amp;id=bf628767-0616-44d5-a3c5-65c0f511ff3a&amp;t=bf628767-0616-44d5-a3c5-65c0f511ff3a&amp;width=708&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-blank notion-block-7ffd789a1bac4de681e33de39c02b184"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Helm]]></title>
            <link>https://blog.madd.cloudns.org/article/helm</link>
            <guid>https://blog.madd.cloudns.org/article/helm</guid>
            <pubDate>Wed, 17 Apr 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[学习K8S第三站]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-0e772d78059145d09064bbd3425f0fda"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-7e8ee1706a944794aecded7812dbc489" data-id="7e8ee1706a944794aecded7812dbc489"><span><div id="7e8ee1706a944794aecded7812dbc489" class="notion-header-anchor"></div><a class="notion-hash-link" href="#7e8ee1706a944794aecded7812dbc489" title="Kubernetes包管理器Helm"><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">Kubernetes包管理器Helm</span></span></h2><div class="notion-text notion-block-381fb7fdb2b24088a02ae7ba4d80ec1d"><a class="notion-link" href="https://github.com/helm/helm" target="_blank" rel="noopener noreferrer">Helm-GitHub地址</a></div><figure class="notion-asset-wrapper notion-asset-wrapper-embed notion-block-b335378e54c548efbdde870a825cbcf3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:320px"><iframe class="notion-asset-object-fit" src="https://helm.sh/zh/?spaceId=3e4b7a91-4f6f-435a-aa15-c60a064ef62a" title="iframe embed" frameBorder="0" allowfullscreen="" loading="lazy" scrolling="auto"></iframe></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-049308d1ac0c4292998b4047e5f40925" data-id="049308d1ac0c4292998b4047e5f40925"><span><div id="049308d1ac0c4292998b4047e5f40925" class="notion-header-anchor"></div><a class="notion-hash-link" href="#049308d1ac0c4292998b4047e5f40925" 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-d3e644c91fcb46fd87b5ccbf1a705f03">helm的功能类似于yum 或 apt，提供应用部署时候所需要的各种配置、资源清单文件，他与yum之类工具不同的是，在k8s中helm是不提供镜像的，这些镜像文件需要由专门的镜像仓库来提供。</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-e2e04d9ad50d45c9a5a0125137491dc3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fd1992375-f136-44e6-907f-5da0fc17c791%2FUntitled.png?table=block&amp;id=e2e04d9a-d50d-45c9-a5a0-125137491dc3&amp;t=e2e04d9a-d50d-45c9-a5a0-125137491dc3&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-a7d67da5cd2e421799c288f3df8ad53f">基于helm来成功的部署一个应用服务，完整的工作流程如下：
1 部署一个稳定运行的k8s集群，在能管理k8s的主机上部署helm。
2 用户在客户端主机上，定制各种Chart资源和config资源，上传到专用的仓库(本地或者远程)
3 helm客户端向Tiller发出部署请求，如果本地有chart用本地的，否则从仓库获取
4 Tiller与k8s集群的api-server发送请求
5 api-server通过集群内部机制部署应用，需要依赖镜像的时候，从专门的镜像仓库获取。
6 基于helm部署好的应用实例，在k8s集群中，我们称之为release。</div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-598e9065e8774e189861abcefc4d071c" data-id="598e9065e8774e189861abcefc4d071c"><span><div id="598e9065e8774e189861abcefc4d071c" class="notion-header-anchor"></div><a class="notion-hash-link" href="#598e9065e8774e189861abcefc4d071c" title="v3介绍"><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">v3介绍</span></span></h3><div class="notion-text notion-block-4dc13cfb4e544c93878ea81cdf73189b">根据我们对 helm v2 版本的流程解析，我们发现，在客户端上部署tiller来维护 release相关的信息，有些太重量级了，所以在 helm v3 版本的时候，就剔除了专门的Tiller。在 Helm v3 中移除了 Tiller, 版本相关的数据直接存储在了 Kubernetes 中.</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-820a255226f447b1936ba59687cf43f3"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Faa3f3610-0fc0-4ca0-9832-bf32cead690d%2FUntitled.png?table=block&amp;id=820a2552-26f4-47b1-936b-a59687cf43f3&amp;t=820a2552-26f4-47b1-936b-a59687cf43f3&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-819a067740fe460d90bfe1ba53fdb64a" data-id="819a067740fe460d90bfe1ba53fdb64a"><span><div id="819a067740fe460d90bfe1ba53fdb64a" class="notion-header-anchor"></div><a class="notion-hash-link" href="#819a067740fe460d90bfe1ba53fdb64a" 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-7ebfd4a2b1e1467a9a0352b3ffef7720"><b>通过官方脚本安装Helm：</b></div><div class="notion-text notion-block-605f724ca2ff40d58896192e1eb63f68">也可以通过官方其他的安装方式：</div><figure class="notion-asset-wrapper notion-asset-wrapper-embed notion-block-427e3d93cfa74d0587457d8e74bf146f"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:320px"><iframe class="notion-asset-object-fit" src="https://helm.sh/zh/docs/intro/install/?spaceId=3e4b7a91-4f6f-435a-aa15-c60a064ef62a" title="iframe embed" frameBorder="0" allowfullscreen="" loading="lazy" scrolling="auto"></iframe></div></figure><div class="notion-text notion-block-1578aa66ee584f17851ed703f37b06ed">案例可参考安装kubernetes-dashboard</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-6668c893dc114430987f6dfe1bb2c01c"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2Fc110f307-1be7-4bd0-9ec8-9aa480a434ce%2FUntitled.png?table=block&amp;id=6668c893-dc11-4430-987f-6dfe1bb2c01c&amp;t=6668c893-dc11-4430-987f-6dfe1bb2c01c&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><div class="notion-text notion-block-4aff70aa689f41b498521e67e6b80470">安装完成后，可以去缓存中查看，缓存地址如下：</div><figure class="notion-asset-wrapper notion-asset-wrapper-image notion-block-79b387ce191d4b8c99906ae539fc26b6"><div style="position:relative;display:flex;justify-content:center;align-self:center;width:100%;max-width:100%;flex-direction:column;height:100%"><img style="object-fit:cover" src="https://www.notion.so/image/https%3A%2F%2Fprod-files-secure.s3.us-west-2.amazonaws.com%2F3e4b7a91-4f6f-435a-aa15-c60a064ef62a%2F03f28351-0811-4060-8d7c-b73d2e753230%2FUntitled.png?table=block&amp;id=79b387ce-191d-4b8c-9990-6ae539fc26b6&amp;t=79b387ce-191d-4b8c-9990-6ae539fc26b6&amp;width=556.5&amp;cache=v2" alt="notion image" loading="lazy" decoding="async"/></div></figure><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-3d81b8cd5c844f80832c184e9338fdc5" data-id="3d81b8cd5c844f80832c184e9338fdc5"><span><div id="3d81b8cd5c844f80832c184e9338fdc5" class="notion-header-anchor"></div><a class="notion-hash-link" href="#3d81b8cd5c844f80832c184e9338fdc5" 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><div class="notion-text notion-block-b37c916f2b914ff997c4fe3847b996c2">chart包结构，里面都是资源清单信息如下：</div><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-81a7a0e3d0e849ea8b7bce02b86b6f35" data-id="81a7a0e3d0e849ea8b7bce02b86b6f35"><span><div id="81a7a0e3d0e849ea8b7bce02b86b6f35" class="notion-header-anchor"></div><a class="notion-hash-link" href="#81a7a0e3d0e849ea8b7bce02b86b6f35" 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><h4 class="notion-h notion-h3 notion-h-indent-2 notion-block-b12c02a7cb3142d5b6ddac95232d03b3" data-id="b12c02a7cb3142d5b6ddac95232d03b3"><span><div id="b12c02a7cb3142d5b6ddac95232d03b3" class="notion-header-anchor"></div><a class="notion-hash-link" href="#b12c02a7cb3142d5b6ddac95232d03b3" 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><div class="notion-text notion-block-6fc0ac0e961549c992f4022d17fff09b">文件夹下存在一个<code class="notion-inline-code">values.yaml</code>，里面就是模版中引用的数据，<b>修改自己需要的数据信息，就可以定制安装chart包</b></div><div class="notion-callout notion-gray_background_co notion-block-fdd08a9dde8145599949efa6bcbda446"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="💡">💡</span></div><div class="notion-callout-text">Helm总结：<ul class="notion-list notion-list-disc notion-block-a61b43e93c024487bc0b6b9194df520b"><li>定位：快速部署K8s应用</li></ul><ul class="notion-list notion-list-disc notion-block-ad0bcb33b94d4decab4239eea9f2862e"><li>结构：chart包，存在 模版、属性、配置、等一整套应用所需的资源清单信息</li></ul><ul class="notion-list notion-list-disc notion-block-918cd42eadf9441a82550c6999db3ee2"><li>定制：</li><ul class="notion-list notion-list-disc notion-block-918cd42eadf9441a82550c6999db3ee2"><div class="notion-text notion-block-4eb53dcb73424593a9b287c03d742ac8">helm install --set</div><div class="notion-text notion-block-cc5026d4daa04dba842cae23c80b71d0">修改values.yaml</div></ul></ul></div></div><div class="notion-blank notion-block-726b7a058a594bdd8e163e7ff999dddf"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[发工资了]]></title>
            <link>https://blog.madd.cloudns.org/article/workRecord</link>
            <guid>https://blog.madd.cloudns.org/article/workRecord</guid>
            <pubDate>Tue, 02 Jan 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[今天发工资了]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-432b88e40d304a5cb01fb5cccb805254"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-a9053ce705a04322871d38a45316c511" data-id="a9053ce705a04322871d38a45316c511"><span><div id="a9053ce705a04322871d38a45316c511" class="notion-header-anchor"></div><a class="notion-hash-link" href="#a9053ce705a04322871d38a45316c511" 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><div class="notion-callout notion-gray_background_co notion-block-250f4cb5673840c5b61583975bf9a367"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🔥">🔥</span></div><div class="notion-callout-text">时隔多日，今天是2024年4月18日上午，早上8点55分，我，博主，2024年1月的工资发了！工资发了！发了！了！</div></div><div class="notion-blank notion-block-c1bfd8a7be3746498f19bca44c350e17"> </div><div class="notion-blank notion-block-2be41fab1f1c4ab786c95b6408f0cdf0"> </div></main></div>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[2024年上班第一天]]></title>
            <link>https://blog.madd.cloudns.org/article/weekdayOne</link>
            <guid>https://blog.madd.cloudns.org/article/weekdayOne</guid>
            <pubDate>Tue, 02 Jan 2024 00:00:00 GMT</pubDate>
            <description><![CDATA[这是我2024年上班第一天]]></description>
            <content:encoded><![CDATA[<div id="notion-article" class="mx-auto overflow-hidden "><main class="notion light-mode notion-page notion-block-400cbb0982084960ab328241a05fce4e"><div class="notion-viewport"></div><div class="notion-collection-page-properties"></div><h2 class="notion-h notion-h1 notion-h-indent-0 notion-block-6c4cc53a6c1a49038c050bf530d9ef44" data-id="6c4cc53a6c1a49038c050bf530d9ef44"><span><div id="6c4cc53a6c1a49038c050bf530d9ef44" class="notion-header-anchor"></div><a class="notion-hash-link" href="#6c4cc53a6c1a49038c050bf530d9ef44" 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><blockquote class="notion-quote notion-block-c0844f374f9443f385456b121b3c45cf"><div>春回大地，万象一新</div></blockquote><div class="notion-callout notion-gray_background_co notion-block-7d3a8d38ceaa4aaab33c540445650f76"><div class="notion-page-icon-inline notion-page-icon-span"><span class="notion-page-icon" role="img" aria-label="🔥">🔥</span></div><div class="notion-callout-text">公司还欠着我去年11月份的工资没有发😤，当然去年12月份的工资是今年1月25号发，不知道是不是依旧欠着😤</div></div><h3 class="notion-h notion-h2 notion-h-indent-1 notion-block-dcd99a46d4874e9898c0c3004cf08cfa" data-id="dcd99a46d4874e9898c0c3004cf08cfa"><span><div id="dcd99a46d4874e9898c0c3004cf08cfa" class="notion-header-anchor"></div><a class="notion-hash-link" href="#dcd99a46d4874e9898c0c3004cf08cfa" 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-535a6b567ade410fb71b5a554408074f">搬砖的一天开始了！</div><div class="notion-text notion-block-0ce1ff150c0c4ff68be7592cbe713abe">9点了！到公司了，上上个月的工资没有发，工作热情-50%！</div><div class="notion-text notion-block-849f50964ea946038a0d0fac1bc9ca47">开始处理BUG！</div><div class="notion-text notion-block-079652c7c1e34c52a2ac81b3498b37d7">11点了！去美团拼好饭，领了一个1.5的红包，开心收下！今天有辣椒炒肉丝，点它！</div><div class="notion-text notion-block-12cd119f1fb342f38d61baacd2825098">这会摸会鱼，写一下博客</div><div class="notion-text notion-block-df86ed57e2134ecb8d2c7732c3263ebb">12点了，饭到了，到楼下取餐，途中打开了TiMi 王者荣耀，又是上分的一天！</div><div class="notion-text notion-block-e4bef027666c43ab8b256dcd343fbb3c">下午一点了，又要开始搬砖了！</div><div class="notion-text notion-block-c0620e4f57cd4021ab0eec3f01449ce7">14点了！什么时候发工资？什么时候发工资？</div><div class="notion-text notion-block-34f627559c0742dc9196427c854b4e56">15点了！还不发工资？</div><div class="notion-text notion-block-91656852aed146459d532ced0c5d1729">17点了，项目上线发版！</div><div class="notion-text notion-block-f75f78a6ca764cf3a58c077831a3c2ef">验证中…...     完美！</div><div class="notion-text notion-block-86a50b61933b481ea8e5c57827c9ccea">悦耳！【手机铃声】5 ，4，3，2，1！我下班了蟹老板！</div><div class="notion-text notion-block-071a82d4caed40f2947434027bd3e9fa">啊！又是平平无奇的一天！</div><div class="notion-blank notion-block-a5c19b5475a540e3b23d40384807547b"> </div></main></div>]]></content:encoded>
        </item>
    </channel>
</rss>