Skip to content

Commit 45b2276

Browse files
charts,salt: Bump prometheus-adapter chart to 5.3.0
Notable changes: - Remove deprecated PodSecurityPolicy support - Use policy/v1 for PodDisruptionBudget (requires Kubernetes >= 1.21) - Add revisionHistoryLimit and unhealthyPodEvictionPolicy options Image version unchanged (v0.12.0). SLS chart updated with ./doit.sh codegen Closes: MK8S-104
1 parent ff83f83 commit 45b2276

File tree

9 files changed

+65
-123
lines changed

9 files changed

+65
-123
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
- Bump solution-operator-lib Go version to 1.24
3737
(PR[#4817](https://github.com/scality/metalk8s/pull/4817))
3838

39+
- Bump prometheus-adapter chart version to [5.3.0](https://github.com/prometheus-community/helm-charts/releases/tag/prometheus-adapter-5.3.0)
40+
(PR[#4825](https://github.com/scality/metalk8s/pull/4825))
41+
3942
### Bug Fixes
4043

4144
- Fix a bug where part of the upgrade process would silently be skipped

charts/prometheus-adapter/Chart.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ apiVersion: v1
22
appVersion: v0.12.0
33
description: A Helm chart for k8s prometheus adapter
44
home: https://github.com/kubernetes-sigs/prometheus-adapter
5+
icon: https://raw.githubusercontent.com/cncf/artwork/master/prometheus/icon/color/prometheus-icon-color.svg
56
keywords:
67
- hpa
78
- metrics
@@ -20,4 +21,4 @@ name: prometheus-adapter
2021
sources:
2122
- https://github.com/kubernetes/charts
2223
- https://github.com/kubernetes-sigs/prometheus-adapter
23-
version: 4.14.1
24+
version: 5.3.0

charts/prometheus-adapter/README.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,28 @@ Installs the [Prometheus Adapter](https://github.com/kubernetes-sigs/prometheus-
44

55
## Prerequisites
66

7-
Kubernetes 1.14+
7+
Kubernetes 1.21+
88

9-
## Get Helm Repositories Info
9+
## Usage
1010

11-
```console
12-
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
13-
helm repo update
14-
```
11+
The chart is distributed as an [OCI Artifact](https://helm.sh/docs/topics/registries/) as well as via a traditional [Helm Repository](https://helm.sh/docs/topics/chart_repository/).
12+
13+
- OCI Artifact: `oci://ghcr.io/prometheus-community/charts/prometheus-adapter`
14+
- Helm Repository: `https://prometheus-community.github.io/helm-charts` with chart `prometheus-adapter`
1515

16-
_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._
16+
The installation instructions use the OCI registry. Refer to the [`helm repo`]([`helm repo`](https://helm.sh/docs/helm/helm_repo/)) command documentation for information on installing charts via the traditional repository.
1717

18-
## Install Helm Chart
18+
### Install Helm Chart
1919

2020
```console
21-
helm install [RELEASE_NAME] prometheus-community/prometheus-adapter
21+
helm install [RELEASE_NAME] oci://ghcr.io/prometheus-community/charts/prometheus-adapter
2222
```
2323

2424
_See [configuration](#configuration) below._
2525

2626
_See [helm install](https://helm.sh/docs/helm/helm_install/) for command documentation._
2727

28-
## Uninstall Helm Chart
28+
### Uninstall Helm Chart
2929

3030
```console
3131
helm uninstall [RELEASE_NAME]
@@ -35,23 +35,27 @@ This removes all the Kubernetes components associated with the chart and deletes
3535

3636
_See [helm uninstall](https://helm.sh/docs/helm/helm_uninstall/) for command documentation._
3737

38-
## Upgrading Helm Chart
38+
### Upgrading Helm Chart
3939

4040
```console
4141
helm upgrade [RELEASE_NAME] [CHART] --install
4242
```
4343

4444
_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
4545

46-
### To 4.2.0
46+
### To 5.0.0
47+
48+
This version removes support for the deprecated Kubernetes API `policy/v1beta1` for PodDisruptionBudgets. It also removes the deprecated `PodSecurityPolicy` resource. Minimum Kubernetes version >= 1.21 is now required.
49+
50+
#### To 4.2.0
4751

4852
Readiness and liveness probes are now fully configurable through values `readinessProbe` and `livenessProbe`. The previous values have been kept as defaults.
4953

50-
### To 4.0.0
54+
#### To 4.0.0
5155

5256
Previously, security context of the container was set directly in the deployment template. This release makes it configurable through the new configuration variable `securityContext` whilst keeping the previously set values as defaults. Furthermore, previous variable `runAsUser` is now set in `securityContext` and is not used any longer. Please, use `securityContext.runAsUser` instead. In the same security context, `seccompProfile` has been enabled and set to type `RuntimeDefault`.
5357

54-
### To 3.0.0
58+
#### To 3.0.0
5559

5660
Due to a change in deployment labels, the upgrade requires `helm upgrade --force` in order to re-create the deployment.
5761

@@ -60,7 +64,7 @@ Due to a change in deployment labels, the upgrade requires `helm upgrade --force
6064
See [Customizing the Chart Before Installing](https://helm.sh/docs/intro/using_helm/#customizing-the-chart-before-installing). To see all configurable options with detailed comments, visit the chart's [values.yaml](./values.yaml), or run these configuration commands:
6165

6266
```console
63-
helm show values prometheus-community/prometheus-adapter
67+
helm show values oci://ghcr.io/prometheus-community/charts/prometheus-adapter
6468
```
6569

6670
### Prometheus Service Endpoint

charts/prometheus-adapter/templates/_helpers.tpl

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,12 +73,3 @@ Create the name of the service account to use
7373
{{ default "default" .Values.serviceAccount.name }}
7474
{{- end -}}
7575
{{- end -}}
76-
77-
{{/* Get Policy API Version */}}
78-
{{- define "k8s-prometheus-adapter.pdb.apiVersion" -}}
79-
{{- if and (.Capabilities.APIVersions.Has "policy/v1") (semverCompare ">= 1.21-0" .Capabilities.KubeVersion.Version) -}}
80-
{{- print "policy/v1" -}}
81-
{{- else -}}
82-
{{- print "policy/v1beta1" -}}
83-
{{- end -}}
84-
{{- end -}}

charts/prometheus-adapter/templates/deployment.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ metadata:
1616
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
1717
spec:
1818
replicas: {{ .Values.replicas }}
19+
revisionHistoryLimit: {{ .Values.revisionHistoryLimit }}
1920
strategy: {{ toYaml .Values.strategy | nindent 4 }}
2021
selector:
2122
matchLabels:

charts/prometheus-adapter/templates/pdb.yaml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- if .Values.podDisruptionBudget.enabled }}
2-
apiVersion: {{ include "k8s-prometheus-adapter.pdb.apiVersion" . }}
2+
apiVersion: policy/v1
33
kind: PodDisruptionBudget
44
metadata:
55
name: {{ template "k8s-prometheus-adapter.fullname" . }}
@@ -11,12 +11,17 @@ metadata:
1111
labels:
1212
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
1313
spec:
14-
{{- if .Values.podDisruptionBudget.minAvailable }}
15-
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
16-
{{- end }}
17-
{{- if .Values.podDisruptionBudget.maxUnavailable }}
18-
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
19-
{{- end }}
14+
{{- with .Values.podDisruptionBudget }}
15+
{{- if .minAvailable }}
16+
minAvailable: {{ .minAvailable }}
17+
{{- end }}
18+
{{- if .maxUnavailable }}
19+
maxUnavailable: {{ .maxUnavailable }}
20+
{{- end }}
21+
{{- if .unhealthyPodEvictionPolicy }}
22+
unhealthyPodEvictionPolicy: {{ .unhealthyPodEvictionPolicy }}
23+
{{- end }}
24+
{{- end }}
2025
selector:
2126
matchLabels:
2227
{{- include "k8s-prometheus-adapter.selectorLabels" . | indent 6 }}

charts/prometheus-adapter/templates/psp.yaml

Lines changed: 0 additions & 66 deletions
This file was deleted.

charts/prometheus-adapter/values.yaml

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ affinity: {}
22

33
topologySpreadConstraints: []
44

5+
# Override the name of the chart
6+
nameOverride: ""
7+
8+
# Override the full name of the release
9+
fullnameOverride: ""
10+
511
image:
612
repository: registry.k8s.io/prometheus-adapter/prometheus-adapter
713
# if not set appVersion field from Chart.yaml is used
@@ -67,15 +73,6 @@ rbac:
6773
customMetrics:
6874
resources: ["*"]
6975

70-
psp:
71-
# Specifies whether PSP resources should be created
72-
create: false
73-
# Annotations added to the pod security policy
74-
annotations: {}
75-
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#apparmor
76-
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#seccomp
77-
## Ref: https://kubernetes.io/docs/concepts/policy/pod-security-policy/#sysctl
78-
7976
# If false then the user will opt out of automounting API credentials.
8077
automountServiceAccountToken: true
8178

@@ -292,6 +289,8 @@ podDisruptionBudget:
292289
enabled: false
293290
minAvailable:
294291
maxUnavailable: 1
292+
# See https://kubernetes.io/docs/tasks/run-application/configure-pdb/#unhealthy-pod-eviction-policy for possible values
293+
unhealthyPodEvictionPolicy:
295294

296295
certManager:
297296
enabled: false
@@ -312,3 +311,6 @@ extraManifests: []
312311
# name: prometheus-extra
313312
# data:
314313
# extra-data: "value"
314+
315+
# Optional: set revisionHistoryLimit for the Deployment
316+
revisionHistoryLimit: 10

0 commit comments

Comments
 (0)