Skip to content

Commit

Permalink
Merge pull request #136 from Sean-Holcomb/sean/cloud-cost
Browse files Browse the repository at this point in the history
Add CloudCost values
  • Loading branch information
teevans authored Oct 31, 2023
2 parents 2286bc5 + 73ea46f commit 2494e5b
Show file tree
Hide file tree
Showing 4 changed files with 43 additions and 4 deletions.
2 changes: 1 addition & 1 deletion charts/opencost/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ keywords:
- kubecost
- opencost
- monitoring
version: 1.22.3
version: 1.23.0
maintainers:
- name: mattray
url: https://mattray.dev
Expand Down
2 changes: 1 addition & 1 deletion charts/opencost/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

OpenCost and OpenCost UI

![Version: 1.22.3](https://img.shields.io/badge/Version-1.22.3-informational?style=flat-square)
![Version: 1.23.0](https://img.shields.io/badge/Version-1.23.0-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![AppVersion: 1.106.4](https://img.shields.io/badge/AppVersion-1.106.4-informational?style=flat-square)

Expand Down
28 changes: 26 additions & 2 deletions charts/opencost/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,12 +150,24 @@ spec:
- name: CONFIG_PATH
value: {{ .Values.opencost.customPricing.configPath | quote }}
{{- end }}
- name: DATA_RETENTION_DAILY_RESOLUTION_DAYS
value: {{ .Values.opencost.dataRetention.dailyResolutionDays | quote }}
- name: CLOUD_COST_ENABLED
value: {{ .Values.opencost.cloudCost.enabled | quote }}
- name: CLOUD_COST_MONTH_TO_DATE_INTERVAL
value: {{ .Values.opencost.cloudCost.monthToDateInterval | quote }}
- name: CLOUD_COST_REFRESH_RATE_HOURS
value: {{ .Values.opencost.cloudCost.refreshRateHours | quote }}
- name: CLOUD_COST_QUERY_WINDOW_DAYS
value: {{ .Values.opencost.cloudCost.queryWindowDays | quote }}
- name: CLOUD_COST_RUN_WINDOW_DAYS
value: {{ .Values.opencost.cloudCost.runWindowDays | quote }}
# Add any additional provided variables
{{- range $key, $value := .Values.opencost.exporter.extraEnv }}
- name: {{ $key }}
value: {{ $value | quote }}
{{- end }}
{{- if or .Values.opencost.exporter.persistence.enabled .Values.opencost.exporter.extraVolumeMounts .Values.opencost.customPricing.enabled}}
{{- if or .Values.opencost.exporter.persistence.enabled .Values.opencost.exporter.extraVolumeMounts .Values.opencost.customPricing.enabled .Values.opencost.cloudIntegrationSecret}}
volumeMounts:
{{- if .Values.opencost.exporter.persistence.enabled }}
- mountPath: /mnt/export
Expand All @@ -167,6 +179,10 @@ spec:
name: custom-configs
readOnly: true
{{- end }}
{{- if .Values.opencost.cloudIntegrationSecret }}
- name: cloud-integration
mountPath: /var/configs/cloud-integration
{{- end }}
{{- with .Values.opencost.exporter.extraVolumeMounts }}
{{- toYaml . | nindent 12 }}
{{- end }}
Expand Down Expand Up @@ -240,7 +256,7 @@ spec:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- end }}
{{- if or .Values.opencost.exporter.persistence.enabled .Values.extraVolumes .Values.opencost.customPricing.enabled}}
{{- if or .Values.opencost.exporter.persistence.enabled .Values.extraVolumes .Values.opencost.customPricing.enabled .Values.opencost.cloudIntegrationSecret}}
volumes:
{{- if .Values.opencost.customPricing.enabled }}
- name: custom-configs
Expand All @@ -252,6 +268,14 @@ spec:
persistentVolumeClaim:
claimName: {{ include "opencost.fullname" . }}-pvc
{{- end }}
{{- if .Values.opencost.cloudIntegrationSecret }}
- name: cloud-integration
secret:
secretName: {{ .Values.opencost.cloudIntegrationSecret }}
items:
- key: cloud-integration.json
path: cloud-integration.json
{{- end }}
{{- with .Values.extraVolumes }}
{{- toYaml . | nindent 8 }}
{{- end }}
Expand Down
15 changes: 15 additions & 0 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,21 @@ opencost:
regionNetworkEgress: 0.01
internetNetworkEgress: 0.12

dataRetention:
dailyResolutionDays: 15

cloudCost:
# -- Enable cloud cost ingestion and querying, dependant on valid integration credentials
enabled: false
# -- Number of hours between each run of the Cloud Cost pipeline
refreshRateHours: 6
# -- Number of days into the past that a Cloud Cost standard run will query for
runWindowDays: 3
# -- The number of standard runs before a Month-to-Date run occurs
monthToDateInterval: 6
# -- The max number of days that any single query will be made to construct Cloud Costs
queryWindowDays: 7


metrics:
serviceMonitor:
Expand Down

0 comments on commit 2494e5b

Please sign in to comment.