Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No way to differentiate between IPV4/IPV6 Port Mapptings #3096

Closed
vincentjames501 opened this issue Nov 23, 2021 · 2 comments
Closed

No way to differentiate between IPV4/IPV6 Port Mapptings #3096

vincentjames501 opened this issue Nov 23, 2021 · 2 comments
Labels
kind/enhancement kind/tracking This issue is being tracked internally

Comments

@vincentjames501
Copy link

Summary

Right now with the Task metadata endpoint version 4 API, there is no way to differentiate which Ports are for ipv4/ipv6.

References:
#2870
#3025

Description

We are now getting ipv4 & ipv6 ports when we were previously just getting ipv4.

We are now getting the following when querying the ECS task metadata endpoint:

$ curl http://169.254.170.2/v4/c8739a8c-7d64-44e0-8600-427ca273f031/task | jq
{
...
      "Ports": [
        {
          "ContainerPort": 8888,
          "Protocol": "tcp",
          "HostPort": 49832
        },
        {
          "ContainerPort": 8888,
          "Protocol": "tcp",
          "HostPort": 49825
        }
      ],
...
}

Note docker inspect will show the HostIp:

$ sudo docker inspect 8507b80d2320
{...
            "Ports": {
                "10000/tcp": null,
                "8888/tcp": [
                    {
                        "HostIp": "0.0.0.0",
                        "HostPort": "49832"
                    },
                    {
                        "HostIp": "::",
                        "HostPort": "49825"
                    }
                ]
            },
...
}

Expected Behavior

Ideally I'd love for there to be a way to differentiate these. Can we just expose HostIp such that this:

{
          "ContainerPort": 8888,
          "Protocol": "tcp",
          "HostPort": 49832
},

Would become:

{
          "ContainerPort": 8888,
          "Protocol": "tcp",
          "HostPort": 49832,
          "HostIp": "0.0.0.0"
},

This would give API clients the ability to differentiate easily between them.

Observed Behavior

There is no way to distinguish between the two via the task metadata endpoint v4.

Environment Details

ECS

"Version":"Amazon ECS Agent - v1.56.0 (174ace6d)"

Docker

Client:
 Version:           20.10.7
@mythri-garaga
Copy link
Contributor

Hi @vincentjames501,

Thank you for reporting this, we will take a look at this.

@mythri-garaga
Copy link
Contributor

Closing this issue as it is addressed in #3112.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement kind/tracking This issue is being tracked internally
Projects
None yet
Development

No branches or pull requests

3 participants