Commit b6705465 authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Añade configuración de servicio y despliegue

parent 6ed09f52
Loading
Loading
Loading
Loading

.gitlab-ci.yml

0 → 100644
+17 −0
Original line number Diff line number Diff line
include:
  - project: 'redmic-project/gitlab-ci-templates'
    ref: master
    file: '/deployment.yml'

stages:
  - deploy

variables:
  PROJECT_PARENT_NAME: metric

.deploy:
  variables:
    STACK: ${PROJECT_PARENT_NAME}
    SERVICES_TO_CHECK: ${PROJECT_PARENT_NAME}_${CI_PROJECT_NAME}
  environment:
    url: https://${CI_PROJECT_NAME}.${PUBLIC_HOSTNAME}

deploy/.env

0 → 100644
+5 −0
Original line number Diff line number Diff line
PORT=9091
METRICS_PATH=/metrics
DATA_PATH=/db
PERSISTENCE_INTERVAL=5m
LOG_LEVEL=info
+1 −0
Original line number Diff line number Diff line
version: '3.5'
+1 −0
Original line number Diff line number Diff line
version: '3.5'
+50 −0
Original line number Diff line number Diff line
version: '3.5'

services:
  pushgateway:
    image: ${IMAGE_NAME:-prom/pushgateway}:${IMAGE_TAG:-latest}
    command:
      - --web.listen-address=:${PORT}
      - --web.telemetry-path=${METRICS_PATH}
      - --persistence.file=${DATA_PATH}/metrics
      - --persistence.interval=${PERSISTENCE_INTERVAL}
      - --log.level=${LOG_LEVEL}
    networks:
      metric-net:
      traefik-net:
    volumes:
      - data-vol:${DATA_PATH}
    deploy:
      mode: replicated
      replicas: ${REPLICAS:-1}
      restart_policy:
        delay: ${RESTART_DELAY:-10s}
      update_config:
        delay: ${UPDATE_DELAY:-1m}
      labels:
        traefik.frontend.auth.basic.users: ${UI_AUTH}
        traefik.frontend.rule: Host:${TRAEFIK_SUBDOMAIN:-pushgateway}.${PUBLIC_HOSTNAME}
        traefik.backend: pushgateway
        traefik.port: '${PORT}'
      resources:
        limits:
          cpus: '${RESOURCES_LIMITS_CPUS:-0.1}'
          memory: ${RESOURCES_LIMITS_MEMORY:-64M}
        reservations:
          cpus: '${RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${RESOURCES_RESERVATIONS_MEMORY:-16M}

networks:
  metric-net:
    name: ${METRIC_NET_NAME:-metric-net}
    driver: ${METRIC_NET_DRIVER:-overlay}
    external: true

  traefik-net:
    name: ${TRAEFIK_NET_NAME:-traefik-net}
    driver: ${TRAEFIK_NET_DRIVER:-overlay}
    external: true

volumes:
  data-vol:
    name: ${DATA_VOL_NAME:-pushgateway-vol}
+1 −1

File changed.

Contains only whitespace changes.

Loading