Skip to content

Commit

Permalink
add support for pod disruption budget (helm#13220)
Browse files Browse the repository at this point in the history
* add support for pod disruption budget

Signed-off-by: Jay Howard <jay.howard@rmn.com>

* explicitly support current pod disruption budget options

Signed-off-by: Jay Howard <jay.howard@rmn.com>

* lint: add newline at end of file

Signed-off-by: Jay Howard <jay.howard@rmn.com>
  • Loading branch information
Jay Howard authored and Moritz Pein committed Apr 26, 2019
1 parent b0d9205 commit 752d3d4
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 1 deletion.
2 changes: 1 addition & 1 deletion stable/metrics-server/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
appVersion: 0.3.2
description: Metrics Server is a cluster-wide aggregator of resource usage data.
name: metrics-server
version: 2.6.0
version: 2.7.0
keywords:
- metrics-server
home: https://github.com/kubernetes-incubator/metrics-server
Expand Down
3 changes: 3 additions & 0 deletions stable/metrics-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,6 @@ Parameter | Description | Default
`service.annotations` | Annotations to add to the service | `{}`
`service.port` | Service port to expose | `443`
`service.type` | Type of service to create | `ClusterIP`
`podDisruptionBudget.enabled` | Create a PodDisruptionBudget | `false`
`podDisruptionBudget.minAvailable` | Minimum available instances; ignored if there is no PodDisruptionBudget | `1`
`podDisruptionBudget.maxUnavailable` | Maximum unavailable instances; ignored if there is no PodDisruptionBudget | `1`
23 changes: 23 additions & 0 deletions stable/metrics-server/templates/pdb.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{{- if .Values.podDisruptionBudget.enabled -}}
apiVersion: policy/v1beta1
kind: PodDisruptionBudget
metadata:
labels:
app: {{ template "metrics-server.name" . }}
chart: {{ template "metrics-server.chart" . }}
release: {{ .Release.Name }}
heritage: {{ .Release.Service }}
name: {{ template "metrics-server.fullname" . }}
namespace: {{ .Release.Namespace }}

spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
selector:
matchLabels:
app: {{ template "metrics-server.name" . }}
{{- end -}}
6 changes: 6 additions & 0 deletions stable/metrics-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,3 +90,9 @@ service:
annotations: {}
port: 443
type: ClusterIP

podDisruptionBudget:
# https://kubernetes.io/docs/tasks/run-application/configure-pdb/
enabled: false
minAvailable: 1
maxUnavailable: 1

0 comments on commit 752d3d4

Please sign in to comment.