-
Notifications
You must be signed in to change notification settings - Fork 884
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configurable PodDisruptionBudget for Injector (#653)
- Loading branch information
Showing
5 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
{{- if .Values.injector.podDisruptionBudget }} | ||
apiVersion: policy/v1beta1 | ||
kind: PodDisruptionBudget | ||
metadata: | ||
name: {{ template "vault.fullname" . }}-agent-injector | ||
namespace: {{ .Release.Namespace }} | ||
labels: | ||
helm.sh/chart: {{ include "vault.chart" . }} | ||
app.kubernetes.io/name: {{ include "vault.name" . }}-agent-injector | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
app.kubernetes.io/managed-by: {{ .Release.Service }} | ||
component: webhook | ||
spec: | ||
selector: | ||
matchLabels: | ||
app.kubernetes.io/name: {{ template "vault.name" . }}-agent-injector | ||
app.kubernetes.io/instance: {{ .Release.Name }} | ||
component: webhook | ||
{{- toYaml .Values.injector.podDisruptionBudget | nindent 2 }} | ||
{{- end -}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
#!/usr/bin/env bats | ||
|
||
load _helpers | ||
|
||
@test "injector/DisruptionBudget: disabled by default" { | ||
cd `chart_dir` | ||
local actual=$( (helm template \ | ||
--show-only templates/injector-disruptionbudget.yaml \ | ||
. || echo "---") | tee /dev/stderr | | ||
yq 'length > 0' | tee /dev/stderr) | ||
[ "${actual}" = "false" ] | ||
} | ||
|
||
@test "injector/DisruptionBudget: configure with injector.podDisruptionBudget maxUnavailable" { | ||
cd `chart_dir` | ||
local actual=$(helm template \ | ||
--show-only templates/injector-disruptionbudget.yaml \ | ||
--set 'injector.podDisruptionBudget.maxUnavailable=3' \ | ||
. | tee /dev/stderr | | ||
yq '.spec.maxUnavailable == 3' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
} | ||
|
||
@test "injector/DisruptionBudget: configure with injector.podDisruptionBudget minAvailable" { | ||
cd `chart_dir` | ||
local actual=$(helm template \ | ||
--show-only templates/injector-disruptionbudget.yaml \ | ||
--set 'injector.podDisruptionBudget.minAvailable=2' \ | ||
. | tee /dev/stderr | | ||
yq '.spec.minAvailable == 2' | tee /dev/stderr) | ||
[ "${actual}" = "true" ] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters