Skip to content

feat(base): support IRSA annotations on logs controller SA when cloudwatch enabled#157

Merged
davidf-null merged 1 commit into
mainfrom
feature/cloudwatch-irsa-sa-annotations
Jul 16, 2026
Merged

feat(base): support IRSA annotations on logs controller SA when cloudwatch enabled#157
davidf-null merged 1 commit into
mainfrom
feature/cloudwatch-irsa-sa-annotations

Conversation

@davidf-null

Copy link
Copy Markdown
Collaborator

What

Renders annotations on the nullplatform-pod-metadata-reader-sa ServiceAccount only when cloudwatch.enabled is true and cloudwatch.serviceAccount.annotations is non-empty. Adds the cloudwatch.serviceAccount.annotations value (default {}).

No change for existing installs: with cloudwatch disabled or no annotations set, the SA renders exactly as before.

Why

The logs controller (k8s-logs-controller) runs under nullplatform-pod-metadata-reader-sa. The SA had no annotations and no way to set them via values, so on EKS the controller could only reach CloudWatch through the node instance role (broad, node-wide privilege).

This lets you set eks.amazonaws.com/role-arn on the SA and use IRSA — a scoped IAM role for just the logs controller — instead of granting CloudWatch to every pod on the node.

Changes

  • templates/serviceaccount.yaml — conditional annotations block on the reader SA
  • values.yaml — new cloudwatch.serviceAccount.annotations (default {}) with documented example
  • README.md — values table entry

Usage

cloudwatch:
  enabled: true
  serviceAccount:
    annotations:
      eks.amazonaws.com/role-arn: arn:aws:iam::<account-id>:role/<role-name>

Testing

helm template verified in three scenarios:

  • cloudwatch disabled → SA has no annotations
  • cloudwatch enabled + role-arn → annotation rendered with correct indentation
  • cloudwatch enabled + empty map → no empty annotations: block (valid YAML)

Paired with the tofu-modules change that passes this value through the base module: nullplatform/tofu-modules#441

🤖 Generated with Claude Code

…watch enabled

Render annotations on the nullplatform-pod-metadata-reader-sa ServiceAccount
only when cloudwatch.enabled is true and cloudwatch.serviceAccount.annotations
is set, so the logs controller can reach CloudWatch via a scoped IRSA role
instead of the node instance role.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@davidf-null
davidf-null merged commit f9213dd into main Jul 16, 2026
3 checks passed
@davidf-null
davidf-null deleted the feature/cloudwatch-irsa-sa-annotations branch July 16, 2026 19:08
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

Successfully merging this pull request may close these issues.

2 participants