Commit 340360ca authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Actualiza configuración de despliegue

Reduce recursos y corrige sintaxis.
parent 954a3975
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2,3 +2,7 @@ ROLE=master
PGDATA=/var/lib/postgresql/data/db-files
POSTGRES_INITDB_WALDIR=/postgresql/wal/wal-files
DESIRED_WORKER_ID=a
PORT=5432
POSTGRES_DATA_VOLUME_NAME=postgres-data-vol
POSTGRES_WAL_VOLUME_NAME=postgres-wal-vol
POSTGRES_NET_NAME=postgres-net
+16 −15
Original line number Diff line number Diff line
@@ -4,34 +4,35 @@ services:
  backup-db:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    environment:
      - POSTGRES_USER
      - POSTGRES_PASSWORD
      - POSTGRES_HOSTNAME
      - BUCKET_BACKUP_DB
      - AWS_ACCESS_KEY_ID
      - AWS_SECRET_ACCESS_KEY
      - PUSHGATEWAY_HOST
      - PUSHGATEWAY_JOB
      POSTGRES_USER:
      POSTGRES_PASSWORD:
      POSTGRES_HOSTNAME:
      BUCKET_BACKUP_DB:
      AWS_ACCESS_KEY_ID:
      AWS_SECRET_ACCESS_KEY:
      PUSHGATEWAY_HOST:
      PUSHGATEWAY_JOB:
    networks:
      - postgres-net
      - metric-net
      postgres-net:
      metric-net:
    deploy:
      mode: replicated
      replicas: 1
      restart_policy:
        condition: on-failure
        delay: 1m
        window: 3m
        delay: 30s
        window: 1m
      resources:
        limits:
          cpus: '0.5'
          memory: 512M
          memory: 256M
        reservations:
          memory: 410M
          cpus: '0.001'
          memory: 64M

networks:
  postgres-net:
    name: ${POSTGRES_NET_NAME:-postgres-net}
    name: ${POSTGRES_NET_NAME}
    external: true

  metric-net:
+7 −6
Original line number Diff line number Diff line
@@ -3,20 +3,21 @@ version: '3.5'
services:
  postgresql:
    ports:
      - target: 5432
        published: 5432
      - target: ${PORT}
        published: ${PORT}
        mode: host
    deploy:
      resources:
        limits:
          cpus: '1'
          memory: 1G
          memory: 512M
        reservations:
          memory: 820M
          cpus: '0.001'
          memory: 128M

volumes:
  postgres-data-vol:
    name: ${POSTGRES_DATA_VOLUME_NAME:-postgres-data-vol}
    name: ${POSTGRES_DATA_VOLUME_NAME}

  postgres-wal-vol:
    name: ${POSTGRES_WAL_VOLUME_NAME:-postgres-wal-vol}
    name: ${POSTGRES_WAL_VOLUME_NAME}
+7 −6
Original line number Diff line number Diff line
@@ -10,23 +10,24 @@ services:
      resources:
        limits:
          cpus: '2'
          memory: 2G
          memory: 1G
        reservations:
          memory: 1639M
          cpus: '0.001'
          memory: 512M

volumes:
  postgres-data-vol:
    name: ${POSTGRES_DATA_VOLUME_NAME:-postgres-data-vol}
    name: ${POSTGRES_DATA_VOLUME_NAME}
    driver: 'cloudstor:aws'
    driver_opts:
      backing: relocatable
      size: 20
      size: ${POSTGRES_DATA_VOLUME_SIZE:-20}
      ebstype: gp2

  postgres-wal-vol:
    name: ${POSTGRES_WAL_VOLUME_NAME:-postgres-wal-vol}
    name: ${POSTGRES_WAL_VOLUME_NAME}
    driver: 'cloudstor:aws'
    driver_opts:
      backing: relocatable
      size: 10
      size: ${POSTGRES_WAL_VOLUME_SIZE:-10}
      ebstype: gp2
+7 −7
Original line number Diff line number Diff line
@@ -4,10 +4,10 @@ services:
  postgresql:
    image: ${IMAGE_NAME}:${IMAGE_TAG:-latest}
    environment:
      - ROLE
      - POSTGRES_PASSWORD
      - PGDATA
      - POSTGRES_INITDB_WALDIR
      ROLE:
      POSTGRES_PASSWORD:
      PGDATA:
      POSTGRES_INITDB_WALDIR:
    networks:
      postgres-net:
        aliases:
@@ -22,12 +22,12 @@ services:
      mode: replicated
      replicas: 1
      restart_policy:
        delay: 1m
        window: 3m
        delay: 10s
        window: 1m

networks:
  postgres-net:
    name: ${POSTGRES_NET_NAME:-postgres-net}
    name: ${POSTGRES_NET_NAME}
    external: true

configs: