Skip to content

Commit

Permalink
Make namespace of PrometheusRule configurable (#81)
Browse files Browse the repository at this point in the history
Signed-off-by: Prabhu Jayakumar <[email protected]>
  • Loading branch information
prabhu43 authored Oct 9, 2020
1 parent 60a835f commit 83b15fe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions charts/jenkins/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ Use the following links to reference issues, PRs, and commits prior to v2.6.0.

The change log until v1.5.7 was auto-generated based on git commits. Those entries include a reference to the git commit to be able to get more details.

## 2.9.0

Make namespace of PrometheusRule configurable

## 2.8.2

Bumped configuration-as-code plugin version from 1.41 to 1.43.
Expand Down
2 changes: 1 addition & 1 deletion charts/jenkins/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
apiVersion: v1
name: jenkins
home: https://jenkins.io/
version: 2.8.2
version: 2.9.0
appVersion: lts
description: Open source continuous integration server. It supports multiple SCM tools
including CVS, Subversion and Git. It can execute Apache Ant and Apache Maven-based
Expand Down
1 change: 1 addition & 0 deletions charts/jenkins/VALUES_SUMMARY.md
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ The following tables list the configurable parameters of the Jenkins chart and t
| `master.prometheus.scrapeEndpoint` | The endpoint prometheus should get metrics from | `/prometheus` |
| `master.prometheus.alertingrules` | Array of prometheus alerting rules | `[]` |
| `master.prometheus.alertingRulesAdditionalLabels` | Additional labels to add to the prometheus rule object | `{}` |
| `master.prometheus.prometheusRuleNamespace` | Custom namespace for PrometheusRule | `""` (same ns where Jenkins being deployed) |

#### HTTPS Keystore
| Parameter | Description | Default |
Expand Down
4 changes: 4 additions & 0 deletions charts/jenkins/templates/jenkins-master-alerting-rules.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ apiVersion: monitoring.coreos.com/v1
kind: PrometheusRule
metadata:
name: {{ template "jenkins.fullname" . }}
{{- if .Values.master.prometheus.prometheusRuleNamespace }}
namespace: {{ .Values.master.prometheus.prometheusRuleNamespace }}
{{- else }}
namespace: {{ template "jenkins.namespace" . }}
{{- end }}
labels:
"app.kubernetes.io/name": '{{ template "jenkins.name" .}}'
"helm.sh/chart": "{{ .Chart.Name }}-{{ .Chart.Version }}"
Expand Down
2 changes: 2 additions & 0 deletions charts/jenkins/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,8 @@ master:
# See here: https://prometheus.io/docs/prometheus/latest/configuration/alerting_rules/
# The `groups` root object is added by default, simply add the rule entries
alertingrules: []
# Set a custom namespace where to deploy PrometheusRule resource
prometheusRuleNamespace: ""

# Can be used to disable rendering master test resources when using helm template
testEnabled: true
Expand Down

0 comments on commit 83b15fe

Please sign in to comment.