Skip to content

Commit

Permalink
Site updated: 2024-12-21 10:43:50
Browse files Browse the repository at this point in the history
  • Loading branch information
muzihuaner committed Dec 21, 2024
1 parent 8553f72 commit 5d6cdc5
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 9 deletions.
12 changes: 7 additions & 5 deletions 2024/12/21/Ubuntu22-04部署K3s/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<meta property="og:locale" content="zh_CN">
<meta property="og:image" content="https://docs.k3s.io/zh/assets/images/how-it-works-k3s-revised-9c025ef482404bca2e53a89a0ba7a3c5.svg">
<meta property="article:published_time" content="2024-12-20T17:14:33.000Z">
<meta property="article:modified_time" content="2024-12-21T02:07:15.570Z">
<meta property="article:modified_time" content="2024-12-21T02:36:34.891Z">
<meta property="article:author" content="木子欢儿">
<meta property="article:tag" content="Ubuntu">
<meta property="article:tag" content="K3s">
Expand Down Expand Up @@ -315,7 +315,7 @@
<i class="iconfont icon-chart"></i>

<!-- compatible with older versions-->
753
782

</span>

Expand Down Expand Up @@ -396,9 +396,11 @@ <h3 id="步骤-1:准备环境"><a href="#步骤-1:准备环境" class="heade

<h3 id="步骤-2:安装-K3s"><a href="#步骤-2:安装-K3s" class="headerlink" title="步骤 2:安装 K3s"></a>步骤 2:安装 K3s</h3><h4 id="1-使用官方安装脚本安装-K3s"><a href="#1-使用官方安装脚本安装-K3s" class="headerlink" title="1.使用官方安装脚本安装 K3s"></a><strong>1.使用官方安装脚本安装 K3s</strong></h4><figure class="highlight vim"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><code class="hljs vim">curl –sfL \<br> https://rancher-mirror.rancher.<span class="hljs-keyword">cn</span>/k3s/k3s-install.<span class="hljs-keyword">sh</span> | \<br> INSTALL_K3S_MIRROR=<span class="hljs-keyword">cn</span> <span class="hljs-keyword">sh</span> -s - \<br> --<span class="hljs-built_in">system</span>-default-registry <span class="hljs-string">&quot;registry.cn-hangzhou.aliyuncs.com&quot;</span><br></code></pre></td></tr></table></figure>

<p>查看当前集群所有服务和查看某一个pod状态</p>
<figure class="highlight sql"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs sql">kubectl <span class="hljs-keyword">get</span> services <span class="hljs-comment">--all-namespaces</span><br></code></pre></td></tr></table></figure>

<p>列出 所有命名空间 下的所有 服务(services)</p>
<figure class="highlight applescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs applescript">kubectl <span class="hljs-keyword">get</span> services <span class="hljs-comment">--all-namespaces</span><br></code></pre></td></tr></table></figure>
<p>列出 所有命名空间 下的所有 Pod</p>
<figure class="highlight applescript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs applescript">kubectl <span class="hljs-keyword">get</span> pods <span class="hljs-comment">--all-namespaces</span><br></code></pre></td></tr></table></figure>
<p>查看名为 kuboard-etcd-gvx6q 的 Pod 在 kuboard 命名空间中的详细信息</p>
<figure class="highlight excel"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><code class="hljs excel">kubectl describe pod kuboard-etcd-gvx6q -<span class="hljs-built_in">n</span> kuboard<br></code></pre></td></tr></table></figure>

<h4 id="2-配置镜像"><a href="#2-配置镜像" class="headerlink" title="2.配置镜像"></a>2.配置镜像</h4><h5 id="Docker"><a href="#Docker" class="headerlink" title="Docker"></a>Docker</h5><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><code class="hljs bash"><span class="hljs-built_in">echo</span> <span class="hljs-string">&#x27;&#123;&quot;registry-mirrors&quot;: [&quot;https://docker.1ms.run&quot;]&#125;&#x27;</span> | <span class="hljs-built_in">sudo</span> <span class="hljs-built_in">tee</span> /etc/docker/daemon.json &gt; /dev/null<br>systemctl daemon-reload<br>systemctl restart docker<br></code></pre></td></tr></table></figure>
Expand Down
Loading

0 comments on commit 5d6cdc5

Please sign in to comment.