Code Monkey home page Code Monkey logo

Comments (4)

lucaslorentz avatar lucaslorentz commented on August 24, 2024

If you use labels at container level, it will use container ip address.
If you use labels at service level, it will use the service dns name and service VIP load balancer.

It is a very subtle difference on docker-compose file:
https://docs.docker.com/compose/compose-file/#labels-1

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on August 24, 2024

@lucaslorentz
At the moment I have some problems with docker swarm dns resolution.

I don't know why, but after some time the swarm service container ip changes (restart, redeploy or what ever) and my service isn't reachable by swarm dns name anymore... I have to redeploy the service to get a new dns name and working container / service name resolution.
It looks like a bug for me...

So maybe it would be safer to use ip address(es) to proxy backends instead of swarm service / container dns names?

Did You noticed some swarm dns issues / bugs with caddy docker proxy?

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on August 24, 2024

@pwFoo
I had the same issue.
It seems to be a swarm issue with VIP load balancing.

We can workaround it by using tasks.service dns, instead of using service VIP.

I added some time ago this CLI option: proxy-service-tasks (Proxy to service tasks instead of VIP)

I've been using it for some time and it is much more stable.

Usage example:

command: -email [email protected] -agree=true -log stdout -proxy-service-tasks

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on August 24, 2024

At the moment I work with container labels and all works fine with container ip addresses (until backend and proxy is in the same network!).
But I'll try the proxy-service-tasks flag. Thanks!

For my custom service (docker-gen to get container hostname / dns) which have the above describled problems. Here I have to find my own solution to get working dns / ip with docker-gen.

from caddy-docker-proxy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.