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

The custom pricing config map data format defined incorrectly for opencost #240

Open
bd-spl opened this issue Dec 10, 2024 · 1 comment
Open

Comments

@bd-spl
Copy link

bd-spl commented Dec 10, 2024

The custom pricing data format defined for PRICING_CONFIGMAP_NAME is incorrectly provided in the configmap template. As debugging of the source code shows, it only reads that data properly if defined directly, like this:

data:
  spotLabel: foo
  spotLabelValue: bar

See aws example for more possible data overrides.

Note that the case for what I was testing these data formats, is merging config overrides from a config map defined in PRICING_CONFIGMAP_NAME. That only worked for the direct data format given above, even without extra volumes mounts that the helm chart normally creates, when .Values.opencost.customPricing.enabled=true. Perhaps I am confusing that config option to my special case?

@bd-spl
Copy link
Author

bd-spl commented Dec 10, 2024

Also note that the volume mount created for the custom pricing config should not be readOnly, as opencost errors out like this:

INF ERROR UPDATING custom-pricing-model CONFIG: error writing config file for provider config: Failed to write file: open /tmp/custom-config/aws.json: read-only file system

update: the mounted volume should be fine, I confused it with the exporter chart, but that is another story

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