compose2kube icon indicating copy to clipboard operation
compose2kube copied to clipboard

LoadBalancer

Open fkautz opened this issue 8 years ago • 1 comments

A load balancer config should be created.

One potential approach:

services:
    web:
        ports:
            - "80:8080"

One option may be to use the host port "80" to point to the service port "8080".


A second option would be to add an additional config option specific for compose2kube

e.g.:

services:
    web:
        ports:
            - "8080" # `kube:"LoadBalancerPort:80"`

A third option would be to extract this to a separate config file, which would benefit operational users.

e.g.

services:
    web:
        ports:
            - "8080"

and

loadbalancers:
    web:
        ports:
            - "80:8080"

fkautz avatar Jul 05 '16 19:07 fkautz

One problem with the first approach is it breaks docker compose's ability to scale on a single system.

docker-compose scale web=10

Each replicated container will fail to start because they cannot bind to the host port.

fkautz avatar Jul 05 '16 21:07 fkautz