Skip to content

Commit

Permalink
Merge branch 'main' into fix/priority-class
Browse files Browse the repository at this point in the history
  • Loading branch information
ritmas committed Nov 8, 2023
2 parents 8b90b48 + 78952f9 commit cad88b6
Show file tree
Hide file tree
Showing 27 changed files with 283 additions and 74 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/lint-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,17 @@ jobs:

- uses: actions/setup-python@v4
with:
python-version: 3.7
python-version: '3.7'

- name: Set up chart-testing
uses: helm/chart-testing-action@v2.4.0
uses: helm/chart-testing-action@v2.6.1

- name: Run chart-testing (list-changed)
id: list-changed
run: |
changed=$(ct list-changed --config .github/linters/ct.yaml)
changed="$(ct list-changed --config .github/linters/ct.yaml)"
if [[ -n "$changed" ]]; then
echo "changed=true" >> $GITHUB_OUTPUT
echo "changed=true" >> "$GITHUB_OUTPUT"
fi
# - name: install helm unittest plugin
Expand Down
2 changes: 1 addition & 1 deletion charts/jiralert/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v2
name: jiralert
description: A Helm chart for Kubernetes to install jiralert
type: application
version: 1.6.0
version: 1.6.1
appVersion: "v1.3.0"
home: "https://github.com/prometheus-community/jiralert"
keywords:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ config:
receivers:
- name: 'default'
project: EXAMPLE

ingress:
enabled: true
7 changes: 3 additions & 4 deletions charts/jiralert/templates/ingress.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
{{- if .Values.ingress.enabled -}}
{{- $fullName := include "jiralert.fullname" . -}}
{{- $svcPort := .Values.service.port -}}
{{- if and .Values.ingress.className (not (semverCompare ">=1.18-0" .Capabilities.KubeVersion.GitVersion)) }}
{{- if not (hasKey .Values.ingress.annotations "kubernetes.io/ingress.class") }}
{{- $_ := set .Values.ingress.annotations "kubernetes.io/ingress.class" .Values.ingress.className}}
{{- end }}
{{- end }}
apiVersion: {{template "jiralert.ingress.apiversion" . }}
apiVersion: {{ template "jiralert.ingress.apiversion" . }}
kind: Ingress
metadata:
name: {{ $fullName }}
Expand Down Expand Up @@ -49,10 +48,10 @@ spec:
service:
name: {{ $fullName }}
port:
number: {{ $svcPort }}
number: 9097
{{- else }}
serviceName: {{ $fullName }}
servicePort: {{ $svcPort }}
servicePort: 9097
{{- end }}
{{- end }}
{{- end }}
Expand Down
2 changes: 1 addition & 1 deletion charts/kube-prometheus-stack/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ name: kube-prometheus-stack
sources:
- https://github.com/prometheus-community/helm-charts
- https://github.com/prometheus-operator/kube-prometheus
version: 51.10.0
version: 52.1.0
appVersion: v0.68.0
kubeVersion: ">=1.19.0-0"
home: https://github.com/prometheus-operator/kube-prometheus
Expand Down
69 changes: 69 additions & 0 deletions charts/kube-prometheus-stack/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,75 @@ _See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documen

A major chart version change (like v1.2.3 -> v2.0.0) indicates that there is an incompatible breaking change needing manual actions.

### From 51.x to 52.x

This includes the ability to select between using existing secrets or create new secret objects for various thanos config. The defaults have not changed but if you were setting:

- `thanosRuler.thanosRulerSpec.alertmanagersConfig` or
- `thanosRuler.thanosRulerSpec.objectStorageConfig` or
- `thanosRuler.thanosRulerSpec.queryConfig` or
- `prometheus.prometheusSpec.thanos.objectStorageConfig`

you will have to need to set `existingSecret` or `secret` based on your requirement

For instance, the `thanosRuler.thanosRulerSpec.alertmanagersConfig` used to be configured as follow:

```yaml
thanosRuler:
thanosRulerSpec:
alertmanagersConfig:
alertmanagers:
- api_version: v2
http_config:
basic_auth:
username: some_user
password: some_pass
static_configs:
- alertmanager.thanos.io
scheme: http
timeout: 10s
```
But it now moved to:
```yaml
thanosRuler:
thanosRulerSpec:
alertmanagersConfig:
secret:
alertmanagers:
- api_version: v2
http_config:
basic_auth:
username: some_user
password: some_pass
static_configs:
- alertmanager.thanos.io
scheme: http
timeout: 10s
```
or the `thanosRuler.thanosRulerSpec.objectStorageConfig` used to be configured as follow:

```yaml
thanosRuler:
thanosRulerSpec:
objectStorageConfig:
name: existing-secret-not-created-by-this-chart
key: object-storage-configs.yaml
```

But it now moved to:

```yaml
thanosRuler:
thanosRulerSpec:
objectStorageConfig:
existingSecret:
name: existing-secret-not-created-by-this-chart
key: object-storage-configs.yaml
```

### From 50.x to 51.x

This version upgrades Prometheus-Operator to v0.68.0, Prometheus to 2.47.0 and Thanos to v0.32.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ spec:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecureSkipVerify: true
bearerTokenFile: /var/run/secrets/kubernetes.io/serviceaccount/token
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
{{- if .Values.kubelet.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.kubelet.serviceMonitor.metricRelabelings | indent 4) . }}
Expand All @@ -55,7 +56,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecureSkipVerify: true
Expand All @@ -82,7 +84,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecureSkipVerify: true
Expand All @@ -109,7 +112,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
tlsConfig:
caFile: /var/run/secrets/kubernetes.io/serviceaccount/ca.crt
insecureSkipVerify: true
Expand All @@ -134,7 +138,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
{{- if .Values.kubelet.serviceMonitor.metricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.kubelet.serviceMonitor.metricRelabelings | indent 4) . }}
Expand All @@ -155,7 +160,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
{{- if .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.kubelet.serviceMonitor.cAdvisorMetricRelabelings | indent 4) . }}
Expand All @@ -176,7 +182,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
{{- if .Values.kubelet.serviceMonitor.probesMetricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.kubelet.serviceMonitor.probesMetricRelabelings | indent 4) . }}
Expand All @@ -198,7 +205,8 @@ spec:
{{- if .Values.kubelet.serviceMonitor.scrapeTimeout }}
scrapeTimeout: {{ .Values.kubelet.serviceMonitor.scrapeTimeout }}
{{- end }}
honorLabels: true
honorLabels: {{ .Values.kubelet.serviceMonitor.honorLabels }}
honorTimestamps: {{ .Values.kubelet.serviceMonitor.honorTimestamps }}
{{- if .Values.kubelet.serviceMonitor.resourceMetricRelabelings }}
metricRelabelings:
{{ tpl (toYaml .Values.kubelet.serviceMonitor.resourceMetricRelabelings | indent 4) . }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,18 @@ spec:
{{- if not .Values.prometheus.agentMode }}
{{- if .Values.prometheus.prometheusSpec.thanos }}
thanos:
{{ toYaml .Values.prometheus.prometheusSpec.thanos | indent 4 }}
{{- with (omit .Values.prometheus.prometheusSpec.thanos "objectStorageConfig")}}
{{ toYaml . | indent 4 }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret }}
objectStorageConfig:
key: "{{.Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret.key }}"
name: "{{.Values.prometheus.prometheusSpec.thanos.objectStorageConfig.existingSecret.name }}"
{{- else if .Values.prometheus.prometheusSpec.thanos.objectStorageConfig.secret}}
objectStorageConfig:
key: object-storage-configs.yaml
name: {{ template "kube-prometheus-stack.fullname" . }}-prometheus
{{- end }}
{{- end }}
{{- if .Values.prometheus.prometheusSpec.disableCompaction }}
disableCompaction: {{ .Values.prometheus.prometheusSpec.disableCompaction }}
Expand Down
17 changes: 17 additions & 0 deletions charts/kube-prometheus-stack/templates/prometheus/secret.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{{- if .Values.prometheus.enabled }}
apiVersion: v1
kind: Secret
metadata:
name: {{ template "kube-prometheus-stack.fullname" . }}-prometheus
namespace: {{ template "kube-prometheus-stack.namespace" . }}
labels:
app: {{ template "kube-prometheus-stack.name" . }}-prometheus
app.kubernetes.io/component: prometheus
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
data:
{{- with .Values.prometheus.prometheusSpec.thanos.objectStorageConfig }}
{{- if and .secret (not .existingSecret) }}
object-storage-configs.yaml: {{ toYaml .secret | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
24 changes: 17 additions & 7 deletions charts/kube-prometheus-stack/templates/thanos-ruler/ruler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,11 @@ spec:
alertmanagersUrl:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersUrl | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }}
{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.existingSecret }}
alertmanagersConfig:
key: "{{.Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.existingSecret.key }}"
name: "{{.Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.existingSecret.name }}"
{{- else if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig.secret }}
alertmanagersConfig:
key: alertmanager-configs.yaml
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
Expand All @@ -80,9 +84,14 @@ spec:
queryEndpoints:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.queryEndpoints | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.queryConfig }}
{{- if .Values.thanosRuler.thanosRulerSpec.queryConfig.existingSecret }}
queryConfig:
key: "{{.Values.thanosRuler.thanosRulerSpec.queryConfig.existingSecret.key }}"
name: "{{.Values.thanosRuler.thanosRulerSpec.queryConfig.existingSecret.name }}"
{{- else if .Values.thanosRuler.thanosRulerSpec.queryConfig.secret }}
queryConfig:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.queryConfig | indent 4 }}
key: query-configs.yaml
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.resources }}
resources:
Expand All @@ -99,7 +108,11 @@ spec:
storage:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.storage | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig }}
{{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig.existingSecret }}
objectStorageConfig:
key: "{{.Values.thanosRuler.thanosRulerSpec.objectStorageConfig.existingSecret.key }}"
name: "{{.Values.thanosRuler.thanosRulerSpec.objectStorageConfig.existingSecret.name }}"
{{- else if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig.secret }}
objectStorageConfig:
key: object-storage-configs.yaml
name: {{ template "kube-prometheus-stack.thanosRuler.name" . }}
Expand All @@ -108,9 +121,6 @@ spec:
labels:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.labels | indent 4 }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfigFile }}
objectStorageConfigFile: {{ .Values.thanosRuler.thanosRulerSpec.objectStorageConfigFile }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.podMetadata }}
podMetadata:
{{ toYaml .Values.thanosRuler.thanosRulerSpec.podMetadata | indent 4 }}
Expand Down
21 changes: 15 additions & 6 deletions charts/kube-prometheus-stack/templates/thanos-ruler/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,19 @@ metadata:
app: {{ include "kube-prometheus-stack.thanosRuler.name" . }}
{{ include "kube-prometheus-stack.labels" . | indent 4 }}
data:
{{- if .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }}
alertmanager-configs.yaml: {{ toYaml .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig | b64enc | quote }}
{{- end }}
{{- if .Values.thanosRuler.thanosRulerSpec.objectStorageConfig }}
object-storage-configs.yaml: {{ toYaml .Values.thanosRuler.thanosRulerSpec.objectStorageConfig | b64enc | quote }}
{{- end }}
{{- with .Values.thanosRuler.thanosRulerSpec.alertmanagersConfig }}
{{- if and .secret (not .existingSecret) }}
alertmanager-configs.yaml: {{ toYaml .secret | b64enc | quote }}
{{- end }}
{{- end }}
{{- with .Values.thanosRuler.thanosRulerSpec.objectStorageConfig }}
{{- if and .secret (not .existingSecret) }}
object-storage-configs.yaml: {{ toYaml .secret | b64enc | quote }}
{{- end }}
{{- end }}
{{- with .Values.thanosRuler.thanosRulerSpec.queryConfig }}
{{- if and .secret (not .existingSecret) }}
query-configs.yaml: {{ toYaml .secret | b64enc | quote }}
{{- end }}
{{- end }}
{{- end }}
Loading

0 comments on commit cad88b6

Please sign in to comment.