Answers: <p>I've found out that it is a possible and fine approach. Prometheus support different methods of service discovery, this is explained in <a href="https://prometheus.io/docs/prometheus/latest/configuration/configuration/" rel="nofollow noreferrer">the docs: Configuration</a>. As I understood the Loki way of work, it just uses Promtail which sends logs from services, so there is no need of service discovery. An example of Promtail installation <a href="https://grafana.com/blog/2020/07/13/loki-tutorial-how-to-set-up-promtail-on-aws-ec2-to-find-and-analyze-your-logs/" rel="nofollow noreferrer">is here</a>. Also, more details can be found in the <a href="https://grafana.com/docs/loki/latest/clients/promtail/installation/" rel="nofollow noreferrer">doc: Promtail install</a>.</p>
  
Answers: CC BY-SA 4.0
Answers: 2020-09-26T13:13:52.797Z
Answers: 2020-09-26T13:13:52.797Z
Answers: AivanF.
Answers: <p>Yes--absolutely you can skip Kubernetes. Suggest that you still use Docker, but you could even just install the components separately.</p>
  <p>I think it's easiest using Docker Compose (need to have package <code>docker-compose</code> installed on your host) to manage the containers.</p>
  <p>Here is a <code>docker-compose.yml</code> that might be helpful:</p>
  <pre><code>version: '3'
  
  services:
      prometheus:
          image: prom/prometheus:latest
          restart: unless-stopped
          ports:
              - &quot;9090:9090&quot;
          volumes:
              - /home/${USER}/opt/prometheus/data:/opt/prometheus/data:rw
              - /home/${USER}/opt/prometheus/config:/opt/prometheus/config:rw
          environment:
              SERVER_KEY: ${SERVER_KEY}
              SERVER_CERT: ${SERVER_CERT}
  
      grafana:
          image: grafana/grafana:latest
          restart: unless-stopped
          ports:
              - &quot;3000:3000&quot;
          volumes:
              - /home/${USER}/var/lib/grafana:/var/lib/grafana:rw
              - /home/${USER}/var/log/grafana:/var/log/grafana:rw
              - /home/${USER}/etc/grafana/grafana.ini:/etc/grafana/grafana.ini:rw
              - /home/${USER}/etc/grafana/ldap.toml:/etc/grafana/ldap.toml:rw
          environment:
              SERVER_KEY: ${SERVER_KEY}
              SERVER_CERT: ${SERVER_CERT}
              GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER}
              GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
          depends_on:
              - &quot;prometheus&quot;
  </code></pre>
  <p>Can also use Docker Compose for Loki and Promtail.</p>
  <p>Docker Compose reference: <a href="https://docs.docker.com/compose/compose-file" rel="nofollow noreferrer">https://docs.docker.com/compose/compose-file</a></p>
  
Answers: CC BY-SA 4.0
Answers: 2020-09-25T21:41:11.167Z
Answers: Yeah, it's obvious that it's possible to install the apps, cuz they are installed in K8s in some way... But the question was about service discovery outside of Kubernetes – will this work correctly, in the right way?
Answers: AivanF.
Answers: CC BY-SA 4.0
Answers: 2020-09-25T20:17:49.113Z
Answers: 2020-09-25T20:17:49.113Z
Answers: mikequentel
Body: <p>In some project there are scaling and orchestration implemented using technologies of a local cloud provider, with no Docker &amp; Kubernetes. But the project has poor logging and monitoring, I'd like to instal Prometheus, Loki, and Grafana for metrics, logs, and visualisation respectively. Unfortunately, I've found no articles with instructions about using Prometheus without K8s.</p>
  <p>But is it possible? If so, is it a good was? I know that Prometheus &amp; Loki can automatically detect services in the K8s to extract metrics and logs, but will the same work for a custom orchestration system?</p>
  
Tags: <kubernetes><prometheus><orchestration><grafana>
Title: Is it possible/fine to run Prometheus, Loki, Grafana outside of Kubernetes?
UserDisplayName: AivanF.
ThreadText: # Is it possible/fine to run Prometheus, Loki, Grafana outside of Kubernetes?
  
  (Asked by: username_0 on 2020-09-24)
  
  In some project there are scaling and orchestration implemented using technologies of a local cloud provider, with no Docker & Kubernetes. But the project has poor logging and monitoring, I'd like to instal Prometheus, Loki, and Grafana for metrics, logs, and visualisation respectively. Unfortunately, I've found no articles with instructions about using Prometheus without K8s.
  
  But is it possible? If so, is it a good was? I know that Prometheus & Loki can automatically detect services in the K8s to extract metrics and logs, but will the same work for a custom orchestration system?
  
  **Tags:** kubernetes, prometheus, orchestration, grafana
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2020-09-26. Score: 1 | Accepted answer
  
  I've found out that it is a possible and fine approach. Prometheus support different methods of service discovery, this is explained in [the docs: Configuration](https://prometheus.io/docs/prometheus/latest/configuration/configuration/). As I understood the Loki way of work, it just uses Promtail which sends logs from services, so there is no need of service discovery. An example of Promtail installation [is here](https://grafana.com/blog/2020/07/13/loki-tutorial-how-to-set-up-promtail-on-aws-ec2-to-find-and-analyze-your-logs/). Also, more details can be found in the [doc: Promtail install](https://grafana.com/docs/loki/latest/clients/promtail/installation/).
  
  
  ---
  
  ### Answer by username_1 on 2020-09-25. Score: 0
  
  Yes--absolutely you can skip Kubernetes. Suggest that you still use Docker, but you could even just install the components separately.
  
  I think it's easiest using Docker Compose (need to have package `docker-compose` installed on your host) to manage the containers.
  
  Here is a `docker-compose.yml` that might be helpful:
  
  ```
  version: '3'
  
  services:
      prometheus:
          image: prom/prometheus:latest
          restart: unless-stopped
          ports:
              - "9090:9090"
          volumes:
              - /home/${USER}/opt/prometheus/data:/opt/prometheus/data:rw
              - /home/${USER}/opt/prometheus/config:/opt/prometheus/config:rw
          environment:
              SERVER_KEY: ${SERVER_KEY}
              SERVER_CERT: ${SERVER_CERT}
  
      grafana:
          image: grafana/grafana:latest
          restart: unless-stopped
          ports:
              - "3000:3000"
          volumes:
              - /home/${USER}/var/lib/grafana:/var/lib/grafana:rw
              - /home/${USER}/var/log/grafana:/var/log/grafana:rw
              - /home/${USER}/etc/grafana/grafana.ini:/etc/grafana/grafana.ini:rw
              - /home/${USER}/etc/grafana/ldap.toml:/etc/grafana/ldap.toml:rw
          environment:
              SERVER_KEY: ${SERVER_KEY}
              SERVER_CERT: ${SERVER_CERT}
              GF_SECURITY_ADMIN_USER: ${GF_SECURITY_ADMIN_USER}
              GF_SECURITY_ADMIN_PASSWORD: ${GF_SECURITY_ADMIN_PASSWORD}
          depends_on:
              - "prometheus"
  
  ```
  
  Can also use Docker Compose for Loki and Promtail.
  
  Docker Compose reference: <https://docs.docker.com/compose/compose-file>
  
  > **Comments:**
  > **username_0**: Yeah, it's obvious that it's possible to install the apps, cuz they are installed in K8s in some way... But the question was about service discovery outside of Kubernetes – will this work correctly, in the right way?  
  
  ---
  
  