From bc339e024643530d31848bb552ffa63970fe231c Mon Sep 17 00:00:00 2001 From: Sean Holcomb Date: Wed, 25 Oct 2023 13:59:20 -0700 Subject: [PATCH 1/3] first pass --- charts/opencost/templates/deployment.yaml | 28 +++++++++++++++++++++-- charts/opencost/values.yaml | 15 ++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/charts/opencost/templates/deployment.yaml b/charts/opencost/templates/deployment.yaml index 006af57..0675808 100644 --- a/charts/opencost/templates/deployment.yaml +++ b/charts/opencost/templates/deployment.yaml @@ -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 @@ -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 }} @@ -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 @@ -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 }} diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index b78342b..71e2788 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -166,6 +166,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: From 9b1aef40a6a13565f20f43f91a18e3ba3b23c21a Mon Sep 17 00:00:00 2001 From: Sean Holcomb Date: Wed, 25 Oct 2023 13:59:20 -0700 Subject: [PATCH 2/3] first pass --- charts/opencost/templates/deployment.yaml | 28 +++++++++++++++++++++-- charts/opencost/values.yaml | 15 ++++++++++++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/charts/opencost/templates/deployment.yaml b/charts/opencost/templates/deployment.yaml index 006af57..0675808 100644 --- a/charts/opencost/templates/deployment.yaml +++ b/charts/opencost/templates/deployment.yaml @@ -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 @@ -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 }} @@ -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 @@ -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 }} diff --git a/charts/opencost/values.yaml b/charts/opencost/values.yaml index 4b02c35..159eaec 100644 --- a/charts/opencost/values.yaml +++ b/charts/opencost/values.yaml @@ -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: From e8b4fa3dd0c881a224a04c25796a7214ae9b01de Mon Sep 17 00:00:00 2001 From: Matt Ray Date: Tue, 31 Oct 2023 09:40:54 +1100 Subject: [PATCH 3/3] Chart version bump Signed-off-by: Matt Ray --- charts/opencost/Chart.yaml | 2 +- charts/opencost/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/charts/opencost/Chart.yaml b/charts/opencost/Chart.yaml index 848ae50..b7dd400 100755 --- a/charts/opencost/Chart.yaml +++ b/charts/opencost/Chart.yaml @@ -9,7 +9,7 @@ keywords: - kubecost - opencost - monitoring -version: 1.22.3 +version: 1.23.0 maintainers: - name: mattray url: https://mattray.dev diff --git a/charts/opencost/README.md b/charts/opencost/README.md index a291744..ccec730 100644 --- a/charts/opencost/README.md +++ b/charts/opencost/README.md @@ -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)