Skip to content

Create Empty /var/configs dir#333

Open
HMetcalfeW wants to merge 3 commits intoopencost:mainfrom
HMetcalfeW:fix-cloud-cost-storage
Open

Create Empty /var/configs dir#333
HMetcalfeW wants to merge 3 commits intoopencost:mainfrom
HMetcalfeW:fix-cloud-cost-storage

Conversation

@HMetcalfeW
Copy link

@HMetcalfeW HMetcalfeW commented Feb 4, 2026

Description

Issue identified when testing the addition of GZIP Azure billing exports. The default option is to download exports to file vs. streaming them.

Also fixed two minor issues where empty manifests are generated because the --- break between manifests wasn't included within the if blocks.

Example error

ERR CloudCost[37be364a-7abe-43b0-8733-187289efe4e3/all-data-export/kubecost/hunter-zip-test-amortized-cost]: ingestor: build failed for window [2026-01-20T00:00:00+0000, 2026-01-21T00:00:00+0000): CloudCost: Azure: DownloadBlobToFile: failed to create directory mkdir /var/configs/db: permission denied

Related Issues

Relates to opencost/opencost#3572

User Impact

Without the env variable AZURE_DOWNLOAD_BILLING_DATA_TO_DISK set to false, cloud-costs will not work.

opencost:
env:
- name: AZURE_DOWNLOAD_BILLING_DATA_TO_DISK
value: "false"

Testing

See testing steps as part of: opencost/opencost#3572

Tested with these Helm values

opencost:
  # Cloud integration secret containing cloud-integration.json
  cloudIntegrationSecret: "cloud-integration"
  cloudCost:
    enabled: true
  
  exporter:
    image:
      registry: docker.io
      repository: huntermetcalfe/opencost
      tag: latest
      pullPolicy: Always/export"
    
    # Default cluster ID
    defaultClusterId: "azure-test-cluster"

Current develop branch with values above

helm upgrade --install opencost opencost-charts/opencost \
    --namespace opencost \
    --values values-azure.yaml
image

Deployed with modified Helm Chart

helm upgrade --install opencost ~/projects/HMetcalfe/opencost-helm-chart/charts/opencost \
    --namespace opencost \
    --values values-azure.yaml
image image

Signed-off-by: HMetcalfeW <106991365+HMetcalfeW@users.noreply.github.com>
@HMetcalfeW HMetcalfeW changed the title create /var/configs to fix cloud-cost bug Create Empty /var/configs dir Feb 4, 2026
@HMetcalfeW HMetcalfeW marked this pull request as ready for review February 4, 2026 01:44
Copilot AI review requested due to automatic review settings February 4, 2026 01:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses permission issues when downloading Azure billing exports to disk by creating an empty /var/configs directory mount. It also fixes a Helm template bug where empty manifest separators were being generated when certain features were disabled.

Changes:

  • Added emptyDir volume mount for /var/configs directory to fix permission denied errors when downloading Azure billing data
  • Fixed manifest separator placement in ingress and httproute templates to prevent empty manifest generation

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
charts/opencost/templates/deployment.yaml Added var-configs emptyDir volume and mount to create the /var/configs directory before mounting cloud integration files
charts/opencost/templates/ingress.yaml Moved --- manifest separators inside conditional blocks to prevent empty manifest output when features are disabled
charts/opencost/templates/httproute.yaml Moved --- manifest separators inside conditional blocks to prevent empty manifest output when features are disabled

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@ameijer ameijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bump the chart version please

Copy link
Member

@ameijer ameijer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@HMetcalfeW looks good to us, can you bump chart version?

@ameijer
Copy link
Member

ameijer commented Mar 5, 2026

@HMetcalfeW can you bump the chart? then ping ishaan and we will get this merged!

Signed-off-by: Hunter <106991365+HMetcalfeW@users.noreply.github.com>
Signed-off-by: HMetcalfeW <106991365+HMetcalfeW@users.noreply.github.com>
Copilot AI review requested due to automatic review settings March 13, 2026 14:06
@HMetcalfeW
Copy link
Author

HMetcalfeW commented Mar 13, 2026

@ameijer, I've fixed the merge conflicts and have bumped the Helm Chart version

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@@ -40,8 +40,8 @@ spec:
port: {{ default $.Values.opencost.ui.uiPort .port }}
{{- end }}
{{- end }}
Comment on lines 365 to 370
{{- if $cloudIntegrationSecretName }}
- name: var-configs
mountPath: /var/configs
- name: cloud-integration
mountPath: /var/configs/cloud-integration.json
subPath: cloud-integration.json
{{- end }}
{{- if $cloudIntegrationSecretName }}
- name: var-configs
emptyDir: {}
Comment on lines 40 to +41
---
{{- end }}
@HMetcalfeW HMetcalfeW requested a review from ameijer March 13, 2026 14:13
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

Successfully merging this pull request may close these issues.

3 participants