Skip to content
This repository has been archived by the owner on Feb 22, 2022. It is now read-only.

add support for pod disruption budget #13220

Merged
merged 3 commits into from
Apr 24, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you add a (commented out) example of what is users should add here? Right now, one has to look at the template.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do. I have another nearly-identical PR pending for the kubernetes-dashboard chart. Do you advise preemptively making the same changes there?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To clarify: all the changes, not just the additional documentation in values.yaml.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would advice that yes. The kubernetes-dashboard maintainer may have other preferences though.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and made the changes over there as well. No response yet, but I'm happy to do it whichever way they prefer.

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