version: '2.4'
services:
  node-init:
    image: "nexus.gz1.opensdn.io:5102/opensdn-node-init:nightly"
    env_file: /etc/contrail/common_analytics.env
    environment:
      - CONTRAIL_STATUS_IMAGE="nexus.gz1.opensdn.io:5102/opensdn-status:nightly"
    privileged: true
    pid: host
    network_mode: "host"
    volumes:
      - /usr/bin:/host/usr/bin
      - /etc/contrail/ssl/analytics:/etc/contrail/ssl
      - /etc/sysctl.d:/etc/sysctl.d
      - /etc/hosts:/etc/hosts
      - /var/log/contrail:/var/log/contrail
      - /etc/timezone:/etc/timezone
      - /etc/localtime:/etc/localtime
      - /var/crashes:/var/crashes
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  nodemgr:
    image: "nexus.gz1.opensdn.io:5102/opensdn-nodemgr:nightly"
    env_file: /etc/contrail/common_analytics.env
    environment:
      - NODE_TYPE=analytics-alarm
    network_mode: "host"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"


  provisioner:
    image: "nexus.gz1.opensdn.io:5102/opensdn-provisioner:nightly"
    env_file:
      - /etc/contrail/common_analytics.env
    environment:
      - NODE_TYPE=analytics-alarm
    network_mode: "host"
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: on-failure
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"


  kafka:
    image: "nexus.gz1.opensdn.io:5102/opensdn-external-kafka:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_analytics.env

    environment:
      - KAFKA_NODES=10.0.0.41
      - ZOOKEEPER_NODES=10.0.0.41
      - ZOOKEEPER_PORT=2181
      - NODE_TYPE=analytics-alarm
    
    volumes:
      - /var/log/contrail/kafka:/var/log/kafka
    
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"

  alarm-gen:
    image: "nexus.gz1.opensdn.io:5102/opensdn-analytics-alarm-gen:nightly"
    network_mode: "host"
    env_file: /etc/contrail/common_analytics.env
    volumes_from:
      - node-init
    depends_on:
      - node-init
    restart: always
    logging:
      driver: json-file
      options:
        max-file: "5"
        max-size: "20m"
