Hello Team, I've installed cloud-pricing-api for s...
# help
q
Hello Team, I've installed cloud-pricing-api for self-hosting by using helm chart. But, I had an error when it runs init-job I got the message in cloud-pricing-api-init-job--1-xxx
cloud-pricing-api@0.3.10 data:download
node dist/cmd/dataDownload.js
Copy code
{
  "level": 30,
  "time": 1674028217845,
  "pid": 62,
  "hostname": "cloud-pricing-api-init-job--1-j4j55",
  "msg": "Starting: downloading DB data"
}
Copy code
{
  "level": 50,
  "time": 1674028217846,
  "pid": 62,
  "hostname": "cloud-pricing-api-init-job--1-j4j55",
  "msg": "There was an error downloading data: connect ECONNREFUSED 127.0.0.1:80"
}
I think it has not set the right address for Infracost API but I cannot find any parameters in values.yaml I only set 3 parameters in values.yaml.
infracostAPIKey : "ico-xxxxx" (value what i checked in infracost web page)
api.selfHostedInfracostAPIKey : "1234" (value what I decided)
job.infracostPricingAPIEndpoint: "cloud-pricing-api.finops.svc.cluster.loc"
I have not found any way to fix it. Any assistance greatly appreciated. thanks.
m
Hi @quick-eve-19812 from the information provided it seems that the script is having problems resolving the
cloud-pricing-api.finops.svc.cluster.loc
endpoint. Are you able to resolve this hostname in the cluster? There’s some useful debugging steps outlined here https://kubernetes.io/docs/tasks/administer-cluster/dns-debugging-resolution/ which can help verify if this endpoint is actually accessible
q
yes, the endpoint is accessible, and the curl command (in below websites) also gets a normal response. https://www.infracost.io/docs/cloud_pricing_api/self_hosted/#troubleshooting
The endpoint(cloud-pricing-api.finops.svc.cluster.local) means kubernetes service domain of "cloud-pricinng-api"
m
yes I understand that - are you executing these curl commands from inside the cloud-pricing-api pod?
q
No, I executed the curl command in another pod
m
so for the download data job
infracostPricingAPIEndpoint
needs to be set to fetch data from our pricing api, i.e. https://pricing.api.infracost.io
q
I think we need to approach infracost to download db dump. I don't know why 127.0.0.1 appears in the log.
ok.. you mean
job.infracostPricingAPIEndpoint
does not mean cloud-pricing-api that I installed?
m
no - it needs to be our endpoint
as that’s where the data is fetched from
right now your trying to download data from your own api - which doesn’t exist
q
ok I understand. I'll try that url you shared. thanks~
m
if you just remove that configuration it defaults to our endpoint
so you can just remove
job.infracostPricingAPIEndpoint
I think
q
ok, I'll try it thank you for your support.
oh.. I think it is working!! I misunderstood that parameter thank you, thank you so much.
m
no probs
just a follow up question - why have you chosen to self host vs using our managed service? Given that it’s free.
q
our security team does not allow terraform codes to go out. So, I had to choose self-hosting.
m
Ok understood, just an FYI we don’t actually send any Terraform code to our pricing api at all, you can see what information we send here: https://www.infracost.io/docs/faq/#what-data-is-sent-to-the-cloud-pricing-api
q
Yes, actually, our security team doesn't want the infrastructure code to go out. The same goes for information about infrastructure. Thank you for all your support. Infracost helps us a lot in what we do.