Skip to content

Commit

Permalink
feat: added serviceMonitor prometheusCRD dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
Grzegorz Gniadek committed Aug 21, 2024
1 parent d13f42f commit 5b07fda
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 3 deletions.
13 changes: 13 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ kubectl apply -f /tmp/interpolator.yaml --namespace interpolator-system
You can see the full list of parameters (along with their meaning and default values) in the chart's [values.yaml](https://github.com/grzegorzgniadek/interpolator-operator/blob/master/charts/interpolator/values.yaml) file.


#### Customize resources

```bash
helm upgrade --install \
--create-namespace --namespace interpolator-system \
Expand All @@ -64,6 +66,17 @@ helm upgrade --install \
--set controllerManager.manager.resources.limits.cpu=200m
```

#### Turn on Prometheus Service Monitor(Metrics)

```bash
helm install \
--create-namespace --namespace interpolator-system \
interpolator . \
--set prometheusCRDS.enabled=true \
--set prometheusMonitor.enabled=true \
--set prometheusMonitor.interval=15s
```

## Use sample resource
```bash
kubectl apply -f https://raw.githubusercontent.com/grzegorzgniadek/interpolator-operator/master/config/samples/inter_v1_interpolator.yaml
Expand Down
6 changes: 6 additions & 0 deletions charts/interpolator/Chart.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
dependencies:
- name: prometheus-operator-crds
repository: https://prometheus-community.github.io/helm-charts
version: 14.0.0
digest: sha256:a5bb39969b061f10b1c6d2669a7ebc9f9b4daeb7389d4e1721ab93c8e2bd972a
generated: "2024-08-21T23:39:33.415230523+02:00"
7 changes: 6 additions & 1 deletion charts/interpolator/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,14 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.6.0
version: 0.6.1
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.6.0"
dependencies:
- name: prometheus-operator-crds
version: "14.0.*"
repository: "https://prometheus-community.github.io/helm-charts"
condition: prometheusCRDS.enabled
9 changes: 7 additions & 2 deletions charts/interpolator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@



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

Interpolator Helm Chart

Expand All @@ -12,7 +12,11 @@ Interpolator Helm Chart




## Requirements

| Repository | Name | Version |
|------------|------|---------|
| https://prometheus-community.github.io/helm-charts | prometheus-operator-crds | 14.0.* |

## Values

Expand All @@ -39,5 +43,6 @@ Interpolator Helm Chart
| metricsService.ports[0].protocol | string | `"TCP"` | |
| metricsService.ports[0].targetPort | int | `8080` | |
| metricsService.type | string | `"ClusterIP"` | |
| prometheusCRDS.enabled | bool | `false` | |
| prometheusMonitor.enabled | bool | `false` | |
| prometheusMonitor.interval | string | `"15s"` | |
Binary file not shown.
4 changes: 4 additions & 0 deletions charts/interpolator/templates/metrics-monitor.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ metadata:
name: {{ include "interpolator.fullname" . }}-metrics-monitor
labels:
{{- include "interpolator.labels" . | nindent 4 }}
annotations:
{{- if .Values.prometheusCRDS.enabled }}
"helm.sh/hook": post-install
{{- end }}
spec:
endpoints:
- interval: {{ .Values.prometheusMonitor.interval }}
Expand Down
2 changes: 2 additions & 0 deletions charts/interpolator/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ metricsService:
protocol: TCP
targetPort: 8080
type: ClusterIP
prometheusCRDS:
enabled: false
prometheusMonitor:
enabled: false
interval: 15s

0 comments on commit 5b07fda

Please sign in to comment.