Skip to content
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
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
For sftd/coturn/restund, fixed a bug in external ip address lookup, in case Kubernetes Node Name doesn't equal hostname.
9 changes: 7 additions & 2 deletions charts/coturn/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,22 @@ spec:
volumeMounts:
- name: external-ip
mountPath: /external-ip
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command:
- /bin/sh
- -c
- |
set -e

# In the cloud, this setting is available to indicate the true IP address
addr=$(kubectl get node $HOSTNAME -ojsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')
addr=$(kubectl get node $NODE_NAME -ojsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')
# On on-prem we allow people to set "wire.com/external-ip" to override this
if [ -z "$addr" ]; then
addr=$(kubectl get node $HOSTNAME -ojsonpath='{.metadata.annotations.wire\.com/external-ip}')
addr=$(kubectl get node $NODE_NAME -ojsonpath='{.metadata.annotations.wire\.com/external-ip}')
fi
echo -n "$addr" | tee /dev/stderr > /external-ip/ip
containers:
Expand Down
9 changes: 7 additions & 2 deletions charts/restund/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,18 +53,23 @@ spec:
volumeMounts:
- name: external-ip
mountPath: /external-ip
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command:
- /bin/sh
- -c
- |
set -e

# In the cloud, this setting is available to indicate the true IP address
addr=$(kubectl get node $HOSTNAME -ojsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')
addr=$(kubectl get node $NODE_NAME -ojsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')

# On on-prem we allow people to set "wire.com/external-ip" to override this
if [ -z "$addr" ]; then
addr=$(kubectl get node $HOSTNAME -ojsonpath='{.metadata.annotations.wire\.com/external-ip}')
addr=$(kubectl get node $NODE_NAME -ojsonpath='{.metadata.annotations.wire\.com/external-ip}')
fi
echo -n "$addr" | tee /dev/stderr > /external-ip/ip
containers:
Expand Down
9 changes: 7 additions & 2 deletions charts/sftd/templates/statefulset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,18 +43,23 @@ spec:
volumeMounts:
- name: external-ip
mountPath: /external-ip
env:
- name: NODE_NAME
valueFrom:
fieldRef:
fieldPath: spec.nodeName
command:
- /bin/sh
- -c
- |
set -e

# In the cloud, this setting is available to indicate the true IP address
addr=$(kubectl get node $HOSTNAME -ojsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')
addr=$(kubectl get node $NODE_NAME -ojsonpath='{.status.addresses[?(@.type=="ExternalIP")].address}')

# On on-prem we allow people to set "wire.com/external-ip" to override this
if [ -z "$addr" ]; then
addr=$(kubectl get node $HOSTNAME -ojsonpath='{.metadata.annotations.wire\.com/external-ip}')
addr=$(kubectl get node $NODE_NAME -ojsonpath='{.metadata.annotations.wire\.com/external-ip}')
fi
echo -n "$addr" | tee /dev/stderr > /external-ip/ip
- name: get-multi-sft-config
Expand Down