Skip to main content

2.11 RANCHER 监控

1. 什么是rancher?

Rancher 是一个 Kubernetes 管理工具,让你能在任何地方和任何提供商上部署和运行集群。 Rancher 可以创建来自 Kubernetes 托管服务提供商的集群,创建节点并安装 Kubernetes,或者导入在任何地方运行的现有 Kubernetes 集群。

2. rancher 2.7版本配置

2.1.登录rancher平台,检查当前monitor模块状态

访问rancher平台,用账号密码登录 enter image description here

2.2.查看集群Monitoring应用启用状态

主页集群列表,点击进入任意集群 enter image description here 点击“集群工具”按钮,查看monitoring应用安装状态 enter image description here 一般情况下应用未安装,按如下步骤进行安装

2.3.安装Monitoring应用

点击“安装”按钮进入 enter image description here 如图所示配置,然后点击安装按钮等待安装完成 (内存、CPU按实际环境酌情配置) enter image description here

3.rancher 2.5版本配置

3.1.登录rancher平台,检查当前monitor模块状态

访问rancher平台,用账号密码登录 enter image description here

3.2.查看集群Monitoring应用启用状态

主页集群列表,点击进入任意集群 enter image description here 点击“工具”按钮,查看monitoring应用安装状态 enter image description here enter image description here 一般情况下应用未安装,按如下步骤进行安装

3.3.启用监控

如图所示配置启用 enter image description here 如有提示版本不支持,则需要点击安装应用 enter image description here 配置如下 (内存、CPU按实际环境酌情配置) enter image description here 应用安装重启需要一定时间完成(一般10分钟)

4.监控数据访问

查看可用服务 enter image description here 以下格式访问平台
https://192.168.2.30:8443/k8s/clusters/local/api/v1/namespaces/cattle-monitoring-system/services/http:rancher-monitoring-grafana:80/proxy/metrics
enter image description here 访问可获得如下prometheus exporter 数据格式 enter image description here

5.监控对象操作

5.1.导入rancher模板及脚本

导入模板rancher 容器管理平台[scripts] 模板及脚本联系技术中心获取 上传脚本rancher_get.sh至server/proxy服务器外部路径下,授予itops用户执行权限

5.2.模板迁移

enter image description here enter image description here

5.2. 添加监控对象

红框处务必填写正确 enter image description here IP填写rancher管理平台IP地址 端口号填写rancher管理平台端口号 用户名填写rancher管理平台账号 密码填写rancher管理平台密码 KUBE_URL及NODE_URL参考填写框及第4章节访问页面获取服务名及端口