Skip to content

Commit

Permalink
charts,salt,build: Bump Prometheus Adapter chart to 3.2.2
Browse files Browse the repository at this point in the history
Upgrade Prometheus Adapter chart using:
```
rm -rf charts/prometheus-adapter/
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
helm fetch -d charts --untar prometheus-community/prometheus-adapter
```

Re-render Loki salt state using:
```
./charts/render.py prometheus-adapter --namespace metalk8s-monitoring \
  charts/prometheus-adapter.yaml  charts/prometheus-adapter/ \
  > salt/metalk8s/addons/prometheus-adapter/deployed/chart.sls
```
  • Loading branch information
TeddyAndrieux committed May 6, 2022
1 parent 8acc083 commit abce940
Show file tree
Hide file tree
Showing 23 changed files with 127 additions and 122 deletions.
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@
(PR[#3701](https://github.com/scality/metalk8s/pull/3701))

- Bump Prometheus Adapter chart version to
[3.0.2](https://github.com/prometheus-community/helm-charts/releases/tag/prometheus-adapter-3.0.2)
[3.2.2](https://github.com/prometheus-community/helm-charts/releases/tag/prometheus-adapter-3.2.2)
The prometheus-adapter image has been bumped accordingly to
[v0.9.1](https://github.com/kubernetes-sigs/prometheus-adapter/releases/tag/v0.9.1)
(PR[#3702](https://github.com/scality/metalk8s/pull/3702))
(PR[#3760](https://github.com/scality/metalk8s/pull/3760))

- Bump ingress-nginx chart version to
[4.0.17](https://github.com/kubernetes/ingress-nginx/releases/tag/helm-chart-4.0.17)
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ name: prometheus-adapter
sources:
- https://github.com/kubernetes/charts
- https://github.com/kubernetes-sigs/prometheus-adapter
version: 3.0.2
version: 3.2.2
31 changes: 9 additions & 22 deletions charts/prometheus-adapter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,48 +6,39 @@ Installs the [Prometheus Adapter](https://github.com/kubernetes-sigs/prometheus-

Kubernetes 1.14+

## Get Repo Info
## Get Helm Repositories Info

```console
helm repo add prometheus-community https://prometheus-community.github.io/helm-charts
helm repo update
```

_See [helm repo](https://helm.sh/docs/helm/helm_repo/) for command documentation._
_See [`helm repo`](https://helm.sh/docs/helm/helm_repo/) for command documentation._

## Install Chart
## Install Helm Chart

```console
# Helm 3
$ helm install [RELEASE_NAME] prometheus-community/prometheus-adapter

# Helm 2
$ helm install --name [RELEASE_NAME] prometheus-community/prometheus-adapter
helm install [RELEASE_NAME] prometheus-community/prometheus-adapter
```

_See [configuration](#configuration) below._

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

## Uninstall Chart
## Uninstall Helm Chart

```console
# Helm 3
$ helm uninstall [RELEASE_NAME]

# Helm 2
# helm delete --purge [RELEASE_NAME]
helm uninstall [RELEASE_NAME]
```

This removes all the Kubernetes components associated with the chart and deletes the release.

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

## Upgrading Chart
## Upgrading Helm Chart

```console
# Helm 3 or 2
$ helm upgrade [RELEASE_NAME] [CHART] --install
helm upgrade [RELEASE_NAME] [CHART] --install
```

_See [helm upgrade](https://helm.sh/docs/helm/helm_upgrade/) for command documentation._
Expand All @@ -61,11 +52,7 @@ Due to a change in deployment labels, the upgrade requires `helm upgrade --force
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:

```console
# Helm 2
$ helm inspect values prometheus-community/prometheus-adapter

# Helm 3
$ helm show values prometheus-community/prometheus-adapter
helm show values prometheus-community/prometheus-adapter
```

### Prometheus Service Endpoint
Expand Down
7 changes: 7 additions & 0 deletions charts/prometheus-adapter/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ If release name contains chart name it will be used as a full name.
{{- end -}}
{{- end -}}

{{/*
Allow the release namespace to be overridden for multi-namespace deployments in combined charts
*/}}
{{- define "k8s-prometheus-adapter.namespace" -}}
{{- default .Release.Namespace .Values.namespaceOverride -}}
{{- end -}}

{{/*
Create chart name and version as used by the chart label.
*/}}
Expand Down
12 changes: 6 additions & 6 deletions charts/prometheus-adapter/templates/certmanager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}-self-signed-issuer
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand All @@ -21,7 +21,7 @@ apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}-root-cert
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand All @@ -41,7 +41,7 @@ apiVersion: cert-manager.io/v1
kind: Issuer
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}-root-issuer
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand All @@ -57,7 +57,7 @@ apiVersion: cert-manager.io/v1
kind: Certificate
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}-cert
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand All @@ -71,6 +71,6 @@ spec:
name: {{ template "k8s-prometheus-adapter.fullname" . }}-root-issuer
dnsNames:
- {{ template "k8s-prometheus-adapter.fullname" . }}
- {{ template "k8s-prometheus-adapter.fullname" . }}.{{ .Release.Namespace }}
- {{ template "k8s-prometheus-adapter.fullname" . }}.{{ .Release.Namespace }}.svc
- {{ template "k8s-prometheus-adapter.fullname" . }}.{{ include "k8s-prometheus-adapter.namespace" . }}
- {{ template "k8s-prometheus-adapter.fullname" . }}.{{ include "k8s-prometheus-adapter.namespace" . }}.svc
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/templates/configmap.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ kind: APIService
metadata:
{{- if or .Values.certManager.enabled .Values.customAnnotations }}
annotations:
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" (include "k8s-prometheus-adapter.namespace" .) (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" (include "k8s-prometheus-adapter.namespace" .) (include "k8s-prometheus-adapter.fullname" .) | quote }}
{{- if .Values.customAnnotations }}
{{- toYaml .Values.customAnnotations | nindent 4 }}
{{- end }}
Expand All @@ -20,7 +20,7 @@ metadata:
spec:
service:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- if .Values.tls.enable }}
caBundle: {{ b64enc .Values.tls.ca }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}
4 changes: 3 additions & 1 deletion charts/prometheus-adapter/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
spec:
replicas: {{ .Values.replicas }}
strategy: {{ toYaml .Values.strategy | nindent 4 }}
Expand Down Expand Up @@ -110,6 +110,8 @@ spec:
{{- toYaml .Values.nodeSelector | nindent 8 }}
affinity:
{{- toYaml .Values.affinity | nindent 8 }}
topologySpreadConstraints:
{{- toYaml .Values.topologySpreadConstraints | nindent 8 }}
priorityClassName: {{ .Values.priorityClassName }}
{{- if .Values.podSecurityContext }}
securityContext:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ kind: APIService
metadata:
{{- if or .Values.certManager.enabled .Values.customAnnotations }}
annotations:
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" (include "k8s-prometheus-adapter.namespace" .) (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" (include "k8s-prometheus-adapter.namespace" .) (include "k8s-prometheus-adapter.fullname" .) | quote }}
{{- if .Values.customAnnotations }}
{{- toYaml .Values.customAnnotations | nindent 4 }}
{{- end }}
Expand All @@ -20,7 +20,7 @@ metadata:
spec:
service:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- if .Values.tls.enable }}
caBundle: {{ b64enc .Values.tls.ca }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ roleRef:
name: {{ template "k8s-prometheus-adapter.name" . }}-external-metrics
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
name: horizontal-pod-autoscaler
namespace: kube-system
{{- end -}}
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if .Values.customAnnotations }}
annotations:
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/templates/psp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ kind: APIService
metadata:
{{- if or .Values.certManager.enabled .Values.customAnnotations }}
annotations:
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" .Release.Namespace (include "k8s-prometheus-adapter.fullname" .) | quote }}
certmanager.k8s.io/inject-ca-from: {{ printf "%s/%s-root-cert" (include "k8s-prometheus-adapter.namespace" .) (include "k8s-prometheus-adapter.fullname" .) | quote }}
cert-manager.io/inject-ca-from: {{ printf "%s/%s-root-cert" (include "k8s-prometheus-adapter.namespace" .) (include "k8s-prometheus-adapter.fullname" .) | quote }}
{{- if .Values.customAnnotations }}
{{- toYaml .Values.customAnnotations | nindent 4 }}
{{- end }}
Expand All @@ -20,7 +20,7 @@ metadata:
spec:
service:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- if .Values.tls.enable }}
caBundle: {{ b64enc .Values.tls.ca }}
{{- end }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@ roleRef:
subjects:
- kind: ServiceAccount
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace | quote }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . | quote }}
{{- end -}}
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/templates/secret.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
type: kubernetes.io/tls
data:
tls.crt: {{ b64enc .Values.tls.certificate }}
Expand Down
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/templates/service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
name: {{ template "k8s-prometheus-adapter.fullname" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
spec:
ports:
- port: {{ .Values.service.port }}
Expand Down
4 changes: 2 additions & 2 deletions charts/prometheus-adapter/templates/serviceaccount.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ metadata:
labels:
{{- include "k8s-prometheus-adapter.labels" . | indent 4 }}
name: {{ template "k8s-prometheus-adapter.serviceAccountName" . }}
namespace: {{ .Release.Namespace }}
namespace: {{ include "k8s-prometheus-adapter.namespace" . }}
{{- if or .Values.serviceAccount.annotations .Values.customAnnotations }}
annotations:
{{- if .Values.serviceAccount.annotations }}
{{ toYaml .Values.serviceAccount.annotations | indent 4 }}
{{- toYaml .Values.serviceAccount.annotations | nindent 4 }}
{{- end }}
{{- if .Values.customAnnotations }}
{{- toYaml .Values.customAnnotations | nindent 4 }}
Expand Down
Loading

0 comments on commit abce940

Please sign in to comment.