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

V4 endpoint support #38

Closed
alkalinecoffee opened this issue Apr 17, 2020 · 7 comments
Closed

V4 endpoint support #38

alkalinecoffee opened this issue Apr 17, 2020 · 7 comments

Comments

@alkalinecoffee
Copy link

👋 Hey all, thanks for making this image available.

Is there any planned support for V4 metadata endpoints? Do we have an ETA on this?

Thanks

@bvtujo
Copy link

bvtujo commented Apr 17, 2020

Hi Joe, we don't currently have an ETA but will discuss this and update the issue when we have more information. For the time being, @PettitWesley may know more about the status.

@PettitWesley
Copy link
Contributor

@alkalinecoffee @bvtujo I haven't thought about V4 much; I don't have an ETA either.

In ECS, V4 is the same as V3 except network IO stats are present for all network modes. Previously with V3 they were not present for the awsvpc network mode. AFAICT, the structure used is the same as the one provided by docker stats. Since local endpoints does not have a true awsvpc- network stats should already be present in all stats responses.

So on that front, its not clear to me that any changes are actually needed for this tool- I think you might be able to just set the ECS_CONTAINER_METADATA_URI_V4 to the same value we recommend for v3 and it would work.

So may be all we need is doc change? Someone should investigate this. I created this project and still try to maintain it, but its no longer my primary focus, I'd prefer if someone else could help out.

@alkalinecoffee
Copy link
Author

Thanks for the response. According to the docs, there are a few additional values added to the V4 task endpoint:

AttachmentIndex
IPV4SubnetCIDRBlock
MACAddress
PrivateDNSName
SubnetGatewayIPV4Address
DomainNameServers (Fargate tasks only)
DomainNameSearchList (Fargate tasks only)

https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task-metadata-endpoint-v4.html

I haven't had a chance to look at the code myself, but is it possible today to mock or otherwise inject other values (perhaps from envvars) into the metadata endpoint response? That might help make this more flexible in the long-term, as the docs above state that more values may be added over time. Maybe we can put the onus on the developer to add mocked values as needed instead of having to keep this image up to date with each value.

@PettitWesley
Copy link
Contributor

@alkalinecoffee Ah I see. Then we do need to make changes to support V4, to mock those new fields. Right now we have default mocks for metadata fields, which can be overridden with Env Vars, we can take the same approach.

Are you interested in contributing this?

@PettitWesley
Copy link
Contributor

Implementation steps for the full solution:

  • Enable generic metadata injection from a file #40 adds generic metadata injection from a JSON file
  • Add docs for the above feature
  • Add an example JSON metadata file for the new fields in V4
  • Add docs on V4, tell users to use the same HTTP path as V3

@iamhopaul123
Copy link
Contributor

Closing this issue since implementation and docs are now available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants