Skip to content

Commit

Permalink
allow to configure publishNotReadyAddresses on server services
Browse files Browse the repository at this point in the history
  • Loading branch information
avoidik committed Feb 25, 2022
1 parent b447a92 commit 0b8db8b
Show file tree
Hide file tree
Showing 7 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion templates/server-ha-active-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
{{- include "service.externalTrafficPolicy" .Values.server.service }}
publishNotReadyAddresses: true
publishNotReadyAddresses: {{ .Values.server.publishNotReadyAddresses }}
ports:
- name: {{ include "vault.scheme" . }}
port: {{ .Values.server.service.port }}
Expand Down
2 changes: 1 addition & 1 deletion templates/server-ha-standby-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ spec:
clusterIP: {{ .Values.server.service.clusterIP }}
{{- end }}
{{- include "service.externalTrafficPolicy" .Values.server.service }}
publishNotReadyAddresses: true
publishNotReadyAddresses: {{ .Values.server.publishNotReadyAddresses }}
ports:
- name: {{ include "vault.scheme" . }}
port: {{ .Values.server.service.port }}
Expand Down
2 changes: 1 addition & 1 deletion templates/server-headless-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ metadata:
{{ template "vault.service.annotations" .}}
spec:
clusterIP: None
publishNotReadyAddresses: true
publishNotReadyAddresses: {{ .Values.server.publishNotReadyAddresses }}
ports:
- name: "{{ include "vault.scheme" . }}"
port: {{ .Values.server.service.port }}
Expand Down
2 changes: 1 addition & 1 deletion templates/server-service.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
{{- include "service.externalTrafficPolicy" .Values.server.service }}
# We want the servers to become available even if they're not ready
# since this DNS is also used for join operations.
publishNotReadyAddresses: true
publishNotReadyAddresses: {{ .Values.server.publishNotReadyAddresses }}
ports:
- name: {{ include "vault.scheme" . }}
port: {{ .Values.server.service.port }}
Expand Down
7 changes: 7 additions & 0 deletions test/unit/server-service.bats
Original file line number Diff line number Diff line change
Expand Up @@ -175,6 +175,13 @@ load _helpers
. | tee /dev/stderr |
yq -r '.spec.publishNotReadyAddresses' | tee /dev/stderr)
[ "${actual}" = "true" ]

local actual=$(helm template \
--show-only templates/server-service.yaml \
--set 'server.publishNotReadyAddresses=false' \
. | tee /dev/stderr |
yq -r '.spec.publishNotReadyAddresses' | tee /dev/stderr)
[ "${actual}" = "false" ]
}

@test "server/Service: type empty by default" {
Expand Down
3 changes: 3 additions & 0 deletions values.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -483,6 +483,9 @@
"enabled": {
"type": "boolean"
},
"publishNotReadyAddresses": {
"type": "boolean"
},
"enterpriseLicense": {
"type": "object",
"properties": {
Expand Down
2 changes: 2 additions & 0 deletions values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,8 @@ server:
# If not set to true, Vault server will not be installed. See vault.mode in _helpers.tpl for implementation details
enabled: true

publishNotReadyAddresses: true

# [Enterprise Only] This value refers to a Kubernetes secret that you have
# created that contains your enterprise license. If you are not using an
# enterprise image or if you plan to introduce the license key via another
Expand Down

0 comments on commit 0b8db8b

Please sign in to comment.