add file structure for server configuration

This commit is contained in:
Martin Ptáček
2023-04-18 16:41:59 +02:00
parent 8c372e9f2a
commit 3f7b474a63
8 changed files with 136 additions and 0 deletions

2
server/README.md Normal file
View File

@ -0,0 +1,2 @@
# Server configuration, intended use of this demo
#TODO demo , describe all files

4
server/ansible.cfg Normal file
View File

@ -0,0 +1,4 @@
# ansible configuration file
[defaults]
inventory = ./ansible_inventory

2
server/ansible_inventory Normal file
View File

@ -0,0 +1,2 @@
[android-prometheus-exporter-target-server]
139.144.68.186

View File

@ -0,0 +1,23 @@
# run this playbook against new linux server
- name: Install example server stack for prometheus-exporter-android
hosts: android-prometheus-exporter-target-server
remote_user: root
tasks:
- name: Assert linux distribution is Rocky Linux
- name: Install docker
- name: Install docker compose
- name: Create user androidexporter
- name:
#TODO create user androidexporter
#TODO install docker
#TODO install docker compose
#TODO copy files over
#TODO create folder structure

View File

@ -0,0 +1,66 @@
# nginx configuration for pushprox, grafana and prometheus
http{
# Needed for grafana websockets
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
# Upstream server definitions
upstream prometheus{
server http://prometheus:9090;
}
upstream pushprox{
server http://pushprox:8080;
}
upstream grafana{
server http://grafana:3000;
}
# Grafana server configuration
server {
listen 3000;
root /usr/share/nginx/html;
index index.html index.htm;
location / {
proxy_set_header Host $http_host;
proxy_pass http://grafana;
}
# Proxy Grafana Live WebSocket connections
location /api/live/ {
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_set_header Host $http_host;
proxy_pass http://grafana;
}
}
# PushProx server configuration
server {
listen 8080;
location / {
proxy_pass http://pushprox;
}
}
# Prometheus UI server configuration
server {
listen 9090;
location / {
proxy_pass http://prometheus;
}
}
}
events {
worker_connections 1024;
}

View File

View File

@ -0,0 +1,38 @@
# nginx, pushprox, prometheus, grafana stack
version: '3.9'
services:
# monitoring dashboard for prometheus
grafana:
container_name: grafana
image: grafana/grafana:8.5.22
restart: on-failure
networks:
- common-network
# reverse proxy
nginx:
container_name: nginx
image: nginx:1.23.4
networks:
- common-network
# proxy for prometheus to traverse NAT
pushprox:
image: prometheuscommunity/pushprox:master
# prometheus time-series database
prometheus:
container_name: prometheus
image: bitnami/prometheus:2.43.0
volumes:
- ./
restart: on-failure
networks:
- common-network
networks:
common-network:
driver: bridge