简体   繁体   English

如何将 Docker 中的 Prometheus 连接到 Kubernetes 集群?

[英]How to connect Prometheus in Docker to a Kubernetes cluster?

I am referring to this link ( https://github.com/vegasbrianc/prometheus ) to install Prometheus in Docker version into a Ubuntu server (server-1)我指的是这个链接( https://github.com/vegasbrianc/prometheus )将 Docker 版本的 Prometheus 安装到 Ubuntu 服务器(server-1)中

I also have a Kubernetes cluster (bare-metal) running in another Ubuntu server (server-2).我还有一个 Kubernetes 集群(裸机)在另一个 Ubuntu 服务器(server-2)上运行。 In this Kubernetes cluster, I have some sample apps being deployed.在这个 Kubernetes 集群中,我部署了一些示例应用程序。

I know normally people will deploy Prometheus to the same Kubernetes cluster.我知道通常人们会将 Prometheus 部署到同一个 Kubernetes 集群。

But now, I want to use this Prometheus in server-1 to monitor the apps in Kubernetes cluster in server-2.但是现在,我想在 server-1 中使用这个 Prometheus 来监控 server-2 中 Kubernetes 集群中的应用程序。 How to achieve this?如何做到这一点? Is there any setting/ configuration I have to do to achieve the monitoring?我必须做任何设置/配置来实现监控吗?

假设两台服务器可以相互访问,您需要在 server-2 上配置 prometheus 以抓取在 server-1 上运行的目标,这反过来又必须以 server-2 可以访问的方式公开它们的/metrics路径( via ingress 是最受欢迎的选择)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将我的Docker映像连接到我的kubernetes集群? - How to connect my docker image to my kubernetes cluster? 如何从运行在同一 Kube.netes 集群中的容器连接到 Docker,它在 Kube.netes 集群中的主机虚拟机上运行? - How do I connect to Docker, running on host VMs in a Kubernetes cluster from a container running in the same Kubernetes cluster? 如何使用 docker 桌面将 kubernetes 集群连接到外部 SQL Server 数据库? - How do I connect a kubernetes cluster to an external SQL Server database using docker desktop? 如何在 Docker 桌面上创建一个新的 Kubernetes 集群? - How to create a new Kubernetes cluster on Docker Desktop? 如何在没有Kubernetes的情况下使用MQ创建Docker集群 - How to create a docker cluster with MQ without Kubernetes Docker 在 Kube.netes 集群中的 Docker 内 - Docker inside Docker in a Kubernetes Cluster 如何在 Docker 上部署 postgres_exporter 并连接到 prometheus - How to deploy postgres_exporter on the Docker and connect to prometheus 如何从 docker 容器连接到 minikube 集群? - How to connect to a minikube cluster from a docker container? 将Prometheus连接到Kubernetes时,“连接:连接被拒绝” - “Connect: Connection Refused” when Connecting Prometheus to Kubernetes 容器在 docker 中有效,但在 Kubernetes 集群中无效 - Container works in docker but not in Kubernetes cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM