Coder Social home page Coder Social logo

Comments (5)

MassiAtHG avatar MassiAtHG commented on June 9, 2024

Basic resolving code works with containers set up using 'docker compose', but it does not when the containers run in a 'k8s' setup.
Example code:

<?php
declare (strict_types = 1);

use \Amp\Loop;
use \Amp\Dns\Record;

require __DIR__ . '/vendor/autoload.php';

sleep(5);

Loop::run(function () {
    $records = yield \Amp\Dns\resolve('eventstore', Record::A);
    var_dump($records);
});

The error generated is the following:

Fatal error: Uncaught Amp\Dns\NoRecordException: No records returned for 'eventstore' (DNAME) in /app/vendor/amphp/dns/lib/Rfc1035StubResolver.php:317
Stack trace:
#0 [internal function]: Amp\Dns\Rfc1035StubResolver->Amp\Dns\{closure}()
#1 /app/vendor/amphp/amp/lib/Coroutine.php(76): Generator->send(Object(LibDNS\Messages\Message))
#2 /app/vendor/amphp/amp/lib/Internal/Placeholder.php(130): Amp\Coroutine->Amp\{closure}(NULL, Object(LibDNS\Messages\Message))
#3 /app/vendor/amphp/amp/lib/Coroutine.php(81): Amp\Coroutine->resolve(Object(LibDNS\Messages\Message))
#4 /app/vendor/amphp/amp/lib/Internal/Placeholder.php(43): Amp\Coroutine->Amp\{closure}(NULL, Object(LibDNS\Messages\Message))
#5 /app/vendor/amphp/amp/lib/Internal/PrivatePromise.php(23): class@anonymous->onResolve(Object(Closure))
#6 /app/vendor/amphp/amp/lib/Internal/Placeholder.php(125): Amp\Internal\PrivatePromise->onResolve(Object(Closure))
#7 /app/vendor/amphp/amp/lib/Deferred.php(45): class@anonymous->resolve(Object(Amp\Internal\PrivatePromise))
#8 /app/vendo in /app/vendor/amphp/dns/lib/Rfc1035StubResolver.php on line 317

Attached an archive used to verify the bug using 'minikube' (locally) and 'kops' (AWS).
DNSTest.zip

from dns.

MassiAtHG avatar MassiAtHG commented on June 9, 2024

An additional piece of info, the content of the 'resolve.conf' file on the AWS setup:

nameserver 100.64.0.10
search default.svc.cluster.local svc.cluster.local cluster.local eu-west-2.compute.internal
options ndots:5

from dns.

kelunik avatar kelunik commented on June 9, 2024

I guess the DNS is resolved via the search configuration? In that case, try eventstore.default.svc.cluster.local etc. and see whether that works.

from dns.

MassiAtHG avatar MassiAtHG commented on June 9, 2024

Your suggestion seems to works correctly. Thank you very much.

from dns.

kelunik avatar kelunik commented on June 9, 2024

If you want direct support, please add a 👍 to #47.

from dns.

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.