Code Monkey home page Code Monkey logo

Comments (7)

lucaslorentz avatar lucaslorentz commented on July 22, 2024 1

Hey @jtyr
I'm implementing it slightly different, by merging directive objects instead of manipulating strings.
I'm creating a PR.

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

Additional question... Works the plugin with multi node / host swarm setups or just single / locale host?

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

Hi @lucaslorentz,
any plans to implement load balancing by container ip addresses?

from caddy-docker-proxy.

jcmeier avatar jcmeier commented on July 22, 2024

Hi!
I am also quite interested in having this. Since it would make it possible to scale up the backend containers and adding it to load balancing in caddy on the fly.

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on July 22, 2024

Hey @jcmeier
We already supports multiple backend containers with scale up and down. You just need to add labels to a swarm service.
Caddy will then proxy to swarm service VIP, and swarm service will load balance to all containers.

This issue is to add the same capabilities without swarm services.

from caddy-docker-proxy.

jcmeier avatar jcmeier commented on July 22, 2024

Thanks for clearing this up @lucaslorentz!

from caddy-docker-proxy.

jtyr avatar jtyr commented on July 22, 2024

I have put together a hacky solution for loadbalancing containers in a service. It only works if the labels are defined on the service level:

version: "3"
services:
  frontend:
    image: mycaddy
    ports:
      - 443:443
  backend:
    image: mycaddy
    labels:
      caddy.address: https://example.com
      caddy.targetport: 80
      caddy.proxy.keepalive: 0
    deploy:
      replicas: 2

It would be more difficult to make it working if labels are defined under the deploy section. It would require to search for nodes where service tasks are running and then search for containers on those nodes which have swarm label with the service name (am I right @lucaslorentz?). Please test it and let me know whether it works for you and if yes, I will create a PR for this feature.

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.