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

Specify Docker labels for the amazon/amazon-ecs-pause container #4427

Open
gstokkink opened this issue Nov 14, 2024 · 0 comments
Open

Specify Docker labels for the amazon/amazon-ecs-pause container #4427

gstokkink opened this issue Nov 14, 2024 · 0 comments

Comments

@gstokkink
Copy link

Summary

I would like to be able to add Docker labels to the amazon/amazon-ecs-pause container so I can filter them from, e.g., monitoring or logging tools, which often run as daemons.

Description

With the ECS_AGENT_LABELS environment variable in the /etc/ecs/ecs.config file I can easily add additional Docker labels to the amazon/amazon-ecs-agent. I can use these labels to, e.g., prevent these containers from being instrumented or logged. Since a while, the ECS agent also launches an amazon/amazon-ecs-pause container. I was kind of hoping that this container would inherit the extra labels from the ECS_AGENT_LABELS setting, but it doesn't. Perhaps a separate environment variable for this would make sense otherwise? ECS_PAUSE_LABELS?

Expected Behavior

For an amazon/amazon-ecs-agent container:

[ssm-user@ip-10-0-5-79 bin]$ docker inspect f059cbd52691 | jq .[0].Config.Labels
{
  "my.custom.label": "true"
}

For an amazon/amazon-ecs-pause container:

[ssm-user@ip-10-0-5-79 bin]$ docker inspect 9751fa7ca496 | jq .[0].Config.Labels
{
  "com.amazonaws.ecs.cluster": "be-ecs-cluster",
  "com.amazonaws.ecs.container-name": "~internal~ecs~pause",
  "com.amazonaws.ecs.task-arn": "arn:aws:ecs:eu-central-1:762732311162:task/be-ecs-cluster/8ce59918ef9c446a92db113f980b6196",
  "com.amazonaws.ecs.task-definition-family": "parkcms-production-puma-with-nginx-web",
  "com.amazonaws.ecs.task-definition-version": "28",
   "my.custom.label": "true"
}

Observed Behavior

For an amazon/amazon-ecs-agent container:

[ssm-user@ip-10-0-5-79 bin]$ docker inspect f059cbd52691 | jq .[0].Config.Labels
{
  "my.custom.label": "true"
}

For an amazon/amazon-ecs-pause container:

[ssm-user@ip-10-0-5-79 bin]$ docker inspect 9751fa7ca496 | jq .[0].Config.Labels
{
  "com.amazonaws.ecs.cluster": "be-ecs-cluster",
  "com.amazonaws.ecs.container-name": "~internal~ecs~pause",
  "com.amazonaws.ecs.task-arn": "arn:aws:ecs:eu-central-1:762732311162:task/be-ecs-cluster/8ce59918ef9c446a92db113f980b6196",
  "com.amazonaws.ecs.task-definition-family": "parkcms-production-puma-with-nginx-web",
  "com.amazonaws.ecs.task-definition-version": "28"
}

The additional Docker label is not used.

Environment Details

Not relevant I think.

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

1 participant