手把手带你一键部署 Kubernetes + KubeSphere 至 Linux
<p>本文介绍一个最快安装 Kubernetes 和体验 KubeSphere 核心功能的方式,all-in-one 模式可一键安装<strong>Kubernetes v1.15.5</strong> 和 KubeSphere 至一台 Linux 机器。</p><blockquote>
<p>提示:</p>
<ul>
<li>KubeSphere 2.1 已支持 <code>自定义安装各个功能组件</code>,用户可根据<strong>业务需求和机器配置选择安装所需的组件</strong>,默认仅开启<code>最小化安装</code>,参考 安装说明 开启可选组件的安装。</li>
<li>若在云平台使用在线安装,可通过调高带宽的方式来加快安装速度。</li>
</ul>
</blockquote>
<h2 id="前提条件">前提条件</h2>
<p>建议关闭网络防火墙。</p>
<h2 id="第一步-准备主机">第一步: 准备主机</h2>
<p>参考以下节点规格准备一台符合要求的主机节点开始 <code>all-in-one</code> 模式的安装,为防止软件版本冲突,<strong>建议选择一台干净的机器</strong>。</p>
<blockquote>
<p>说明:</p>
<ul>
<li>若使用 ubuntu 16.04 建议使用其最新的版本 16.04.5;</li>
<li>若使用 ubuntu 18.04,则需要使用 root 用户;</li>
<li>若 Debian 系统未安装 sudo 命令,则需要在安装前使用 root 用户执行 <code>apt update && apt install sudo</code> 命令安装 sudo 命令后再进行安装。</li>
</ul>
</blockquote>
<table>
<thead>
<tr>
<th>操作系统</th>
<th>最小配置</th>
</tr>
</thead>
<tbody>
<tr>
<td>CentOS 7.5 (64 bit)</td>
<td>CPU:2 核, 内存:4 G, 系统盘:100 G</td>
</tr>
<tr>
<td>Ubuntu 16.04/18.04 LTS (64 bit)</td>
<td>CPU:2 核, 内存:4 G, 系统盘:100 G</td>
</tr>
<tr>
<td>Red Hat Enterprise Linux Server 7.4 (64 bit)</td>
<td>CPU:2 核, 内存:4 G, 系统盘:100 G</td>
</tr>
<tr>
<td>Debian Stretch 9.5 (64 bit)</td>
<td>CPU:2 核, 内存:4 G, 系统盘:100 G</td>
</tr>
</tbody>
</table>
<h2 id="第二步-准备安装包">第二步: 准备安装包</h2>
<p>下载 <code>KubeSphere 2.1.0</code> 安装包至待安装机器,进入安装目录。</p>
<pre><code class="language-bash">$ curl -L https://kubesphere.io/download/stable/v2.1.0 > installer.tar.gz \
&& tar -zxf installer.tar.gz && cd kubesphere-all-v2.1.0/scripts
</code></pre>
<h2 id="第三步-安装-kubesphere">第三步: 安装 KubeSphere</h2>
<p>KubeSphere 安装过程中将会自动化地进行环境和文件监测、平台依赖软件的安装、Kubernetes 和 etcd 的自动化安装,以及存储的自动化配置,安装成功后可通过 KubeSphere 控制台右上角点击关于查看安装的版本。</p>
<blockquote>
<p>说明:</p>
<ul>
<li>通常情况您不需要修改任何配置,直接安装即可。</li>
<li>网络插件默认是 <code>calico</code>,若您需要自定义安装参数,如网络、存储、负载均衡器插件、可选组件等相关配置需在 <strong><code>conf/common.yaml</code></strong> 文件中指定或修改,参考 集群组件配置说明。</li>
<li>存储默认用 OpenEBS 基于 Local Volume 提供持久化存储服务,OpenEBS 支持 动态申请 PV,<strong>方便初次安装但没有准备存储服务端的场景下进行部署测试</strong>,正式环境建议 配置持久化存储。</li>
<li>由于 Kubernetes 集群的 Cluster IP 子网网段默认是 <code>10.233.0.0/18</code>,Pod 的子网网段默认是 <code>10.233.64.0/18</code>,因此安装 KubeSphere 的节点 IP 地址范围不应与以上两个网段有重复,若遇到地址范围冲突可在配置文件 <code>conf/vars.yaml</code> 修改 <code>kube_service_addresses</code> 或 <code>kube_pods_subnet</code> 的参数。</li>
</ul>
</blockquote>
<p>参考以下步骤开始 all-in-one 安装:</p>
<blockquote>
<p>说明:安装时间跟网络情况和带宽、机器配置、安装节点个数等因素有关,已测试过的 all-in-one 模式,在网络良好的情况下以规格列表最小配置安装用时大约为 20 分钟。</p>
</blockquote>
<p><strong>1.</strong> 建议使用 <code>root</code> 用户安装,执行 <code>install.sh</code> 脚本:</p>
<pre><code class="language-bash">$ ./install.sh
</code></pre>
<p><strong>2.</strong> 输入数字 <code>1</code> 选择第一种即 all-in-one 模式开始安装:</p>
<pre><code class="language-bash">################################################
KubeSphere Installer Menu
################################################
* 1) All-in-one
* 2) Multi-node
* 3) Quit
################################################
https://kubesphere.io/ 2019-11-12
################################################
Please input an option: 1
</code></pre>
<p><strong>3.</strong> 验证 KubeSphere 单节点安装是否成功:</p>
<p><strong>(1)</strong> 待安装脚本执行完后,当看到如下 <code>"Successful"</code> 界面,则说明 KubeSphere 安装成功。</p>
<pre><code class="language-bash">successsful!
#####################################################
### Welcome to KubeSphere! ###
#####################################################
Console: http://192.168.0.8:30880
Account: admin
Password: P@88w0rd
NOTE:Please modify the default password after login.
#####################################################
</code></pre>
<blockquote>
<p>提示:如需要再次查看以上的界面信息,可在安装包目录下执行 <code>cat kubesphere/kubesphere_running</code> 命令查看。</p>
</blockquote>
<p><strong>(2)</strong> 安装成功后,浏览器访问对应的 URL,如 <code>http://{$IP}:30880</code>,即可进入 KubeSphere 登录界面,可使用默认的用户名和密码登录 KubeSphere 控制台体验,<strong>登录后请立即修改默认密码</strong>。参阅 快速入门 帮助您快速上手 KubeSphere。</p>
<h2 id="界面快览">界面快览</h2>
<p>查看最新的 v2.1 视频快览,也可以访问 Github。</p>
<p><img src="https://pek3b.qingstor.com/kubesphere-docs/png/20191005195724.png"></p>
<p><img src="https://pek3b.qingstor.com/kubesphere-docs/png/20191005200455.png"></p>
<p><img src="https://pek3b.qingstor.com/kubesphere-docs/png/20191005224733.png"></p>
<p><img src="https://pek3b.qingstor.com/kubesphere-docs/png/20190910172646.png"></p>
<p><img src="https://pek3b.qingstor.com/kubesphere-docs/png/20190910175008.png"></p>
<p>KubeSphere (https://github.com/kubesphere/kubesphere) 是一个开源的以应用为中心的容器平台,支持部署在任何基础设施之上,并提供简单易用的 UI,极大减轻日常开发、测试、运维的复杂度,旨在解决 Kubernetes 本身存在的存储、网络、安全和易用性等痛点,帮助企业轻松应对敏捷开发与自动化监控运维、端到端应用交付、微服务治理、多租户管理、多集群管理、服务与网络管理、镜像仓库、AI 平台、边缘计算等业务场景。</p><br><br>
来源:https://www.cnblogs.com/kubesphere/p/11939357.html
頁:
[1]