Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gsanchietti committed Feb 27, 2024
1 parent b615ec4 commit 337a76f
Show file tree
Hide file tree
Showing 4 changed files with 93 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build-images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ buildah add "${container}" ui/dist /ui
# Setup the entrypoint, ask to reserve one TCP port with the label and set a rootless container
buildah config --entrypoint=/ \
--label="org.nethserver.authorizations=traefik@any:routeadm node:tunadm" \
--label="org.nethserver.tcp-ports-demand=5" \
--label="org.nethserver.tcp-ports-demand=8" \
--label="org.nethserver.images=ghcr.io/nethserver/nethsecurity-vpn:$tag ghcr.io/nethserver/nethsecurity-api:$tag ghcr.io/nethserver/nethsecurity-ui:$tag ghcr.io/nethserver/nethsecurity-proxy:$tag docker.io/grafana/promtail:$promtail_version docker.io/grafana/loki:v$loki_version docker.io/prom/prometheus:v$prometheus_version docker.io/grafana/grafana:$grafana_version" \
"${container}"
# Commit the image
Expand Down
30 changes: 30 additions & 0 deletions imageroot/systemd/user/grafana.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
[Unit]
Description=Podman grafana.service
BindsTo=controller.service
After=promethus.service
After=loki.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=%S/state/environment
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/grafana.pid %t/grafana.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/grafana.pid \
--cidfile %t/grafana.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/controller.pod-id \
--replace -d --name grafana \
--volume grafana-storage:/var/lib/grafana \
--network=host \
--env-file=%S/state/grafana.env \
--env-file=%S/state/config.env \
${GRAFANA_IMAGE}
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/grafana.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/grafana.ctr-id
PIDFile=%t/grafana.pid
Type=forking

[Install]
WantedBy=default.target
31 changes: 31 additions & 0 deletions imageroot/systemd/user/loki.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Unit]
Description=Podman loki.service
BindsTo=controller.service
ABefore=promtail.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=%S/state/environment
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/loki.pid %t/loki.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/loki.pid \
--cidfile %t/loki.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/controller.pod-id \
--replace -d --name loki \
--volume=loki-data:/loki \
--network=host \
--env-file=%S/state/loki.env \
--env-file=%S/state/config.env \
${LOKI_IMAGE} \
-config.file=/etc/loki/local-config.yaml \
-log.level warn
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/loki.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/loki.ctr-id
PIDFile=%t/loki.pid
Type=forking

[Install]
WantedBy=default.target
31 changes: 31 additions & 0 deletions imageroot/systemd/user/prometheus.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[Unit]
Description=Podman prometheus.service
BindsTo=controller.service
After=vpn.service

[Service]
Environment=PODMAN_SYSTEMD_UNIT=%n
EnvironmentFile=%S/state/environment
Restart=always
TimeoutStopSec=70
ExecStartPre=/bin/rm -f %t/prometheus.pid %t/prometheus.ctr-id
ExecStart=/usr/bin/podman run \
--conmon-pidfile %t/prometheus.pid \
--cidfile %t/prometheus.ctr-id \
--cgroups=no-conmon \
--pod-id-file %t/controller.pod-id \
--replace -d --name prometheus \
--volume %S/etc/prometheus-config.yml:/etc/prometheus/prometheus.yml:z \
-v prometheus-data:/prometheus \
--network=host \
--env-file=%S/state/prometheus.env \
--env-file=%S/state/config.env \
${prometheus_IMAGE} \
-config.expand-env=true -config.file=/etc/prometheus/config.yml
ExecStop=/usr/bin/podman stop --ignore --cidfile %t/prometheus.ctr-id -t 10
ExecStopPost=/usr/bin/podman rm --ignore -f --cidfile %t/prometheus.ctr-id
PIDFile=%t/prometheus.pid
Type=forking

[Install]
WantedBy=default.target

0 comments on commit 337a76f

Please sign in to comment.