Skip to content

Commit ff12518

Browse files
weltekialexellis
authored andcommitted
Add troubleshooting page and docs for Inlets Uplink demux option
Signed-off-by: Han Verstraete (OpenFaaS Ltd) <[email protected]>
1 parent 99d3cdc commit ff12518

File tree

2 files changed

+161
-1
lines changed

2 files changed

+161
-1
lines changed

docs/uplink/troubleshooting.md

Lines changed: 159 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
# Troubleshooting
2+
3+
4+
## Client connections
5+
6+
Depending on how you are running the client, with Kubernetes or as a systemd service, use the following commands to check the logs.
7+
8+
- kubectl logs command (if deployed in Kubernetes):
9+
```bash
10+
kubectl logs deploy/<tunnel-name>-inlets-client -f
11+
```
12+
13+
- systemd logs (if deployed as service):
14+
```bash
15+
journalctl -u <tunnel-name>-tunnel -f
16+
```
17+
18+
Logs for the client will show you the connection status, reconnect attempts and errors and warnings that occurred during the connection.
19+
20+
- Verify the client is using a valid auth token for the tunnel.
21+
- Verify the client is using the same inlets version as the tunnel server
22+
- Verify the tunnel exist and is running, see: [troubleshoot tunnel servers](#tunnel-servers)
23+
- Verify the tunnels is reachable through the client-router. See: [troubleshoot the client router](#client-router)
24+
25+
## Tunnel servers
26+
27+
Each tunnel gets its own tunnel server deployment that handles the actual data forwarding.
28+
29+
Check the tunnel exists:
30+
31+
```sh
32+
kubectl get tunnels.uplink.inlets.dev -A
33+
```
34+
35+
Check the tunnel deployment is running and healthy
36+
37+
```sh
38+
kubectl get deploy -n <tunnel-namespace>
39+
```
40+
41+
Check the service for the tunnel got created and has the correct ports:
42+
43+
```sh
44+
kubectl get svc -n <tunnel-namespace>
45+
```
46+
47+
A tunnels service should have 8123/TCP,8000/TCP,8001/TCP + any additional TCP ports from the tunnel spec.
48+
49+
Check the logs for the tunnel deployment:
50+
51+
```sh
52+
kubectl logs -n <tunnel-namespace> deploy/<tunnel-name>
53+
```
54+
55+
Check event in the tunnel namespace:
56+
57+
```sh
58+
kubectl get events -n <tunnel-namespace> \
59+
--sort-by=.metadata.creationTimestamp
60+
```
61+
62+
Common issues:
63+
64+
- The Uplink license has not been copied to the tunnel namespace.
65+
- The tunnel secret referenced by `tokenRef` in the tunnel spec does not exist.
66+
- You have reached the maximum number of tunnels allowed by your license.
67+
68+
See [troubleshoot the uplink operator](#uplink-operator) if the deployment or service for the tunnel does not exist.
69+
70+
## Uplink operator
71+
72+
The uplink operator manages the lifecycle of tunnels, creating deployments, services, and secrets for each tunnel.
73+
74+
Check the uplink operator is running:
75+
76+
```sh
77+
kubectl get deploy/uplink-operator -n inlets
78+
```
79+
80+
Issues creating the tunnel resources will be shown in the logs.
81+
82+
```sh
83+
kubectl logs -n inlets deploy/uplink-operator -f
84+
```
85+
86+
The logs will show you if a tunnel did not get reconciled because you reached the maximum number of tunnels allowed by your license.
87+
88+
## Client router
89+
90+
The client router handles incoming WebSocket connections from tunnel clients and routes them to the appropriate tunnel server.
91+
92+
Check the client router is running:
93+
94+
```sh
95+
kubectl get deploy/client-router -n inlets
96+
```
97+
98+
All client connection attempts are logged by the router. If there are any issues reaching the upstream tunnel server will be shown in the logs.
99+
100+
```sh
101+
kubectl logs -n inlets deploy/client-router -f
102+
```
103+
104+
If client connections are not showing up in the client-router logs make sure to check the client router is reachable. Check your ingress configuration and the logs of your ingress server.
105+
106+
## Network reliability issues
107+
108+
Some protocols may experience network reliability issues under the standard inlets uplink mode due to Head-of-Line (HOL) blocking or slow reader/writer problems that can affect connection stability.
109+
110+
### Demux Mode
111+
112+
The demux (demultiplexed) mode addresses these issues by opening a separate WebSocket connection for each remote connection to a forwarded port. This prevents slow or problematic connections from affecting other connections on the same tunnel.
113+
114+
Enable demux mode by setting the `uplink_demux` environment variable in the Tunnel spec:
115+
116+
```diff
117+
apiVersion: uplink.inlets.dev/v1alpha1
118+
kind: Tunnel
119+
metadata:
120+
name: kubernetes-api
121+
namespace: tenant1
122+
spec:
123+
+ env:
124+
+ uplink_demux: "1"
125+
licenseRef:
126+
name: inlets-uplink-license
127+
namespace: tenant1
128+
tcpPorts:
129+
- 6443
130+
```
131+
132+
## Proxy Protocol Issues
133+
134+
When using TCP tunnels, Proxy Protocol can be a common source of connectivity issues. Proxy Protocol is used to preserve the original client IP address when traffic passes through multiple proxy layers.
135+
136+
### Common Proxy Protocol Problems
137+
138+
1. **Misconfigured Proxy Protocol at any hop**: If Proxy Protocol is enabled at one point in the chain but not properly handled at every subsequent hop, connections will fail.
139+
140+
2. **Version mismatch**: Ensure all components use the same Proxy Protocol version (v1 or v2).
141+
142+
3. **Service configuration**: The tunneled service must be configured to expect and parse Proxy Protocol headers when enabled.
143+
144+
### Troubleshooting Proxy Protocol
145+
146+
Check if your tunneled service supports Proxy Protocol and verify the configuration at each network hop:
147+
148+
- Load balancers (AWS ALB, nginx, HAProxy)
149+
- Ingress controllers
150+
- Service meshes (Istio, Linkerd)
151+
- The tunneled application itself
152+
153+
Disable Proxy Protocol temporarily to isolate whether it's the source of connection issues.
154+
155+
## Best Practices
156+
157+
### Minimize Proxy Hops
158+
159+
To ensure optimal tunnel performance and reliability, minimize the number of hops through proxies for any tunnels. Each additional proxy hop can introduce latency, potential points of failure, and complicate troubleshooting. Direct connections or configurations with fewer intermediary proxies will generally provide better performance and stability.

mkdocs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ extra:
5656

5757
plugins:
5858
- search
59-
59+
6060
markdown_extensions:
6161
- attr_list
6262
- md_in_html
@@ -130,6 +130,7 @@ nav:
130130
- Manage tunnels: uplink/manage-tunnels.md
131131
- Monitor tunnels: uplink/monitoring-tunnels.md
132132
- REST API: uplink/rest-api.md
133+
- Troubleshooting: uplink/troubleshooting.md
133134

134135
- Inlets Cloud:
135136
- Overview: cloud/index.md

0 commit comments

Comments
 (0)