Code Monkey home page Code Monkey logo

Comments (9)

lucaslorentz avatar lucaslorentz commented on July 22, 2024

I'm not familiar with rancher internals.
This plugin reads label from docker swarm services and use them to generate caddyfile configuration.
Does rancher use docker swarm services?
Is the label io.rancher.container.ip available at service level or at container level?

How the ip should be used? As a target for caddy proxy directive? Like:

proxy / 10.42.155.12 {
    transparent
}

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

Rancher server uses cattle by default and the label should be container level instead of the default docker container ip address field.

Rancher optionally works with swarm and kubernetes too.

So your plugin isn't similiar to jwilder docker-gen which read container ip and generate a RevProxy / LB?

Ich converted jwilder RevProxy to Caddy and generate a caddyfile that way. It works with single and multiple (load balanced) backends. Each backend is identified by custom ip label.

May IT help if I post the docker-gen template here?

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

Yes, the ip(s) used as target for caddy proxy directive.

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on July 22, 2024

So your plugin isn't similiar to jwilder docker-gen which read container ip and generate a RevProxy / LB?

While jwilder docker-gen gets metadata about every container and use their ips as back-end.
This plugin gets metadata about docker swarm services and use those services dns name as caddy back-end.
The generated configuration looks like:

some-domain.com {
  proxy / myservicename {
    transparent
  }
}

So, with this plugin, caddy proxies some domain to a docker swarm service, and docker swarm is responsible for load balancing service traffic to all containers.

Possible changes to this plugin:

Currently, this plugin works well with multi node clusters. Mainly because it is aware and leverages swarm orchestration.

We could change this plugin to also support metadata from containers, that would make it less swarm specific.

But my understanding is that any automatic reverse-proxy should be aware about the orchestrator (swarm, kubernetes, cattle) to be able to get information about every container running on every node.

I suppose docker-gen only gets information about containers running on the same node it is running, right?

Other possibilities:

  • Change rancher to use swarm orchestrator and check if changes to this plugin are still necessary.
  • Fork this plugin and create something for rancher/cattle, it probably exposes information about nodes/services/containers on some api.
  • Try traefik, it seems to support rancher.

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

My custom RevProxy / LB used docker-gen and works at host base, but rancher LB use the service name too.

http://rancher.com/docs/rancher/v1.2/en/cattle/adding-load-balancers/

So maybe it's compatible... Rancher-compose is based on docker-compose and compose syntax with services is supported.

I'll have to test it.

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

Rancher Labels
http://rancher.com/docs/rancher/v1.2/en/cattle/labels/

from caddy-docker-proxy.

pwFoo avatar pwFoo commented on July 22, 2024

Information about rancher services
http://rancher.com/docs/rancher/v1.6/en/cattle/adding-services/

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on July 22, 2024

Maybe if this project support reverse proxying to containers it would work with rancher. Currently it only supports proxying to swarm services.

There are some benefits of adding that feature, like being able to use sticky sessions and load balancing from caddy.

from caddy-docker-proxy.

lucaslorentz avatar lucaslorentz commented on July 22, 2024

Closing this issue cause Rancher is not the focus of this project. That might change in the future.

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.