https://infracost.io logo
Title
q

quick-eve-19812

01/18/2023, 8:05 AM
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
{"level":30,"time":1674028217845,"pid":62,"hostname":"cloud-pricing-api-init-job--1-j4j55","msg":"Starting: downloading DB data"}
{"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

mysterious-teacher-68276

01/18/2023, 10:10 AM
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

quick-eve-19812

01/18/2023, 10:14 AM
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

mysterious-teacher-68276

01/18/2023, 10:19 AM
yes I understand that - are you executing these curl commands from inside the cloud-pricing-api pod?
q

quick-eve-19812

01/18/2023, 10:20 AM
No, I executed the curl command in another pod
m

mysterious-teacher-68276

01/18/2023, 10:23 AM
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

quick-eve-19812

01/18/2023, 10:25 AM
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

mysterious-teacher-68276

01/18/2023, 10:27 AM
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

quick-eve-19812

01/18/2023, 10:28 AM
ok I understand. I'll try that url you shared. thanks~
m

mysterious-teacher-68276

01/18/2023, 10:29 AM
if you just remove that configuration it defaults to our endpoint
so you can just remove
job.infracostPricingAPIEndpoint
I think
q

quick-eve-19812

01/18/2023, 10:30 AM
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

mysterious-teacher-68276

01/18/2023, 10:35 AM
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

quick-eve-19812

01/18/2023, 10:39 AM
our security team does not allow terraform codes to go out. So, I had to choose self-hosting.
m

mysterious-teacher-68276

01/18/2023, 10:41 AM
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

quick-eve-19812

01/18/2023, 11:04 AM
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.