little-author-61621
INFRACOST_API_KEY
isn’t set.mysterious-kitchen-14875
10/03/2022, 3:30 PMlittle-author-61621
INFRACOST_API_KEY
needs to be a valid Infracost API key so it can pull the price DB from our APIs. There’s some steps here for generating one.mysterious-kitchen-14875
10/03/2022, 4:05 PMPlease check your …credentials.yml file or INFRACOST_API_KEY environment variable.
If you recently regenerated your API key, you can retrieve it from <https://dashboard.infracost.io>.
See <https://infracost.io/support> if you continue having issues.
little-author-61621
mysterious-kitchen-14875
10/03/2022, 4:07 PMinfracost breakdown --path .
little-author-61621
infracost auth login
and got the Infracost API key from ~/.config/infracost/credentials.yml
2. Updated the INFRACOST_API_KEY
secret value in your k8s cluster with that value
If so you can now check that the init job in k8s is running properly.
Then you can set your local Infracost CLI version to hit your self-hosted pricing api using:
infracost configure set pricing_api_endpoint <http://localhost:4000>
infracost configure set api_key $SELF_HOSTED_INFRACOST_API_KEY
mysterious-kitchen-14875
10/03/2022, 4:19 PMlittle-author-61621
mysterious-kitchen-14875
10/04/2022, 6:46 AM(base) gianlucadivincenzo@MacBook-Pro-di-Gianluca terraform % kubectl logs -f infracost-cloud-pricing-api-57c5654784-fsjg7 -n infracost
> cloud-pricing-api@0.3.8 start
> node dist/server.js
{"level":30,"time":1664873913625,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"🚀 Server ready at <http://0.0.0.0:4000/>"}
{"level":50,"time":1664873919929,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
{"level":50,"time":1664873919938,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
{"level":50,"time":1664873924911,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
{"level":50,"time":1664873924912,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
{"level":50,"time":1664873929908,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
{"level":50,"time":1664873929915,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
{"level":50,"time":1664873929924,"pid":18,"hostname":"infracost-cloud-pricing-api-57c5654784-fsjg7","msg":"Could not connect to database: error: password authentication failed for user \"cloudpricingapi\""}
npm notice
npm notice New minor version of npm available! 8.1.2 -> 8.19.2
npm notice Changelog: <<https://github.com/npm/cli/releases/tag/v8.19.2>>
npm notice Run `npm install -g npm@8.19.2` to update!
npm notice
npm ERR! path /usr/src/app
npm ERR! command failed
npm ERR! signal SIGTERM
npm ERR! command sh -c node dist/server.js
npm ERR! A complete log of this run can be found in:
npm ERR! /home/infracost/.npm/_logs/2022-10-04T08_58_50_446Z-debug.log
among the logs of the pods it costs wrong now?little-author-61621
mysterious-kitchen-14875
10/04/2022, 9:28 AMhelm upgrade --install infracost infracost/cloud-pricing-api -f ./deploy/operators/infracost.yaml --namespace infracost --create-namespace --set infracostAPIKey='$INFRACOST_API_KEY' --set postgresql.postgresqlPassword='$INFRACOST_POSTGRES' --version 0.5.10
api:
tolerations:
...
affinity:
...
job:
tolerations:
...
affinity:
...
little-author-61621
infracostAPIKey
and postgresql.postgresqlPassword
inputs should work, but if you’ve uninstalled you might need to delete the postgreSQL volume before you reinstall againmysterious-kitchen-14875
10/04/2022, 9:34 AMlittle-author-61621
mysterious-kitchen-14875
10/04/2022, 10:15 AMlittle-author-61621
mysterious-kitchen-14875
10/04/2022, 12:17 PMlittle-author-61621
postgresql.enabled="false"
for the Cloud Pricing API chart, along with the postgresql.external
parameters as per the example here: https://github.com/infracost/helm-charts/tree/master/charts/cloud-pricing-api#postgresql
For the bitnami chart it depends on what version you use. We pass through all the other postgresql.
variables to the bitnami chart, but I think the inputs have changed for newer versions looking at https://github.com/bitnami/charts/blob/master/bitnami/postgresql/README.mdmysterious-kitchen-14875
10/04/2022, 3:00 PM