injector: ability to set deployment update strategy (continued) (#661)
Co-authored-by: Jason Hancock <jhancock@netskope.com>
This commit is contained in:
parent
248397f663
commit
0c0b6e34f4
6 changed files with 61 additions and 0 deletions
|
@ -3,6 +3,7 @@
|
||||||
Features:
|
Features:
|
||||||
* Added configurable podDisruptionBudget for injector [GH-653](https://github.com/hashicorp/vault-helm/pull/653)
|
* Added configurable podDisruptionBudget for injector [GH-653](https://github.com/hashicorp/vault-helm/pull/653)
|
||||||
* Make terminationGracePeriodSeconds configurable for server [GH-659](https://github.com/hashicorp/vault-helm/pull/659)
|
* Make terminationGracePeriodSeconds configurable for server [GH-659](https://github.com/hashicorp/vault-helm/pull/659)
|
||||||
|
* Added configurable update strategy for injector [GH-661](https://github.com/hashicorp/vault-helm/pull/661)
|
||||||
|
|
||||||
## 0.18.0 (November 17th, 2021)
|
## 0.18.0 (November 17th, 2021)
|
||||||
|
|
||||||
|
|
|
@ -308,6 +308,21 @@ Sets the injector node selector for pod placement
|
||||||
{{- end }}
|
{{- end }}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Sets the injector deployment update strategy
|
||||||
|
*/}}
|
||||||
|
{{- define "injector.strategy" -}}
|
||||||
|
{{- if .Values.injector.strategy }}
|
||||||
|
strategy:
|
||||||
|
{{- $tp := typeOf .Values.injector.strategy }}
|
||||||
|
{{- if eq $tp "string" }}
|
||||||
|
{{ tpl .Values.injector.strategy . | nindent 4 | trim }}
|
||||||
|
{{- else }}
|
||||||
|
{{- toYaml .Values.injector.strategy | nindent 4 }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end }}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Sets extra pod annotations
|
Sets extra pod annotations
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
@ -17,6 +17,7 @@ spec:
|
||||||
app.kubernetes.io/name: {{ template "vault.name" . }}-agent-injector
|
app.kubernetes.io/name: {{ template "vault.name" . }}-agent-injector
|
||||||
app.kubernetes.io/instance: {{ .Release.Name }}
|
app.kubernetes.io/instance: {{ .Release.Name }}
|
||||||
component: webhook
|
component: webhook
|
||||||
|
{{ template "injector.strategy" . }}
|
||||||
template:
|
template:
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
|
|
@ -721,3 +721,32 @@ load _helpers
|
||||||
yq -r 'map(select(.name=="AGENT_INJECT_TEMPLATE_STATIC_SECRET_RENDER_INTERVAL")) | .[] .value' | tee /dev/stderr)
|
yq -r 'map(select(.name=="AGENT_INJECT_TEMPLATE_STATIC_SECRET_RENDER_INTERVAL")) | .[] .value' | tee /dev/stderr)
|
||||||
[ "${value}" = "1m" ]
|
[ "${value}" = "1m" ]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@test "injector/deployment: strategy default" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-deployment.yaml \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.strategy' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "null" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "injector/deployment: strategy set as string" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-deployment.yaml \
|
||||||
|
--set="injector.strategy=testing" \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.strategy' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "testing" ]
|
||||||
|
}
|
||||||
|
|
||||||
|
@test "injector/deployment: strategy can be set as YAML" {
|
||||||
|
cd `chart_dir`
|
||||||
|
local actual=$(helm template \
|
||||||
|
--show-only templates/injector-deployment.yaml \
|
||||||
|
--set 'injector.strategy.rollingUpdate.maxUnavailable=1' \
|
||||||
|
. | tee /dev/stderr |
|
||||||
|
yq -r '.spec.strategy.rollingUpdate.maxUnavailable' | tee /dev/stderr)
|
||||||
|
[ "${actual}" = "1" ]
|
||||||
|
}
|
||||||
|
|
|
@ -349,6 +349,12 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"strategy": {
|
||||||
|
"type": [
|
||||||
|
"object",
|
||||||
|
"string"
|
||||||
|
]
|
||||||
|
},
|
||||||
"tolerations": {
|
"tolerations": {
|
||||||
"type": [
|
"type": [
|
||||||
"null",
|
"null",
|
||||||
|
|
|
@ -205,6 +205,15 @@ injector:
|
||||||
# podDisruptionBudget:
|
# podDisruptionBudget:
|
||||||
# maxUnavailable: 1
|
# maxUnavailable: 1
|
||||||
|
|
||||||
|
# strategy for updating the deployment. This can be a multi-line string or a
|
||||||
|
# YAML map.
|
||||||
|
strategy: {}
|
||||||
|
# strategy: |
|
||||||
|
# rollingUpdate:
|
||||||
|
# maxSurge: 25%
|
||||||
|
# maxUnavailable: 25%
|
||||||
|
# type: RollingUpdate
|
||||||
|
|
||||||
server:
|
server:
|
||||||
# If not set to true, Vault server will not be installed. See vault.mode in _helpers.tpl for implementation details
|
# If not set to true, Vault server will not be installed. See vault.mode in _helpers.tpl for implementation details
|
||||||
enabled: true
|
enabled: true
|
||||||
|
|
Loading…
Reference in a new issue