Skip to content

Commit

Permalink
Add tlsconfig servicemonitor (#130)
Browse files Browse the repository at this point in the history
* Added tlsConfig to service monitor

* Default values

* Update README

---------

Co-authored-by: guicholeo <[email protected]>
  • Loading branch information
mattray and guicholeo authored Oct 19, 2023
1 parent e25278d commit 59c2897
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 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.21.3
version: 1.21.4
maintainers:
- name: mattray
url: https://mattray.dev
Expand Down
5 changes: 4 additions & 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.21.3](https://img.shields.io/badge/Version-1.21.3-informational?style=flat-square)
![Version: 1.21.4](https://img.shields.io/badge/Version-1.21.4-informational?style=flat-square)
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
![AppVersion: 1.106.3](https://img.shields.io/badge/AppVersion-1.106.3-informational?style=flat-square)

Expand Down Expand Up @@ -71,7 +71,10 @@ $ helm install opencost opencost/opencost
| opencost.metrics.serviceMonitor.metricRelabelings | list | `[]` | MetricRelabelConfigs to apply to samples before ingestion |
| opencost.metrics.serviceMonitor.namespace | string | `""` | Specify if the ServiceMonitor will be deployed into a different namespace (blank deploys into same namespace as chart) |
| opencost.metrics.serviceMonitor.relabelings | list | `[]` | RelabelConfigs to apply to samples before scraping. Prometheus Operator automatically adds relabelings for a few standard Kubernetes fields |
| opencost.metrics.serviceMonitor.scheme | string | `"http"` | HTTP scheme used for scraping. Defaults to `http` |
| opencost.metrics.serviceMonitor.scrapeInterval | string | `"30s"` | Interval at which metrics should be scraped |
| opencost.metrics.serviceMonitor.scrapeTimeout | string | `"10s"` | Timeout after which the scrape is ended |
| opencost.metrics.serviceMonitor.tlsConfig | object | `{}` | TLS configuration for scraping metrics |
| opencost.nodeSelector | object | `{}` | Node labels for pod assignment |
| opencost.prometheus.bearer_token | string | `""` | Prometheus Bearer token |
| opencost.prometheus.bearer_token_key | string | `"DB_BEARER_TOKEN"` | |
Expand Down
6 changes: 5 additions & 1 deletion charts/opencost/templates/servicemonitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ metadata:
spec:
endpoints:
- port: http
scheme: http
scheme: {{ .Values.opencost.metrics.serviceMonitor.scheme }}
path: /metrics
interval: {{ .Values.opencost.metrics.serviceMonitor.scrapeInterval }}
scrapeTimeout: {{ .Values.opencost.metrics.serviceMonitor.scrapeTimeout }}
Expand All @@ -30,6 +30,10 @@ spec:
{{- with .Values.opencost.metrics.serviceMonitor.extraEndpoints }}
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .Values.opencost.metrics.serviceMonitor.tlsConfig }}
tlsConfig:
{{- toYaml . | nindent 8}}
{{- end }}
selector:
matchLabels: {{- include "opencost.selectorLabels" . | nindent 6 }}
namespaceSelector:
Expand Down
8 changes: 8 additions & 0 deletions charts/opencost/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,14 @@ opencost:
extraEndpoints: []
# - port: oauth-metrics
# path: /metrics
# -- HTTP scheme used for scraping. Defaults to `http`
scheme: http
# -- TLS configuration for scraping metrics
tlsConfig: {}
# caFile: /etc/prom-certs/root-cert.pem
# certFile: /etc/prom-certs/cert-chain.pem
# insecureSkipVerify: true
# keyFile: /etc/prom-certs/key.pem

prometheus:
# -- Secret name that contains credentials for Prometheus
Expand Down

0 comments on commit 59c2897

Please sign in to comment.