Users may wish to run the CloudWatch Agent using pod-based IAM roles, using the IRSA or EKS Pod Identities technologies. Recently (PR below) this was enabled when an environment variable is set on the agent pod, RUN_WITH_IRSA=true, and this enables the agent to utilize the default provider chain for AWS authentication.
However, the EKS Addon for AWS CloudWatch Observability creates a managed AmazonCloudWatchAgent configuration, making it unsafe - there is no guarantee it won't be overridden - to add environment variables.
Background
CloudWatch Agent PR:
Expected behavior
Running the EKS Addon for AWS CloudWatch Observability with pod-based IAM should work by default.
Actual behavior
The agent fails, and there is no knob available to users to ensure the agent works.
Proposal
Either of these solutions would address this:
- The Addon and Operator should permit an additional configuration, to merge either individual env vars or arbitrary config into the
AmazonCloudWatchAgent custom resource
- The Agent's configuration file,
cwagentconfig.json, which is managed by the add-on should accept a configuration key to enable the RUN_WITH_IRSA mode.
Users may wish to run the CloudWatch Agent using pod-based IAM roles, using the IRSA or EKS Pod Identities technologies. Recently (PR below) this was enabled when an environment variable is set on the agent pod,
RUN_WITH_IRSA=true, and this enables the agent to utilize the default provider chain for AWS authentication.However, the EKS Addon for AWS CloudWatch Observability creates a managed
AmazonCloudWatchAgentconfiguration, making it unsafe - there is no guarantee it won't be overridden - to add environment variables.Background
CloudWatch Agent PR:
Expected behavior
Running the EKS Addon for AWS CloudWatch Observability with pod-based IAM should work by default.
Actual behavior
The agent fails, and there is no knob available to users to ensure the agent works.
Proposal
Either of these solutions would address this:
AmazonCloudWatchAgentcustom resourcecwagentconfig.json, which is managed by the add-on should accept a configuration key to enable the RUN_WITH_IRSA mode.