Skip to content

Commit

Permalink
[prometheus-adapter] Add a pod disruption budget (prometheus-communit…
Browse files Browse the repository at this point in the history
…y#143)

Signed-off-by: Ahmed Nasir <ahmednasir91@gmail.com>
  • Loading branch information
ahmednasir91 authored Sep 25, 2020
1 parent 5b25a9b commit 3aa6446
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
2 changes: 1 addition & 1 deletion charts/prometheus-adapter/Chart.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
apiVersion: v1
name: prometheus-adapter
version: 2.6.2
version: 2.7.0
appVersion: v0.7.0
description: A Helm chart for k8s prometheus adapter
home: https://github.com/DirectXMan12/k8s-prometheus-adapter
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{{- if .Values.podDisruptionBudget.enabled }}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
name: {{ template "k8s-prometheus-adapter.fullname" . }}
labels:
app: {{ template "k8s-prometheus-adapter.name" . }}
chart: {{ template "k8s-prometheus-adapter.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: {{ template "k8s-prometheus-adapter.name" . }}
release: {{ .Release.Name }}
{{- end }}
7 changes: 7 additions & 0 deletions charts/prometheus-adapter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -143,3 +143,10 @@ hostNetwork:
# API server unable to communicate with metrics-server. As an example, this is required
# if you use Weave network on EKS
enabled: false

podDisruptionBudget:
# Specifies if PodDisruptionBudget should be enabled
# When enabled, minAvailable or maxUnavailable should also be defined.
enabled: false
minAvailable:
maxUnavailable: 1

0 comments on commit 3aa6446

Please sign in to comment.