Skip to content

Setup cronjob to collect billing metrics - #189

Merged
naved001 merged 1 commit into
CCI-MOC:mainfrom
naved001:billing/setup-collectors
Oct 27, 2026
Merged

naved001 merged 1 commit into
CCI-MOC:mainfrom
naved001:billing/setup-collectors

Conversation

@naved001

@naved001 naved001 commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

This targets the oac-prod-workload0 cluster for billing. The cronjob will only run the hub cluster.

@naved001
naved001 force-pushed the billing/setup-collectors branch 3 times, most recently from 9b7976f to 6e48240 Compare October 27, 2026 14:25

@QuanMPhm QuanMPhm left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@naved001 Did you test if ESO can access the b2 secrets from oac-prod-workload0? From what I see, these b2 secrets should be inaccessible, since the secret name on AWS does not start with the cluster prefix

@naved001

Copy link
Copy Markdown
Contributor Author

@QuanMPhm The cronjob will run on oac-prod-infra and not oac-prod-workload0. And then even oac-prod-infra cannot read that b2 secret and for that I have a PR here: CCI-MOC/moc-aws#62

I guess the issue description isn't clear - I am targeting the oac-prod-workload0 for billing.

clusterId: cac066c0-9e64-4421-928b-93b75c4c4d41
clusterType: hypershift
bucket: oac-prod-workload0-metrics
s3RemoteKey: b2-key/oac-prod-workload0-rw

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Related to this comment

QuanMPhm
QuanMPhm previously approved these changes Oct 27, 2026
@naved001
naved001 requested a review from computate October 27, 2026 18:26
This targets the oac-prod-workload0 cluster.
@naved001
naved001 force-pushed the billing/setup-collectors branch from 6e48240 to d521155 Compare October 27, 2026 19:39
Comment on lines +4 to +5
# Empty by default, so on most clusters this chart only creates the reader
# service account and its token. Set it per cluster where collection runs:

@QuanMPhm QuanMPhm Oct 27, 2026 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this chart create a service account and token on each cluster? Given that the default value for collectors is empty and all templates will be empty if collectors is empty? It seems like this chart won't do anything on any cluster except oac-prod-infra

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This applicationset will render this chart on every hub cluster.

And this chart will render this on all managed cluster.

With this setup, every cluster will have the service account and a token available to query metrics from. We currently do not use the token from the managed clusters - we may use it in the future if we have classes.

the default value for collectors is empty as you noted, so no cluster by default will get a cronjob. Only oac-prod-infra will get the cronjob as its value files override the empty collectors and that is what we actually want.

@QuanMPhm does this clarify things?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@QuanMPhm Btw, I appreciate the questions and a thorough review, thank you!

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies. This whole time I was too fixated on the git diff, I didn't realized the moc-metrics-collector chart contained more than just the cronjob and external secret.

@QuanMPhm
QuanMPhm self-requested a review October 27, 2026 20:37
@QuanMPhm
QuanMPhm dismissed their stale review October 27, 2026 20:39

I have another question after studying this repo a bit more

@naved001
naved001 merged commit 79e9bdf into CCI-MOC:main Oct 27, 2026
3 checks passed
@naved001
naved001 deleted the billing/setup-collectors branch October 27, 2026 23:45
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.

3 participants