nicolaka / interlock-lbs

Interlock+LB Docker Compose Files
2 stars 1 forks source link

Issue on Interlock+HaProxy #1

Open pratapnanda opened 8 years ago

pratapnanda commented 8 years ago

Hello Nicolaka,

I am trying to execute Interlock+haproxy from docker toolbox(from local) which is pointing to AWS Controller.I have DDC-AWS template to create my cluster. I have tried both ehazlett/interlock:1.0.0 and ehazlett/interlock:1.1.0 ,both has the same below issue

command used: docker-compose -p "Demo" -f docker-compose_v1.yml up -d

Issue:- Creating volume "demo_haproxy" with default driver ←[31mERROR←[0m: Volume ucp-node-certs declared as external, but could not be found. Please create the volume manually using docker volume create --name=ucp-node-certs and try again.

config.toml: ListenAddr = ":8080" DockerURL = "tcp://ucp.docker.lab:2376" TLSCACert = "/certs/ca.pem" TLSCert = "/certs/cert.pem" TLSKey = "/certs/key.pem"

[[Extensions]] Name = "haproxy" ConfigPath = "/usr/local/etc/haproxy.cfg" PidPath = "/etc/haproxy.pid" BackendOverrideAddress = "172.17.0.1" MaxConn = 1024 Port = 80 AdminUser = "admin" AdminPass = "interlock"

echo $DOCKER_HOST tcp://ucp.docker.lab:443

i have used same compose file in code section I dont understand where is the issue and what step i have missed

nicolaka commented 8 years ago

@pratapnanda I found the easiest way to do this especially if you have UCP running already is to use compose from UI and deploy this compose file. Just plug in the specific node name that you wish to pin this application on and use the private IP of one of the controllers for SWARM_IP. We had to switch to nginx as it was much more robust when restarting it to apply new config.

interlock:
    image: ehazlett/interlock:master
    command: -D run
    tty: true
    ports:
        - 8080
    environment:
        constraint:node==<node-name>:
        INTERLOCK_CONFIG: |
            ListenAddr = ":8080"
            DockerURL = "tcp://${SWARM_IP}:2376"
            TLSCACert = "/certs/ca.pem"
            TLSCert = "/certs/cert.pem"
            TLSKey = "/certs/key.pem"
            PollInterval = "10s"

            [[Extensions]]
            Name = "nginx"
            ConfigPath = "/etc/nginx/nginx.conf"
            PidPath = "/etc/nginx/nginx.pid"
            MaxConn = 1024
            Port = 80
    volumes:
        - ucp-node-certs:/certs
    restart: always

nginx:
    image: nginx:latest
    entrypoint: nginx
    command: -g "daemon off;" -c /etc/nginx/nginx.conf
    ports:
        - 80:80
    labels:
        - "interlock.ext.name=nginx"
    restart: always
    environment:
        constraint:node==<node-name>:
pratapnanda commented 8 years ago

@nicolaka -Many Thanks for easier solution .I was able to deploy interlock+nginx but here I am trying to do the same in interlock+haproxy

nicolaka commented 8 years ago

cool let me know when it works @pratapnanda !