Skip to content
This repository was archived by the owner on Aug 25, 2021. It is now read-only.

Server wan ports #839

Merged
merged 4 commits into from
Feb 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ IMPROVEMENTS:
BUG FIXES:
* Increase Consul client daemonset's memory from `25Mi` to `50Mi` for its `client-tls-init`
init container that runs when TLS is enabled and auto-encrypt is disabled. [[GH-832](https://github.com/hashicorp/consul-helm/pull/832)]
* Add UDP port specification for server's serf WAN. Previously there was only one
port specification that defaulted to TCP. However in some cases (like when exposing as a host port)
UDP traffic would not be routed properly.

In addition, if `server.exposeGossipAndRPCPorts` is true, expose the WAN port
(`8302`) as a host port. [[GH-839](https://github.com/hashicorp/consul-helm/pull/839)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, were you able to see any error logs without this change?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, only the failing of the API call.


## 0.30.0 (Feb 16, 2021)

Expand Down
42 changes: 26 additions & 16 deletions templates/server-statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -228,37 +228,47 @@ spec:
{{- end }}
ports:
{{- if (or (not .Values.global.tls.enabled) (not .Values.global.tls.httpsOnly)) }}
- containerPort: 8500
name: http
- name: http
containerPort: 8500
{{- end }}
{{- if .Values.global.tls.enabled }}
- containerPort: 8501
name: https
- name: https
containerPort: 8501
{{- end }}
- containerPort: {{ .Values.server.ports.serflan.port }}
- name: serflan-tcp
containerPort: {{ .Values.server.ports.serflan.port }}
{{- if .Values.server.exposeGossipAndRPCPorts }}
hostPort: {{ .Values.server.ports.serflan.port }}
{{- end }}
protocol: "TCP"
name: serflan-tcp
- containerPort: {{ .Values.server.ports.serflan.port }}
- name: serflan-udp
containerPort: {{ .Values.server.ports.serflan.port }}
{{- if .Values.server.exposeGossipAndRPCPorts }}
hostPort: {{ .Values.server.ports.serflan.port }}
{{- end }}
protocol: "UDP"
name: serflan-udp
- containerPort: 8302
name: serfwan
- containerPort: 8300
- name: serfwan-tcp
containerPort: 8302
{{- if .Values.server.exposeGossipAndRPCPorts }}
hostPort: 8302
{{- end }}
protocol: "TCP"
- name: serfwan-udp
containerPort: 8302
{{- if .Values.server.exposeGossipAndRPCPorts }}
hostPort: 8302
{{- end }}
protocol: "UDP"
- name: server
containerPort: 8300
{{- if .Values.server.exposeGossipAndRPCPorts }}
hostPort: 8300
{{- end }}
name: server
- containerPort: 8600
name: dns-tcp
- name: dns-tcp
containerPort: 8600
protocol: "TCP"
- containerPort: 8600
name: dns-udp
- name: dns-udp
containerPort: 8600
protocol: "UDP"
readinessProbe:
# NOTE(mitchellh): when our HTTP status endpoints support the
Expand Down
16 changes: 16 additions & 0 deletions test/unit/server-statefulset.bats
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ load _helpers
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "serflan-udp")' | yq -r '.hostPort' | tee /dev/stderr)
[ "${actual}" = "null" ]

local actual=$(echo "$object" |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "serfwan-tcp")' | yq -r '.hostPort' | tee /dev/stderr)
[ "${actual}" = "null" ]

local actual=$(echo "$object" |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "serfwan-udp")' | yq -r '.hostPort' | tee /dev/stderr)
[ "${actual}" = "null" ]

# Test that hostPort is not set for rpc ports
local actual=$(echo "$object" |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "server")' | yq -r '.hostPort' | tee /dev/stderr)
Expand Down Expand Up @@ -205,6 +213,14 @@ load _helpers
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "serflan-udp")' | yq -r '.hostPort' | tee /dev/stderr)
[ "${actual}" = "8301" ]

local actual=$(echo "$object" |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "serfwan-tcp")' | yq -r '.hostPort' | tee /dev/stderr)
[ "${actual}" = "8302" ]

local actual=$(echo "$object" |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "serfwan-udp")' | yq -r '.hostPort' | tee /dev/stderr)
[ "${actual}" = "8302" ]

# Test that hostPort is set for rpc ports
local actual=$(echo "$object" |
yq -r '.spec.template.spec.containers[0].ports[] | select(.name == "server")' | yq -r '.hostPort' | tee /dev/stderr)
Expand Down