Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nodeInfo missing on create service notif #37

Open
nlevee opened this issue Nov 15, 2018 · 9 comments
Open

nodeInfo missing on create service notif #37

nlevee opened this issue Nov 15, 2018 · 9 comments

Comments

@nlevee
Copy link

nlevee commented Nov 15, 2018

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"
@thomasjpfan
Copy link
Contributor

How is udm_webapp_webapp-admin-http defined?

@nlevee
Copy link
Author

nlevee commented Nov 19, 2018

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
Copy link
Contributor

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

@nlevee
Copy link
Author

nlevee commented Dec 22, 2018

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

docker stack deploy --prune ...

@nlevee
Copy link
Author

nlevee commented Jan 2, 2019

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
Copy link
Contributor

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

@nlevee
Copy link
Author

nlevee commented Jan 2, 2019

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
Copy link
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
Copy link
Author

nlevee commented Jan 3, 2019

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
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants