miaoyun+Rancher+K8S学习与实践


Rancher部署易通记录

<p>Rancher v2.0使用手册 3 - Harbor配置HTTPS <a href="https://www.bookstack.cn/read/rancher-v2.x/c44b15556a55fb20.md">https://www.bookstack.cn/read/rancher-v2.x/c44b15556a55fb20.md</a> Rancher 2.x 微服务部署—Docker私有仓库Harbor(四) <a href="https://www.pianshen.com/article/41941162547/">https://www.pianshen.com/article/41941162547/</a> 记录的链接说明:每个链接中还有其它内容,可以参考。</p> <p>1 - Harbor单节点安装 <a href="https://www.bookstack.cn/read/rancher-v2.x/38fa439414b54d67.md">https://www.bookstack.cn/read/rancher-v2.x/38fa439414b54d67.md</a> 2 - Harbor HA安装 <a href="https://www.bookstack.cn/read/rancher-v2.x/fc6fa401bffc4e4b.md">https://www.bookstack.cn/read/rancher-v2.x/fc6fa401bffc4e4b.md</a> 3 - Harbor配置HTTPS <a href="https://www.bookstack.cn/read/rancher-v2.x/c44b15556a55fb20.md">https://www.bookstack.cn/read/rancher-v2.x/c44b15556a55fb20.md</a> 4 - 镜像仓库安装 <a href="https://www.bookstack.cn/read/rancher-v2.x/a4388431c6f83ecf.md">https://www.bookstack.cn/read/rancher-v2.x/a4388431c6f83ecf.md</a> 5 - 自签名ssl证书 <a href="https://www.bookstack.cn/read/rancher-v2.x/43c8d247182c02a2.md">https://www.bookstack.cn/read/rancher-v2.x/43c8d247182c02a2.md</a> 6 - HTTP代理配置 <a href="https://www.bookstack.cn/read/rancher-v2.x/673276dc0caaa47f.md">https://www.bookstack.cn/read/rancher-v2.x/673276dc0caaa47f.md</a> 7 - 安装和配置kubectl <a href="https://www.bookstack.cn/read/rancher-v2.x/e925591bb10d8a84.md">https://www.bookstack.cn/read/rancher-v2.x/e925591bb10d8a84.md</a> 8 - 文件下载 完</p> <h1>1 RancherUI系统配置添加镜像仓库</h1> <p>rancher入口:</p> <h3>1.1 选择项目</h3> <p>菜单选择 “全局||集群/easytong/default” 项目;</p> <h3>1.2 添加镜像仓库</h3> <p>菜单选择 “资源/密文”,页面如下:</p> <pre><code class="language-bash">密文列表 证书列表 镜像库凭证列表</code></pre> <h3>1.1.3 参考资料</h3> <p><a href="http://m.dockerinfo.net/286.html">http://m.dockerinfo.net/286.html</a></p> <h1>2 rancherUI添加configmap</h1> <h2>2.1 配置映射(相当于configmap)</h2> <p>Rancher入口</p> <h3>2.1.1 菜单选择 “全局||集群/easytong/default” 项目;</h3> <h3>2.1.2 菜单选择 “资源/配置映射”,页面右上角“添加配置映射”,如下:</h3> <pre><code class="language-bash">名称: 命名空间: 配置映射: 从文件读取 键: 值: 说明:注意配置文件的格式:行首为#,值为空,都会报错。</code></pre> <h2>2.2 部署工作负载(使用configmap)</h2> <p>主要看数据卷这一块</p> <pre><code class="language-bash">名称: 类型:Deployment dockker镜像: 命名空间: 端口映射: 端口名称 容器端口 协议 网线模式 主机监听端口 环境变量: 环境变量: 引用其它资源: 主机调度: 指定主机:K8S集群里任选一台主机(亲和) 每个Pod自动匹配主机: 添加规则:必须规则、最好规则、首选规则 健康检查: 无 TCP端口检查 HTTP请求状态检查(2xx或3xx) HTTPS请求状态检查(2xx或3xx) 容器中进程出状态码检查 数据卷: 卷名: 卷类型(配置映射卷)#即:2.1 配置映射(相当于configmap) 默认模式: 644 是/否 配置映射名: 选一个 所有键/选择特定的键 容器路径: 输入 是否只读 缩放/升级策略: 滚动:先启动新Pods,再停止旧Pods 滚动:先停止旧Pods,再启动新Pods 滚动:删除所有Pods,然后重新开始 自定义:</code></pre> <p>参考资料: <a href="https://www.cnblogs.com/jarno/p/12160575.html">https://www.cnblogs.com/jarno/p/12160575.html</a> <a href="https://segmentfault.com/a/1190000021420383">https://segmentfault.com/a/1190000021420383</a></p> <h1>3 Rancher2.x外置存储卷</h1> <h2>3.1 nfs服务器搭建</h2> <h2>3.2 配置NFS持久卷</h2> <h3>3.2.1 选择集群</h3> <p>菜单选择 “全局||集群/easytong”;</p> <h3>3.2.2 添加PV</h3> <p>菜单选择 “存储/持久卷”,页面右上角“添加PV”,如下:</p> <p>添加持久卷(PV) </p> <pre><code class="language-bash">名称:Myvolume 卷插件 容量 NFS Share 10GiB 插件配置 路径:/xtptvol 服务器:192.168.30.123 只读:否(是/否) 自定义 访问模式:多主机读写</code></pre> <h2>3.3 添加持久卷到项目</h2> <h3>3.3.1 选择项目并添加PVC</h3> <p>菜单选择 “全局||集群/easytong/default”,页面右上角“添加PVC”</p> <pre><code class="language-bash">名称 命名空间 et-svc-nfs default 来源 持久卷(PV) #即:上一步集群中创建的PV 使用现有的持久卷(PV) Myvolume 自定义:多主机读写</code></pre> <h2>3.4 服务上线(使用PVC)</h2> <pre><code class="language-bash">数据卷 卷名 卷类型 et-svc-nfs PVC PVC et-svc-nfs #在3.2 添加持久卷(PV)步在项目中添加的PVC 容器路径 /opt/easytong_server/bin /opt/easytong_server/logs</code></pre> <p>参考资料: Rancher2.0 外置存储卷 <a href="https://www.cnblogs.com/kingle-study/p/10463022.html">https://www.cnblogs.com/kingle-study/p/10463022.html</a></p> <h2>3.5 服务上线中的数据卷说明</h2> <p>在服务上线页的数据卷中包括如下内容:</p> <pre><code class="language-bash">添加临时卷 添加新的PVC 使用现有PVC 映射主机目录 密文卷 配置映射卷 证书卷</code></pre>

页面列表

ITEM_HTML