You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

OpenShift 4.13中如何直接访问Prometheus UI?

在OpenShift 4.13中访问Prometheus UI的可行方法

方法1:直接端口转发到Prometheus Pod的9090端口

无需依赖socat,直接通过oc port-forward将本地端口映射到Prometheus Pod的9090端口:

oc port-forward -n openshift-monitoring pod/prometheus-k8s-0 9090:9090

执行成功后,在本地浏览器访问 http://localhost:9090 即可进入Prometheus UI。

如果不确定可用的Prometheus Pod名称,先执行以下命令查询:

oc get pods -n openshift-monitoring | grep prometheus-k8s

方法2:通过OpenShift控制台跳转

OpenShift 4.13内置控制台提供了直接入口:

  • 登录OpenShift Web Console,切换到Monitoring → Metrics页面
  • 点击页面右上角的Open Prometheus UI按钮,即可直接跳转至Prometheus界面

方法3:使用OpenShift Proxy访问

通过oc proxy建立本地与OpenShift API Server的代理连接,再通过API路径访问:

  1. 启动代理服务:
oc proxy --port=8080
  1. 在本地浏览器访问:
http://localhost:8080/api/v1/namespaces/openshift-monitoring/services/prometheus-k8s:web/proxy/

内容的提问来源于stack exchange,提问作者Ariaeimehr

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.15 01:03:22