Skip to content

Commit

Permalink
Merge pull request #1574 from peterabarr/pdb-policy
Browse files Browse the repository at this point in the history
feat: Added new policy to PodDisruptionBudget
  • Loading branch information
k8s-ci-robot authored Oct 8, 2024
2 parents 5a7a444 + 76de4d1 commit 9ebbad9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
1 change: 1 addition & 0 deletions charts/metrics-server/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
### Added

- Add options on howto secure the connection between metrics-server and the kube-apiserver. ([#1288](https://github.com/kubernetes-sigs/metrics-server/pull/1288)) _@mkilchhofer_
- Added `unhealthyPodEvictionPolicy` to the metrics-server PDB as a user enabled feature. ([#1574](https://github.com/kubernetes-sigs/metrics-server/pull/1574)) @peterabarr

## [3.12.2] - TBC

Expand Down
2 changes: 2 additions & 0 deletions charts/metrics-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ The following table lists the configurable parameters of the _Metrics Server_ ch
| `podDisruptionBudget.enabled` | If `true`, create `PodDisruptionBudget` resource. | `{}` |
| `podDisruptionBudget.minAvailable` | Set the `PodDisruptionBudget` minimum available pods. | `nil` |
| `podDisruptionBudget.maxUnavailable` | Set the `PodDisruptionBudget` maximum unavailable pods. | `nil` |
| `podDisruptionBudget.maxUnavailable` | Set the `PodDisruptionBudget` maximum unavailable pods. | `nil` |
| `podDisruptionBudget.unhealthyPodEvictionPolicy` | Unhealthy pod eviction policy for the PDB. | `nil` |
| `defaultArgs` | Default arguments to pass to the _metrics-server_ command. | See _values.yaml_ |
| `args` | Additional arguments to pass to the _metrics-server_ command. | `[]` |
| `livenessProbe` | Liveness probe. | See _values.yaml_ |
Expand Down
10 changes: 8 additions & 2 deletions charts/metrics-server/templates/pdb.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,16 @@ metadata:
spec:
{{- if .Values.podDisruptionBudget.minAvailable }}
minAvailable: {{ .Values.podDisruptionBudget.minAvailable }}
{{- end }}
{{- end }}
{{- if .Values.podDisruptionBudget.maxUnavailable }}
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }}
{{- end }}
{{- end }}
{{- if (semverCompare ">= 1.27-0" .Capabilities.KubeVersion.Version) }}
{{- with .Values.podDisruptionBudget.unhealthyPodEvictionPolicy }}
unhealthyPodEvictionPolicy: {{ . }}
{{- end }}
{{- end }}

selector:
matchLabels:
{{- include "metrics-server.selectorLabels" . | nindent 6 }}
Expand Down
1 change: 1 addition & 0 deletions charts/metrics-server/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ podDisruptionBudget:
enabled: false
minAvailable:
maxUnavailable:
unhealthyPodEvictionPolicy:

defaultArgs:
- --cert-dir=/tmp
Expand Down

0 comments on commit 9ebbad9

Please sign in to comment.