<p>I am referring to this link (<a href="https://github.com/vegasbrianc/prometheus" rel="nofollow noreferrer">https://github.com/vegasbrianc/prometheus</a>) to install Prometheus in Docker version into a Ubuntu server (server-1)</p>
<p>I also have a Kubernetes cluster (bare-metal) running in another Ubuntu server (server-2). In this Kubernetes cluster, I have some sample apps being deployed.</p>
<p>I know normally people will deploy Prometheus to the same Kubernetes cluster.</p>
<p>But now, I want to use this Prometheus in server-1 to monitor the apps in Kubernetes cluster in server-2. How to achieve this? Is there any setting/ configuration I have to do to achieve the monitoring?</p>

<p>Assuming both servers can access each other, you will need to configure the prometheus on server-2 to <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/#scrape_config" rel="nofollow noreferrer">scrape the targets</a> running on server-1, which in turn will have to expose their <code>/metrics</code> path in a way that server-2 can access (via ingress is the most popular choice).</p>
