Skip to content

Commit

Permalink
feat: add ability to set KSM settings via helm chart values (#182)
Browse files Browse the repository at this point in the history
  • Loading branch information
asdfgugus authored Mar 15, 2024
1 parent a2b2992 commit 5046f8f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
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:
- finops
- monitoring
- opencost
version: 1.31.0
version: 1.32.0
maintainers:
- name: mattray
- name: toscott
Expand Down
16 changes: 16 additions & 0 deletions charts/opencost/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,22 @@ spec:
value: {{ .Values.opencost.cloudCost.queryWindowDays | quote }}
- name: CLOUD_COST_RUN_WINDOW_DAYS
value: {{ .Values.opencost.cloudCost.runWindowDays | quote }}
{{- if .Values.opencost.metrics.kubeStateMetrics.emitPodAnnotations }}
- name: EMIT_POD_ANNOTATIONS_METRIC
value: {{ ( .Values.opencost.metrics.kubeStateMetrics.emitPodAnnotations) | quote }}
{{- end }}
{{- if .Values.opencost.metrics.kubeStateMetrics.emitNamespaceAnnotations }}
- name: EMIT_NAMESPACE_ANNOTATIONS_METRIC
value: {{ ( .Values.opencost.metrics.kubeStateMetrics.emitNamespaceAnnotations) | quote}}
{{- end }}
{{- if .Values.opencost.metrics.kubeStateMetrics.emitKsmV1Metrics }}
- name: EMIT_KSM_V1_METRICS
value: {{ ( .Values.opencost.metrics.kubeStateMetrics.emitKsmV1Metrics) | quote }}
{{- end }}
{{- if .Values.opencost.metrics.kubeStateMetrics.emitKsmV1MetricsOnly }}
- name: EMIT_KSM_V1_METRICS_ONLY
value: {{ ( .Values.opencost.metrics.kubeStateMetrics.emitKsmV1MetricsOnly) | quote }}
{{- end }}
# Add any additional provided variables
{{- range $key, $value := .Values.opencost.exporter.extraEnv }}
- name: {{ $key }}
Expand Down
10 changes: 10 additions & 0 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,16 @@ opencost:


metrics:
kubeStateMetrics:
# -- Enable emission of pod annotations
emitPodAnnotations: ""
# -- Enable emission of namespace annotations
emitNamespaceAnnotations: ""
# -- Enable emission of KSM v1 metrics
emitKsmV1Metrics: ""
# -- Enable only emission of KSM v1 metrics that do not exist in KSM 2 by default
emitKsmV1MetricsOnly: ""

serviceMonitor:
# -- Create ServiceMonitor resource for scraping metrics using PrometheusOperator
enabled: false
Expand Down

0 comments on commit 5046f8f

Please sign in to comment.