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

Rate Card API failure Azure Gov Cloud #2050

Closed
nbjohnson opened this issue Mar 14, 2023 · 15 comments
Closed

Rate Card API failure Azure Gov Cloud #2050

nbjohnson opened this issue Mar 14, 2023 · 15 comments
Labels
bug Something isn't working

Comments

@nbjohnson
Copy link

nbjohnson commented Mar 14, 2023

Describe the bug
When configuring kubecost to retrieve pricing info it fails due to using the wrong env api endpoint

To Reproduce
Steps to reproduce the behavior:

  1. Configure kubecostProductConfigs for azure env:
  • azureSubscriptionID: <>
  • azureClientID: <>
  • azureTenantID: <>
  • azureClientPassword: <>
  • azureBillingRegion: US
  • currencyCode: USD
  • createServiceKeySecret: true

Expected behavior
Pull usgov pricing into kubecost

Collect logs (please complete the following information):
Failed to download pricing data: commerce.RateCardClient#Get: Failure sending request: StatusCode=0 -- Original Error: Get "https://apim-ratecard-v1.azure-api.net/ratecards/v1/<>/<plan>/USD/v20150515/2023-03-01.json?sv=2018-03-2.......": EOF

Trying to get rate data from azure, but doesn't seem to be recognizing azure usgov env and is using the public rate card api endpoint instead of the usgov endpoint, looks like it should be hitting azure-api.us. Not sure if there is some other setting that I need to be using to it to recognize usgov. I dont see auth errors so it seems like it picked up the env just fine to login to gov rather then public, but the rate date api request isnt picking that up

@nbjohnson nbjohnson added the bug Something isn't working label Mar 14, 2023
@AjayTripathy
Copy link
Contributor

Hi @nbjohnson I'm guessing we don't currently support the gov env for pricing estimates on Azure. I think that's something we can look to add, but maybe you can tell us a little more about your team and usecase so we can get this prioritized?

Meanwhile, we should be able to still get accurate pricing by reconciling to your monthly azure bill when you integrate that.

@nbjohnson
Copy link
Author

@AjayTripathy It would be great if gov could be supported. Not sure what other change might need to be made but as of right now the main one I have run into is it using the wrong endpoint for the rate card. If you guys are willing to support it just let me know what additional info might be needed to be able to support the gov env

@thomasvn
Copy link
Member

Hey @nbjohnson! Have you configured Azure Cloud Billing Integration?

In most cases, the Azure Cloud Billing Integration is all that's needed for Kubecost to ingest your out-of-cluster costs, and also reconcile the predicted in-cluster costs against the bill.

Because the Azure Cost Export may take ~24-48hrs to be made available, the primary advantage of the Rate Card API would just be to increase the accuracy of cost allocations for the last 24-48hrs.

@kjfly
Copy link

kjfly commented Sep 1, 2023

We are still experiencing the same issue. Is there any update on this? We want to use rate card api to get better accuracy.

@kwombach12
Copy link

@kjfly Can you share some context on the issue you're experiencing? Kubecost reconciles your costs with the Azure Cloud Billing Integration, so your costs should be accurate.

@kjfly
Copy link

kjfly commented Sep 5, 2023

We did get Kubecost to reconcile using the Azure cost report exports. The issue is that the reports are estimates till the billing cycle finalizes. We want to use the rate card api to get better numbers even before the billing is finalized. But using the rate card api, we still see the same issue that was reported earlier.

@kwombach12
Copy link

@kjfly You should be getting an updated Azure Cost Export every 24-48 hours - you shouldn't need to wait the full billing cycle. Are you also using the gov env?

@mitre-dleung
Copy link

@kjfly You should be getting an updated Azure Cost Export every 24-48 hours - you shouldn't need to wait the full billing cycle. Are you also using the gov env?

We have confirmed with Azure support that Azure Cost Export numbers are only estimates until the billing period is "finalized" which is 72 hours after the close of the billing period. They provided their official docs which does state this.

We have also confirmed the Azure Export Data are forecasts/estimates that vary every day (so wildly that the cost data is effectively useless for decision making) with the following test:

  • If I compare the CostInBillingCurrency for the same resource on any day in the current billing period (day x) between the reports for any 2 different days in the current billing period, the costs for day x for the 2 reports do not match and can vary wildly (>100%).

When we brought these findings to Azure support, they confirmed again that this was by design. Therefore Azure cost exports are not a valid data source for cost data in an open (non-finalized) billing period.

@kjfly
Copy link

kjfly commented Sep 5, 2023

Is rate card api currently supported by Kubecost? The documentation mentions it but it is not working for us. The same configuration does work with opencost so we know that configuration/permissions etc are correct.

@kwombach12
Copy link

@kjfly Yes, the rate card api is supported by Kubecost. @jcharcalla can you take a look here and see if theres some bug?

@kjfly
Copy link

kjfly commented Sep 25, 2023

Hi, any update on this?

@chipzoller
Copy link
Collaborator

This seems like it's an application issue and not an issue with the Helm chart itself. I'd suggest emailing Kubecost support at support@kubecost.com or creating a thread in the #support channel on Kubecost Slack.

@kjfly
Copy link

kjfly commented Sep 25, 2023

ok, thanks

@AjayTripathy
Copy link
Contributor

@kwombach12 this seems like a feature request to support the govcloud ratecard API-- can we file a feature request and get it prioritized?

@chipzoller
Copy link
Collaborator

Logged as kubecost/features-bugs#10. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

7 participants