File tree Expand file tree Collapse file tree 4 files changed +44
-2
lines changed
Expand file tree Collapse file tree 4 files changed +44
-2
lines changed Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ keywords:
99 - kubecost
1010 - opencost
1111 - monitoring
12- version : 1.18.1
12+ version : 1.19.0
1313maintainers :
1414 - name : mattray
1515 url : https://mattray.dev
Original file line number Diff line number Diff line change @@ -92,11 +92,27 @@ Create the name of the controller service account to use
9292{ {- end -} }
9393
9494
95+ { {- define " opencost.thanosServerEndpoint" -} }
96+ { {- if .Values.opencost.prometheus.thanos.external.enabled -} }
97+ { { .Values.opencost.prometheus.thanos.external.url } }
98+ { {- else -} }
99+ { {- $host := .Values.opencost.prometheus.thanos.internal.serviceName } }
100+ { {- $ns := .Values.opencost.prometheus.thanos.internal.namespaceName } }
101+ { {- $port := .Values.opencost.prometheus.thanos.internal.port | int } }
102+ { {- printf " http://%s.%s.svc:%d" $host $ns $port -} }
103+ { {- end -} }
104+ { {- end -} }
105+
95106{ {/*
96107Check that either prometheus external or internal is defined
97108*/} }
98109{ {- define " isPrometheusConfigValid" -} }
99110 { {- if and .Values.opencost.prometheus.external.enabled .Values.opencost.prometheus.internal.enabled -} }
100111 { {- fail " Only use one of the prometheus setups, internal or external" -} }
101112 { {- end -} }
113+ { {- if .Values.opencost.prometheus.thanos.enabled -} }
114+ { {- if and .Values.opencost.prometheus.thanos.external.enabled .Values.opencost.prometheus.thanos.internal.enabled -} }
115+ { {- fail " Only use one of the thanos setups, internal or external" -} }
116+ { {- end -} }
117+ { {- end -} }
102118{ {- end -} }
Original file line number Diff line number Diff line change @@ -125,7 +125,21 @@ spec:
125125 {{- if and .Values.opencost.exporter.persistence.enabled .Values.opencost.exporter.csv_path }}
126126 - name : EXPORT_CSV_FILE
127127 value : {{ .Values.opencost.exporter.csv_path | quote }}
128- {{- end}}
128+ {{- end }}
129+ {{- if .Values.opencost.prometheus.thanos.enabled }}
130+ - name : THANOS_ENABLED
131+ value : ' true'
132+ - name : THANOS_QUERY_URL
133+ value : {{ include "opencost.thanosServerEndpoint" . | quote }}
134+ {{- end }}
135+ {{- if .Values.opencost.prometheus.thanos.queryOffset }}
136+ - name : THANOS_QUERY_OFFSET
137+ value : {{ .Values.opencost.prometheus.thanos.queryOffset | quote }}
138+ {{- end }}
139+ {{- if .Values.opencost.prometheus.thanos.maxSourceResolution }}
140+ - name : THANOS_MAX_SOURCE_RESOLUTION
141+ value : {{ .Values.opencost.prometheus.thanos.maxSourceResolution | quote }}
142+ {{- end }}
129143 {{- with .Values.opencost.exporter.env }}
130144 {{- toYaml . | nindent 12 }}
131145 {{- end }}
Original file line number Diff line number Diff line change @@ -170,6 +170,18 @@ opencost:
170170 namespaceName : opencost
171171 # -- Service port of in-cluster Prometheus
172172 port : 9090
173+ thanos :
174+ enabled : false
175+ queryOffset : ' '
176+ maxSourceResolution : ' '
177+ internal :
178+ enabled : true
179+ serviceName : my-thanos-query
180+ namespaceName : opencost
181+ port : 10901
182+ external :
183+ enabled : false
184+ url : ' https://thanos-query.example.com/thanos'
173185
174186 ui :
175187 # -- Enable OpenCost UI
You can’t perform that action at this time.
0 commit comments