pygmystack / pygmy

the pygmy stack is a container stack for local development
MIT License
25 stars 12 forks source link

Local container-based DNS cannot resolve on some Linux systems. #585

Open fubarhouse opened 7 hours ago

fubarhouse commented 7 hours ago

If you, for example have a container service in docker-compose named elasticsearch, it is not resolvable through local DNS on some distributions of Linux.

More specifically, Ubuntu is impacted by this issue where Arch Linux is now, though independent testing should be carried out on MacOS to achieve parity.

The root cause of problem is because of the default Resolver configuration being provided on Ubuntu is different than Arch.

To do's

I have been wanting to fix this for a while, so now is as good of a time as any.

Evidence of a working system

cli-drupal:/app$ curl opensearch:9200
{
  "name" : "4a0a84aab61c",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "KHuKDDCIT3OVV-Y-ZFQ8Ng",
  "version" : {
    "distribution" : "opensearch",
    "number" : "2.17.0",
    "build_type" : "tar",
    "build_hash" : "8586481dc99b1740ca3c7c966aee15ad0fc7b412",
    "build_date" : "2024-09-13T01:04:14.707418737Z",
    "build_snapshot" : false,
    "lucene_version" : "9.11.1",
    "minimum_wire_compatibility_version" : "7.10.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "The OpenSearch Project: https://opensearch.org/"
}

Source: https://github.com/lagoon-examples/drupal-opensearch

fubarhouse commented 6 hours ago

I'm not able to reproduce the problem... again.

I'll leave this one open in case somebody can provide more information.

Users affected by this change can find the Resolver file specific to Pygmy in the following path /usr/lib/systemd/resolved.conf.d. What I'd like to see is some sort of networking config - be it resolv or NetworkManager which demonstrates why this issue is causing a problem. All indications dealing with this in the past seems to isolate it to the default configuration under Ubuntu systems.

The situation I know happens for some people looks like the following, but the service name & port might be different:

$ curl opensearch:9200
curl: (6) Could not resolve host: opensearch