Update configuration
This commit is contained in:
13
configurations/home-assistant/configuration-production.yaml
Normal file
13
configurations/home-assistant/configuration-production.yaml
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
# Loads default set of integrations. Do not remove
|
||||||
|
# This was added to the homeAutomation repo.
|
||||||
|
# This is a sample configuration. Please create a configuration.production.yml for production use.
|
||||||
|
default_config:
|
||||||
|
|
||||||
|
automation: !include automations.yaml
|
||||||
|
script: !include scripts.yaml
|
||||||
|
scene: !include scenes.yaml
|
||||||
|
|
||||||
|
http:
|
||||||
|
use_x_forwarded_for: true
|
||||||
|
trusted_proxies:
|
||||||
|
- 172.18.0.0/24
|
||||||
@@ -6,7 +6,12 @@ receivers:
|
|||||||
http:
|
http:
|
||||||
endpoint: 0.0.0.0:4318
|
endpoint: 0.0.0.0:4318
|
||||||
|
|
||||||
|
processors:
|
||||||
|
batch:
|
||||||
|
|
||||||
exporters:
|
exporters:
|
||||||
|
prometheus:
|
||||||
|
endpoint: 0.0.0.0:8889
|
||||||
debug:
|
debug:
|
||||||
verbosity: detailed
|
verbosity: detailed
|
||||||
|
|
||||||
@@ -15,5 +20,9 @@ service:
|
|||||||
pipelines:
|
pipelines:
|
||||||
traces:
|
traces:
|
||||||
receivers: [otlp]
|
receivers: [otlp]
|
||||||
processors: []
|
processors: [batch]
|
||||||
exporters: [debug]
|
exporters: [debug]
|
||||||
|
metrics:
|
||||||
|
receivers: [otlp]
|
||||||
|
processors: [batch]
|
||||||
|
exporters: [prometheus,debug]
|
||||||
|
|||||||
@@ -8,8 +8,11 @@ scrape_configs:
|
|||||||
- targets: ["prometheus:9090"]
|
- targets: ["prometheus:9090"]
|
||||||
|
|
||||||
- job_name: "node"
|
- job_name: "node"
|
||||||
|
scrape_interval: 1m
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ["node-exporter:9100"]
|
- targets: ["node-exporter:9100"]
|
||||||
- job_name: "pi_node"
|
|
||||||
|
- job_name: "otel"
|
||||||
|
scrape_interval: 5s
|
||||||
static_configs:
|
static_configs:
|
||||||
- targets: ["10.55.8.1:9100"]
|
- targets: ["otel-collector:8889"]
|
||||||
|
|||||||
@@ -1,74 +0,0 @@
|
|||||||
[entryPoints]
|
|
||||||
[entryPoints.http]
|
|
||||||
address = ":80"
|
|
||||||
|
|
||||||
[entryPoints.https]
|
|
||||||
address = ":443"
|
|
||||||
[entryPoints.https.tls]
|
|
||||||
[[entryPoints.https.tls.certificates]]
|
|
||||||
certFile = "/var/lib/certificates/cert.pem"
|
|
||||||
keyFile = "/var/lib/certificates/key.pem"
|
|
||||||
|
|
||||||
[file]
|
|
||||||
[backends]
|
|
||||||
[backends.whoami]
|
|
||||||
[backends.whoami.servers.server1]
|
|
||||||
url = "http://whoami:2001"
|
|
||||||
|
|
||||||
[backends.grafana]
|
|
||||||
[backends.grafana.servers.server1]
|
|
||||||
url = "http://grafana:3000"
|
|
||||||
|
|
||||||
[backends.syncthing]
|
|
||||||
[backends.syncthing.servers.server1]
|
|
||||||
url = "http://syncthing:8384"
|
|
||||||
|
|
||||||
[backends.homeassistant]
|
|
||||||
[backends.homeassistant.servers.server1]
|
|
||||||
url = "http://homeassistant:8123"
|
|
||||||
|
|
||||||
[backends.influxdb]
|
|
||||||
[backends.influxdb.servers.server1]
|
|
||||||
url = "http://influxdb:8086"
|
|
||||||
|
|
||||||
[frontends]
|
|
||||||
[frontends.whoami]
|
|
||||||
backend = "whoami"
|
|
||||||
[frontends.whoami.routes.path]
|
|
||||||
rule = "Path:/whoami;ReplacePathRegex: ^/whoami(.*) /$1"
|
|
||||||
|
|
||||||
[frontends.grafana]
|
|
||||||
backend = "grafana"
|
|
||||||
[frontends.grafana.routes.path]
|
|
||||||
rule = "Path:/grafana;ReplacePathRegex: ^/grafana(.*) /$1"
|
|
||||||
|
|
||||||
[frontends.syncthing]
|
|
||||||
backend = "syncthing"
|
|
||||||
[frontends.syncthing.routes.path]
|
|
||||||
rule = "Path:/syncthing;ReplacePathRegex: ^/syncthing(.*) /$1"
|
|
||||||
|
|
||||||
[frontends.syncthing-referrer]
|
|
||||||
backend = "syncthing"
|
|
||||||
[frontends.syncthing-referrer.routes.referrer]
|
|
||||||
rule = "HeadersRegexp: Referer, /*.syncthing"
|
|
||||||
|
|
||||||
[frontends.homeassistant]
|
|
||||||
backend = "homeassistant"
|
|
||||||
[frontends.homeassistant.routes.path]
|
|
||||||
rule = "Path:/homeassistant;ReplacePathRegex: ^/homeassistant(.*) /$1"
|
|
||||||
|
|
||||||
[frontends.influxdb]
|
|
||||||
backend = "influxdb"
|
|
||||||
[frontends.influxdb.routes.path]
|
|
||||||
rule = "Path:/influxdb;ReplacePathRegex: ^/influxdb(.*) /$1"
|
|
||||||
|
|
||||||
[frontends.influxdb-referrer]
|
|
||||||
backend = "influxdb"
|
|
||||||
[frontends.influxdb-referrer.routes.referrer]
|
|
||||||
rule = "HeadersRegexp: Referer, /*.influxdb"
|
|
||||||
|
|
||||||
|
|
||||||
[tracing]
|
|
||||||
[tracing.otlp.http]
|
|
||||||
endpoint = "http://otel-collector:4318"
|
|
||||||
insecure = true
|
|
||||||
25
configurations/traefik/traefik.yml
Normal file
25
configurations/traefik/traefik.yml
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
## traefik.yml
|
||||||
|
|
||||||
|
# Docker configuration backend
|
||||||
|
providers:
|
||||||
|
docker:
|
||||||
|
defaultRule: "Host(`{{ trimPrefix `/` .Name }}.docker.localhost`)"
|
||||||
|
|
||||||
|
# API and dashboard configuration
|
||||||
|
api:
|
||||||
|
insecure: true
|
||||||
|
|
||||||
|
tracing:
|
||||||
|
capturedRequestHeaders:
|
||||||
|
- X-Forwarded-Prefix
|
||||||
|
otlp:
|
||||||
|
grpc:
|
||||||
|
endpoint: otel-collector:4317
|
||||||
|
insecure: true
|
||||||
|
|
||||||
|
metrics:
|
||||||
|
otlp:
|
||||||
|
addEntryPointsLabels: true
|
||||||
|
grpc:
|
||||||
|
endpoint: otel-collector:4317
|
||||||
|
insecure: true
|
||||||
@@ -1,18 +1,25 @@
|
|||||||
services:
|
services:
|
||||||
whoami:
|
|
||||||
restart: unless-stopped
|
|
||||||
image: traefik/whoami
|
|
||||||
command:
|
|
||||||
- --port=2001
|
|
||||||
traefik:
|
traefik:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: "traefik:1.7.10"
|
image: traefik:v3.2
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.dashboard.rule=Host(`traefik.pladijs`)
|
||||||
|
- traefik.http.services.dashboard.loadbalancer.server.port=8080
|
||||||
volumes:
|
volumes:
|
||||||
- ${REPO_DIR}/configurations/traefik/traefik.1.7.10.toml:/etc/traefik/traefik.toml
|
- ${REPO_DIR}/configurations/traefik/traefik.yml:/etc/traefik/traefik.yml
|
||||||
- ${STORAGE_DIR}/certificates:/var/lib/certificates
|
- ${STORAGE_DIR}/certificates:/var/lib/certificates
|
||||||
|
- /var/run/docker.sock:/var/run/docker.sock
|
||||||
ports:
|
ports:
|
||||||
- 80:80
|
- 80:80
|
||||||
- 443:443
|
- 443:443
|
||||||
|
whoami:
|
||||||
|
restart: unless-stopped
|
||||||
|
image: traefik/whoami
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.whoami.rule=Host(`whoami.pladijs`)
|
||||||
|
- traefik.http.services.whoami.loadbalancer.server.port=2001
|
||||||
|
command:
|
||||||
|
- --port=2001
|
||||||
db:
|
db:
|
||||||
image: mariadb:latest
|
image: mariadb:latest
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
@@ -25,8 +32,13 @@ services:
|
|||||||
- ${STORAGE_DIR}/mariadb:/var/lib/mysql
|
- ${STORAGE_DIR}/mariadb:/var/lib/mysql
|
||||||
homeassistant:
|
homeassistant:
|
||||||
image: "ghcr.io/home-assistant/home-assistant:stable"
|
image: "ghcr.io/home-assistant/home-assistant:stable"
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.homeassistant.rule=Host(`homeassistant.pladijs`)
|
||||||
|
- traefik.http.services.homeassistant.loadbalancer.server.port=8123
|
||||||
volumes:
|
volumes:
|
||||||
- ${STORAGE_DIR}/homeassistant:/config
|
- ${STORAGE_DIR}/homeassistant:/config
|
||||||
|
- ${STORAGE_DIR}/homeassistant:/config
|
||||||
|
- ${REPO_DIR}/configurations/home-assistant/configuration-production.yaml:/config/configuration.yaml
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
env_file:
|
env_file:
|
||||||
- envs/local.env
|
- envs/local.env
|
||||||
@@ -34,6 +46,9 @@ services:
|
|||||||
syncthing:
|
syncthing:
|
||||||
image: lscr.io/linuxserver/syncthing:latest
|
image: lscr.io/linuxserver/syncthing:latest
|
||||||
container_name: syncthing
|
container_name: syncthing
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.syncthing.rule=Host(`syncthing.pladijs`)
|
||||||
|
- traefik.http.services.syncthing.loadbalancer.server.port=8384
|
||||||
environment:
|
environment:
|
||||||
- PUID=1000
|
- PUID=1000
|
||||||
- PGID=1000
|
- PGID=1000
|
||||||
@@ -58,12 +73,16 @@ services:
|
|||||||
- '--path.rootfs=/rootfs'
|
- '--path.rootfs=/rootfs'
|
||||||
- '--path.sysfs=/host/sys'
|
- '--path.sysfs=/host/sys'
|
||||||
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
- '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
|
||||||
ports:
|
labels:
|
||||||
- 9100:9100
|
- traefik.http.routers.node-exporter.rule=Host(`node-exporter.pladijs`)
|
||||||
|
- traefik.http.services.node-exporter.loadbalancer.server.port=9100
|
||||||
prometheus:
|
prometheus:
|
||||||
image: prom/prometheus:latest
|
image: prom/prometheus:latest
|
||||||
container_name: prometheus
|
container_name: prometheus
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.prometheus.rule=Host(`prometheus.pladijs`)
|
||||||
|
- traefik.http.services.prometheus.loadbalancer.server.port=9090
|
||||||
volumes:
|
volumes:
|
||||||
- ${REPO_DIR}/configurations/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
- ${REPO_DIR}/configurations/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
|
||||||
- ${STORAGE_DIR}/prometheus:/prometheus
|
- ${STORAGE_DIR}/prometheus:/prometheus
|
||||||
@@ -73,8 +92,6 @@ services:
|
|||||||
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
- '--web.console.libraries=/etc/prometheus/console_libraries'
|
||||||
- '--web.console.templates=/etc/prometheus/consoles'
|
- '--web.console.templates=/etc/prometheus/consoles'
|
||||||
- '--web.enable-lifecycle'
|
- '--web.enable-lifecycle'
|
||||||
ports:
|
|
||||||
- 9090:9090
|
|
||||||
grafana:
|
grafana:
|
||||||
image: grafana/grafana:latest
|
image: grafana/grafana:latest
|
||||||
volumes:
|
volumes:
|
||||||
@@ -82,8 +99,14 @@ services:
|
|||||||
env_file:
|
env_file:
|
||||||
- envs/local.env
|
- envs/local.env
|
||||||
- envs/production.env
|
- envs/production.env
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.grafana.rule=Host(`grafana.pladijs`)
|
||||||
|
- traefik.http.services.grafana.loadbalancer.server.port=3000
|
||||||
influxdb:
|
influxdb:
|
||||||
container_name: influxdb
|
container_name: influxdb
|
||||||
|
labels:
|
||||||
|
- traefik.http.routers.influxdb.rule=Host(`influxdb.pladijs`)
|
||||||
|
- traefik.http.services.influxdb.loadbalancer.server.port=3000
|
||||||
image: influxdb
|
image: influxdb
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
environment:
|
environment:
|
||||||
|
|||||||
@@ -14,5 +14,3 @@ DOCKER_INFLUXDB_INIT_USERNAME=homeassistant
|
|||||||
DOCKER_INFLUXDB_INIT_PASSWORD=IEOUjgdbI3XjJnmqQOPkHw==
|
DOCKER_INFLUXDB_INIT_PASSWORD=IEOUjgdbI3XjJnmqQOPkHw==
|
||||||
DOCKER_INFLUXDB_INIT_ORG=homeassistant
|
DOCKER_INFLUXDB_INIT_ORG=homeassistant
|
||||||
DOCKER_INFLUXDB_INIT_BUCKET=homeassistant
|
DOCKER_INFLUXDB_INIT_BUCKET=homeassistant
|
||||||
|
|
||||||
REPO_DIR=/home/pi/repos/homeAutomation
|
|
||||||
|
|||||||
Reference in New Issue
Block a user