azukiapp/azk

Container can't use the azk DNS

Opened this issue · 5 comments

When I try to connect a dependent container to the container that it depends, it can't using the net.host, it fails. If I try with the IP of container it works, and also works with the IP of host.

Reproduce:
a. Clone the azkdemo project
b. Follow the steps to connect with Redis
c. Try restart

Output

captura de tela de 2016-04-03 15-28-33

Info
a. Fedora 23
b. Not using VirtualBox
c.

/**
 * Documentation: http://docs.azk.io/Azkfile.js
 */
// Adds the systems that shape your system
systems({
  azkdemo: {
    // Dependent systems
    depends: ["redis"],
    // More images:  http://images.azk.io
    image: {"docker": "azukiapp/node"},
    // Steps to execute before running instances
    provision: [
      "npm install",
    ],
    workdir: "/azk/#{manifest.dir}",
    shell: "/bin/bash",
    command: ["npm", "start"],
    wait: 20,
    mounts: {
      '/azk/#{manifest.dir}': sync("."),
      '/azk/#{manifest.dir}/node_modules': persistent("./node_modules"),
    },
    scalable: {"default": 1},
    http: {
      domains: [ "#{system.name}.#{azk.default_domain}" ]
    },
    ports: {
      // exports global variables
      http: "3000/tcp",
    },
    envs: {
      // Make sure that the PORT value is the same as the one
      // in ports/http below, and that it's also the same
      // if you're setting it in a .env file
      NODE_ENV: "dev",
      PORT: "3000",
    },
  },
  redis: {
    image: {docker: "redis"},
    export_envs: {
      "DATABASE_URL": "redis://#{net.host}:#{net.port[6379]}",
    },
  },
});

Hey guys, nothing about it?

hi @ReeSilva. this can be a problem with the dns resolver or redis connection.

  • redis connection: are you using the env DATABASE_URL in your application?
  • dns resolver:
    run this command:
$ azk agent start
$ dig dev.azk.io

@gullitmiranda Hey guy, thanks for ur answer. Yeah, I'm using the DATABASE_URL, the application that I use to describe the error was the azkdemo application.
When I dig both from host and other containers the result is the same. But, when I telnet the port of the redis container (in that run, 32770), it fails on container but works on host (as you can see on the image above)
captura de tela de 2016-05-03 16-33-26

so the problem is in dns-resolver.
you could send this message in the chat (https://gitter.im/azukiapp/azk) so that we can have an more quickly interaction?

Sure, I'll do that