diff --git a/templates/server-ha-active-service.yaml b/templates/server-ha-active-service.yaml index 525fc8c9c..3538cdb19 100644 --- a/templates/server-ha-active-service.yaml +++ b/templates/server-ha-active-service.yaml @@ -29,8 +29,8 @@ spec: - name: {{ include "vault.scheme" . }} port: {{ .Values.server.service.port }} targetPort: {{ .Values.server.service.targetPort }} - {{- if and (.Values.server.service.nodePort) (eq (.Values.server.service.type | toString) "NodePort") }} - nodePort: {{ .Values.server.service.nodePort }} + {{- if and (.Values.server.service.activeNodePort) (eq (.Values.server.service.type | toString) "NodePort") }} + nodePort: {{ .Values.server.service.activeNodePort }} {{- end }} - name: https-internal port: 8201 diff --git a/templates/server-ha-standby-service.yaml b/templates/server-ha-standby-service.yaml index 03260ffaf..e6d66af84 100644 --- a/templates/server-ha-standby-service.yaml +++ b/templates/server-ha-standby-service.yaml @@ -29,8 +29,8 @@ spec: - name: {{ include "vault.scheme" . }} port: {{ .Values.server.service.port }} targetPort: {{ .Values.server.service.targetPort }} - {{- if and (.Values.server.service.nodePort) (eq (.Values.server.service.type | toString) "NodePort") }} - nodePort: {{ .Values.server.service.nodePort }} + {{- if and (.Values.server.service.standbyNodePort) (eq (.Values.server.service.type | toString) "NodePort") }} + nodePort: {{ .Values.server.service.standbyNodePort }} {{- end }} - name: https-internal port: 8201 diff --git a/test/unit/server-ha-active-service.bats b/test/unit/server-ha-active-service.bats index 80e26dd4e..d74e74913 100755 --- a/test/unit/server-ha-active-service.bats +++ b/test/unit/server-ha-active-service.bats @@ -119,7 +119,7 @@ load _helpers --show-only templates/server-ha-active-service.yaml \ --set 'server.ha.enabled=true' \ --set 'server.service.type=NodePort' \ - --set 'server.service.nodePort=30009' \ + --set 'server.service.activeNodePort=30009' \ . | tee /dev/stderr | yq -r '.spec.ports[0].nodePort' | tee /dev/stderr) [ "${actual}" = "30009" ] @@ -130,7 +130,7 @@ load _helpers local actual=$(helm template \ --show-only templates/server-ha-active-service.yaml \ --set 'server.ha.enabled=true' \ - --set 'server.service.nodePort=30009' \ + --set 'server.service.activeNodePort=30009' \ . | tee /dev/stderr | yq -r '.spec.ports[0].nodePort' | tee /dev/stderr) [ "${actual}" = "null" ] diff --git a/test/unit/server-ha-standby-service.bats b/test/unit/server-ha-standby-service.bats index df0f9071e..045560ce9 100755 --- a/test/unit/server-ha-standby-service.bats +++ b/test/unit/server-ha-standby-service.bats @@ -130,7 +130,7 @@ load _helpers --show-only templates/server-ha-standby-service.yaml \ --set 'server.ha.enabled=true' \ --set 'server.service.type=NodePort' \ - --set 'server.service.nodePort=30009' \ + --set 'server.service.standbyNodePort=30009' \ . | tee /dev/stderr | yq -r '.spec.ports[0].nodePort' | tee /dev/stderr) [ "${actual}" = "30009" ] @@ -141,7 +141,7 @@ load _helpers local actual=$(helm template \ --show-only templates/server-ha-standby-service.yaml \ --set 'server.ha.enabled=true' \ - --set 'server.service.nodePort=30009' \ + --set 'server.service.standbyNodePort=30009' \ . | tee /dev/stderr | yq -r '.spec.ports[0].nodePort' | tee /dev/stderr) [ "${actual}" = "null" ] diff --git a/values.yaml b/values.yaml index 4d967f886..08b5fc987 100644 --- a/values.yaml +++ b/values.yaml @@ -572,6 +572,16 @@ server: # will be random if left blank. #nodePort: 30000 + # When HA mode is enabled + # If type is set to "NodePort", a specific nodePort value can be configured, + # will be random if left blank. + #activeNodePort: 30001 + + # When HA mode is enabled + # If type is set to "NodePort", a specific nodePort value can be configured, + # will be random if left blank. + #standbyNodePort: 30002 + # Port on which Vault server is listening port: 8200 # Target port to which the service should be mapped to