> ## Content Index
> Fetch the complete content index at: https://lucent.blog/llms.txt
> Use this file to discover other available public pages before exploring further.

# 使用Rancher-Ui在K8s集群中部署应用
- URL: https://lucent.blog/zai-ji-qun-zhong-bu-shu-ying-yong/
- Published: 2021-11-17T07:09:08.000Z
- Updated: 2026-08-21T00:49:56.000Z
- Author: Lucent
- Tags: Docker, K8s

### nginx为例

![image-20211026140552568](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211026140552568.png)

![image-20211026140608419](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211026140608419.png)

![image-20211026140745647](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211026140745647.png)

##### 名词解释

| 名词       | 解释                                                      |
| -------- | ------------------------------------------------------- |
| 名称       | 为该服务的名字，其他服务可以利用该名字直接访问到服务                              |
| Docker镜像 | 要部署服务的镜像，可以是中央仓库，也可以是自建私库                               |
| 端口映射     | 将服务器端口和容器内部端口绑定，通过访问服务器端口即可访问部署的服务                      |
| 容器端口     | 容器内部端口                                                  |
| 主机监听端口   | 宿主机的端口（服务器）                                             |
| 网络模式     | NodePort模式，无论服务部署在集群哪个节点上，只要访问集群任意服务器的公网ip:端口，都可以访问到该服务 |

点击**启动**

![image-20211026140829587](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211026140829587.png)

访问任意集群ip+刚刚设置的端口（图片与上图设置的端口不符，请忽略）

![image-20211026141643155](https://img-1251540275.cos.ap-shanghai.myqcloud.com/uPic/image-20211026141643155.png)

至此，利用Rancher部署k8s集群并部署项目就完成了