Skip to content

nodeInfo missing on create service notif #37

Open
@nlevee

Description

@nlevee

Description

The nodeInfo parameter is not present in the service notification some times...

My docker-compose

version: '3.4'

services:
  flow-gateway:
    image: ***
    deploy:
      placement:
        constraints:
          - node.role == worker
      update_config:
        order: start-first
    ports:
      - '80'

  swarm-listener:
    image: dockerflow/docker-flow-swarm-listener:18.11.07-18
    deploy:
      placement:
        constraints:
          - node.role == manager
      update_config:
        order: start-first
    volumes:
        - /var/run/docker.sock:/var/run/docker.sock
    environment:
      - 'DF_INCLUDE_NODE_IP_INFO=true'
      - 'DF_NOTIFY_CREATE_SERVICE_URL=http://flow-gateway/create-service.php'

Steps to reproduce the issue:

  1. Restart docker (dockerflow/docker-flow-swarm-listener:18.11.07-18)

Results received:

10.0.14.4 - - [15/Nov/2018:14:06:55 +0000] "GET /create-service.php?consulName=admin-http&distribute=true&port=80&replicas=2&scrapeNetwork=udm_webapp_default&serviceName=udm_webapp_webapp-admin-http&stackName=udm_webapp HTTP/1.1" 200 350 "-" "Go-http-client/1.1"

Results expected:

10.0.14.4 - - [15/Nov/2018:14:09:26 +0000] "GET /create-service.php?consulName=admin-http&distribute=true&nodeInfo=%5B%5B%22webapp-cluster-dn62%22%2C%2210.0.0.82%22%2C%22zouf5zgoxao4af8w7yo4wzskp%22%5D%2C%5B%22webapp-cluster-cgp5%22%2C%2210.0.0.78%22%2C%22pxmvw8hkpkcrxqs118gr0hkuu%22%5D%5D&port=80&replicas=2&scrapeNetwork=udm_webapp_default&serviceName=udm_webapp_webapp-admin-http&stackName=udm_webapp HTTP/1.1" 200 173 "-" "Go-http-client/1.1"

Activity

thomasjpfan

thomasjpfan commented on Nov 16, 2018

@thomasjpfan
Contributor

How is udm_webapp_webapp-admin-http defined?

nlevee

nlevee commented on Nov 19, 2018

@nlevee
Author

I use the label definition :

labels:
        com.df.consulName: 'admin-http'
        com.df.stackName: 'udm_webapp'
        com.df.scrapeNetwork: 'udm_webapp_default'
        com.df.notify: 'true'
        com.df.port: '80'

in my docker-compose.yml file

thomasjpfan

thomasjpfan commented on Nov 22, 2018

@thomasjpfan
Contributor

In your original post, you state that does sometimes happens. Are you able to pinpoint when exactly it happens?

nlevee

nlevee commented on Dec 22, 2018

@nlevee
Author

it's happen i think when a service is updated with

docker stack deploy --prune ...

nlevee

nlevee commented on Jan 2, 2019

@nlevee
Author

When I restart the listener every notification are send like this :

http://IP_GATEWAY/reconfigure.php?consulName=front-http&distribute=true&port=80&replicas=3&scrapeNetwork=_webapp_default&serviceName=_webapp_webapp-front-http&stackName=***_webapp

The nodeInfo is empty but the number of replicas is ok.

thomasjpfan

thomasjpfan commented on Jan 2, 2019

@thomasjpfan
Contributor

Is DFSL able to access the overlay network that the service is connected to?

nlevee

nlevee commented on Jan 2, 2019

@nlevee
Author

My swarm listener is in a stack separate from the others, exemple of my web stack :

version: '3.4'

services:
  front-gateway:
    image: varnish-consul-template:latest
    ports:
      - "80"
    logging:
      driver: "json-file"
      options:
        max-size: "100m"
        max-file: "1"
    deploy:
      placement: *placement_worker_webapp
      mode: replicated
      replicas: 2
      labels:
        com.df.consulName: 'front-gateway'
        com.df.stackName: 'xxxxxx_webapp'
        com.df.scrapeNetwork: 'xxxxxx_webapp_default'
        com.df.notify: 'true'
        com.df.port: '80'
      restart_policy:
        condition: on-failure
      update_config:
        order: start-first
        delay: 10s
        parallelism: 1
      resources:
        reservations:
          memory: 1G

Is that a problem ?

thomasjpfan

thomasjpfan commented on Jan 3, 2019

@thomasjpfan
Contributor

Check that the front-gateway service is connected to the xxxxxx_webapp_default overlay network. (Also xxxxxx_webapp_default needs to be an overlay network).

nlevee

nlevee commented on Jan 3, 2019

@nlevee
Author

ok I try and give you feedback. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @nlevee@thomasjpfan

        Issue actions

          nodeInfo missing on create service notif · Issue #37 · docker-flow/docker-flow-swarm-listener