Melpa: docker swarm mode prevents client IP from showing up properly in MELPA logs

Created on 3 Jan 2019  路  6Comments  路  Source: melpa/melpa

FYI, I'm not 100% sure, but I think download counters have been stuck for several days.

website

Most helpful comment

I鈥檒l have to look. Thanks for reporting.

All 6 comments

I鈥檒l have to look. Thanks for reporting.

Current count is 79,580,093

Will check tomorrow morning and see what it says.

https://stackoverflow.com/questions/49415595/docker-swarm-get-real-ip-client-host-in-nginx?rq=1 has the best summary of what was actually wrong.

we recently move to docker with docker-compose and things were ok. but our host started to complain about cpu usage. the easiest way to restrict cpu that i saw was to use docker swarms. (cpu limits are not accessible from docker-compose). well, turns out when i switch to using swarms it broke the client IP in the logs because of the gateway network and so all the new downloads were being accounted to the same user.

things should be fixed now because we switched back to better hosting and don't need to use swarm, so i switched back to using docker-compose.

going to leave this open. moby/moby/issues/25526 is blocking this issue. when it's resolved we can maybe go back to using swarm mode.

Hello,

Given I'm the author of another issue (https://github.com/moby/moby/issues/15086) with the same problem and fiddled with this a bit, I can maybe give some tricks.

You can always switch back to docker-compose version 2.x (whatever x is the latest) and instead of using resources you use the one of the old cpus, cpu_shares, cpu_quota, cpuset.

This prevents you from using secrets, but you can always use volumes to get an equivalent, like I did here:

  worker-exports-normal:
    restart: on-failure
    image: arqivis/web
    command: ['worker', 'exports-normal', '2']
    volumes:
      - ./data/secrets/web/configuration.yml:/run/secrets/web-configuration
      - ./data/secrets/web/secret-key-base:/run/secrets/web-secret-key-base
      - ./data/secrets/database/hostname:/run/secrets/database-hostname
      - ./data/secrets/database/name:/run/secrets/database-name
      - ./data/secrets/database/password:/run/secrets/database-password
      - ./data/secrets/database/username:/run/secrets/database-username
    cpus: 16
    logging: *default-logging

That way you stop using swarm, but migrating to 3.x will be easy because you already are in "secrets" mode, just not using the key explicitely. I'm looking into learning kubernetes one of these days in order to compare.

Hey @Silex thanks for the advice. For now i think we're probably ok with plain docker-compose but it's good to know that there are problems that are not just in my brain! 馃槙

Can this be closed?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

conao3 picture conao3  路  6Comments

Miciah picture Miciah  路  3Comments

nnicandro picture nnicandro  路  3Comments

alphapapa picture alphapapa  路  4Comments

conao3 picture conao3  路  7Comments