Skip to content

Create a service account for the billing chart - #1322

Merged
Imtiaz246 merged 3 commits into
masterfrom
upd-sa-aggregator
Aug 20, 2026
Merged

Imtiaz246 merged 3 commits into
masterfrom
upd-sa-aggregator

Conversation

@Imtiaz246

Copy link
Copy Markdown
Member

The aggregator statefulset, summary cronjob and processor resolved their service account through a helper that fell back to default, so the pods ran with no identity of their own. Referencing the ace chart's account by name is not an option either: it is ace.fullname, so a release named ace-platform owns ace-platform, not ace.

Add templates/rbac/serviceaccount.yaml and follow the ace chart's helper shape, deriving the name from billing.fullname when serviceAccount.create is set. serviceAccount.annotations carries the cloud identity binding (e.g. iam.gke.io/gcp-service-account), the same way the ace chart passes global.serviceAccount.annotations.

Setting serviceAccount.create to false keeps the old behaviour, and combining it with serviceAccount.name points the pods at an existing account such as the one the ace release creates.

The aggregator statefulset, summary cronjob and processor resolved their
service account through a helper that fell back to `default`, so the pods
ran with no identity of their own. Referencing the ace chart's account by
name is not an option either: it is `ace.fullname`, so a release named
ace-platform owns `ace-platform`, not `ace`.

Add templates/rbac/serviceaccount.yaml and follow the ace chart's helper
shape, deriving the name from `billing.fullname` when
`serviceAccount.create` is set. `serviceAccount.annotations` carries the
cloud identity binding (e.g. iam.gke.io/gcp-service-account), the same
way the ace chart passes `global.serviceAccount.annotations`.

Setting `serviceAccount.create` to false keeps the old behaviour, and
combining it with `serviceAccount.name` points the pods at an existing
account such as the one the ace release creates.

Signed-off-by: Imtiaz Uddin <imtiaz@appscode.com>
The aggregator dies during startup because the license check reads the
kube-system namespace to derive the cluster id:

  [F] Failed to run app with [/b3 aggregator --interval=30s]: license
  status unknown, reason: namespaces "kube-system" is forbidden: User
  "system:serviceaccount:ace:default" cannot get resource "namespaces"

platform-api solves this with the appscode:license-checker and
appscode:license-reader cluster roles bound to its own service account,
so ship the same pair from the billing chart's rbac folder. Both roles are
created as pre-install/pre-upgrade hooks under their shared fixed names,
exactly as platform-api and accounts-ui do, so releases do not fight over
ownership.

The ace chart's own rbac.yaml is not reused here: its rules cover
trickster, CAPI clusters, vcluster and flux bootstrap data, none of which
the billing components touch.

Signed-off-by: Imtiaz Uddin <imtiaz@appscode.com>
Signed-off-by: Imtiaz Uddin <imtiaz@appscode.com>
@Imtiaz246
Imtiaz246 merged commit ed47986 into master Aug 20, 2026
8 checks passed
@Imtiaz246
Imtiaz246 deleted the upd-sa-aggregator branch August 20, 2026 10:18
@Imtiaz246
Imtiaz246 restored the upd-sa-aggregator branch August 20, 2026 12:16
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.

1 participant