Add extraPorts property (#841)

This commit is contained in:
Dimitar Zafirov 2023-02-16 20:49:07 +02:00 committed by GitHub
parent 34d8650cca
commit e31e70ea0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 41 additions and 0 deletions

View file

@ -1,5 +1,8 @@
## Unreleased
Features:
* server: New `extraPorts` option for adding ports to the Vault server statefulset [GH-841](https://github.com/hashicorp/vault-helm/pull/841)
## 0.23.0 (November 28th, 2022)
Changes:

View file

@ -148,6 +148,9 @@ spec:
name: https-internal
- containerPort: 8202
name: {{ include "vault.scheme" . }}-rep
{{- if .Values.server.extraPorts -}}
{{ toYaml .Values.server.extraPorts | nindent 12}}
{{- end }}
{{- if .Values.server.readinessProbe.enabled }}
readinessProbe:
{{- if .Values.server.readinessProbe.path }}

View file

@ -1806,3 +1806,26 @@ load _helpers
yq -r '.spec.template.spec.hostNetwork' | tee /dev/stderr)
[ "${actual}" = "true" ]
}
#--------------------------------------------------------------------
# extraPorts
@test "server/standalone-StatefulSet: adds extra ports" {
cd `chart_dir`
# Test that it defines it
local object=$(helm template \
--show-only templates/server-statefulset.yaml \
--set 'server.extraPorts[0].containerPort=1111' \
--set 'server.extraPorts[0].name=foo' \
. | tee /dev/stderr |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "foo")' | tee /dev/stderr)
local actual=$(echo $object |
yq -r '.containerPort' | tee /dev/stderr)
[ "${actual}" = "1111" ]
local actual=$(echo $object |
yq -r '.name' | tee /dev/stderr)
[ "${actual}" = "foo" ]
}

View file

@ -593,6 +593,12 @@
"extraArgs": {
"type": "string"
},
"extraPorts": {
"type": [
"null",
"array"
]
},
"extraContainers": {
"type": [
"null",

View file

@ -456,6 +456,12 @@ server:
# extraArgs is a string containing additional Vault server arguments.
extraArgs: ""
# extraPorts is a list of extra ports. Specified as a YAML list.
# This is useful if you need to add additional ports to the statefulset in dynamic way.
extraPorts: null
# - containerPort: 8300
# name: http-monitoring
# Used to define custom readinessProbe settings
readinessProbe:
enabled: true