Commit 37bba63e authored by Pedro Eduardo Trujillo's avatar Pedro Eduardo Trujillo
Browse files

Implementa primera versión de los servicios

parents
Loading
Loading
Loading
Loading

.gitlab-ci.yml

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

stages:
  - deploy

.deploy:
  variables:
    STACK: storage

README.md

0 → 100644
+3 −0
Original line number Diff line number Diff line
# SeaweedFS

Deployment of SeaweedFS, a distributed object store and file system

deploy/.env

0 → 100644
+5 −0
Original line number Diff line number Diff line
IMAGE_NAME=chrislusf/seaweedfs
IMAGE_TAG=latest
MASTER_HOST=swfs-master
MASTER_PORT=9333
FILER_PORT=8888
+1 −0
Original line number Diff line number Diff line
version: '3.8'
+114 −0
Original line number Diff line number Diff line
version: '3.8'

x-swfs-master:
  &swfs-master-common
  image: ${IMAGE_NAME}:${IMAGE_TAG}
  networks:
    seaweedfs-net:
  deploy:
    mode: replicated
    replicas: 1
    restart_policy:
      delay: ${MASTER_RESTART_DELAY:-1s}
    update_config:
      delay: ${MASTER_UPDATE_DELAY:-5m}
    resources:
      limits:
        cpus: '${MASTER_RESOURCES_LIMITS_CPUS:-0.1}'
        memory: ${MASTER_RESOURCES_LIMITS_MEMORY:-64M}
      reservations:
        cpus: '${MASTER_RESOURCES_RESERVATIONS_CPUS:-0.001}'
        memory: ${MASTER_RESOURCES_RESERVATIONS_MEMORY:-16M}

services:
  swfs-master-1:
    << : *swfs-master-common
    command: master -ip=${MASTER_HOST}-1 -port=${MASTER_PORT} -peers=${MASTER_HOST}-1:${MASTER_PORT},${MASTER_HOST}-2:${MASTER_PORT},${MASTER_HOST}-3:${MASTER_PORT}
    volumes:
      - master-1-vol:/data

  swfs-master-2:
    << : *swfs-master-common
    command: master -ip=${MASTER_HOST}-2 -port=${MASTER_PORT} -peers=${MASTER_HOST}-1:${MASTER_PORT},${MASTER_HOST}-2:${MASTER_PORT},${MASTER_HOST}-3:${MASTER_PORT}
    volumes:
      - master-2-vol:/data

  swfs-master-3:
    << : *swfs-master-common
    command: master -ip=${MASTER_HOST}-3 -port=${MASTER_PORT} -peers=${MASTER_HOST}-1:${MASTER_PORT},${MASTER_HOST}-2:${MASTER_PORT},${MASTER_HOST}-3:${MASTER_PORT}
    volumes:
      - master-3-vol:/data

  swfs-volume:
    image: ${IMAGE_NAME}:${IMAGE_TAG}
    command: volume -port=${VOLUME_PORT:-8080} -dir=/obj -mserver=${MASTER_HOST}-1:${MASTER_PORT},${MASTER_HOST}-2:${MASTER_PORT},${MASTER_HOST}-3:${MASTER_PORT}
    networks:
      seaweedfs-net:
    volumes:
      - volume-data-vol:/data
      - volume-object-vol:/obj
    deploy:
      mode: replicated
      replicas: ${VOLUME_REPLICAS:-3}
      restart_policy:
        delay: ${VOLUME_RESTART_DELAY:-5s}
      update_config:
        delay: ${VOLUME_UPDATE_DELAY:-1m}
      placement:
        max_replicas_per_node: 1
      resources:
        limits:
          cpus: '${VOLUME_RESOURCES_LIMITS_CPUS:-1}'
          memory: ${VOLUME_RESOURCES_LIMITS_MEMORY:-64M}
        reservations:
          cpus: '${VOLUME_RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${VOLUME_RESOURCES_RESERVATIONS_MEMORY:-16M}

  swfs-filer:
    image: ${IMAGE_NAME}:${IMAGE_TAG}
    command: filer -port=${FILER_PORT} -master=${MASTER_HOST}-1:${MASTER_PORT},${MASTER_HOST}-2:${MASTER_PORT},${MASTER_HOST}-3:${MASTER_PORT}
    ports:
      - ${PUBLISHED_FILER_PORT:-8888}:${FILER_PORT}
    networks:
      seaweedfs-net:
    volumes:
      - filer-vol:/data
    deploy:
      mode: replicated
      replicas: ${FILER_REPLICAS:-1}
      restart_policy:
        delay: ${FILER_RESTART_DELAY:-5s}
      update_config:
        delay: ${FILER_UPDATE_DELAY:-1m}
      resources:
        limits:
          cpus: '${FILER_RESOURCES_LIMITS_CPUS:-1}'
          memory: ${FILER_RESOURCES_LIMITS_MEMORY:-32M}
        reservations:
          cpus: '${FILER_RESOURCES_RESERVATIONS_CPUS:-0.001}'
          memory: ${FILER_RESOURCES_RESERVATIONS_MEMORY:-16M}

networks:
  seaweedfs-net:
    name: ${SEAWEEDFS_NET_NAME:-seaweedfs-net}
    driver: ${SEAWEEDFS_NET_DRIVER:-overlay}
    attachable: ${SEAWEEDFS_NET_ATTACHABLE:-true}

volumes:
  master-1-vol:
    name: ${MASTER_1_VOL_NAME:-seaweedfs-master-1}

  master-2-vol:
    name: ${MASTER_2_VOL_NAME:-seaweedfs-master-2}

  master-3-vol:
    name: ${MASTER_3_VOL_NAME:-seaweedfs-master-3}

  volume-data-vol:
    name: ${VOLUME_DATA_VOL_NAME:-seaweedfs-volume-data}

  volume-object-vol:
    name: ${VOLUME_OBJECT_VOL_NAME:-seaweedfs-volume-object}

  filer-vol:
    name: ${FILER_VOL_NAME:-seaweedfs-filer}