Skip to content

Commit 2952a20

Browse files
authored
proxy docs (#286)
* proxy using basic auth secrets
1 parent 422eebe commit 2952a20

1 file changed

Lines changed: 115 additions & 0 deletions

File tree

input/kube-cli/site-linking.md

Lines changed: 115 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,3 +137,118 @@ To link sites, you create a `link` resource YAML file on one site and apply that
137137
You can now expose services on the application network.
138138

139139
There are many options to consider when linking sites using the CLI, see [CLI Reference][cli-ref], including *frequently used* options.
140+
141+
<a id="kube-proxy-cli"></a>
142+
## Linking sites through an HTTP proxy
143+
<!--PROCEDURE-->
144+
145+
If your network requires routing through an HTTP CONNECT proxy to reach remote sites, you can configure Skupper links to use a proxy.
146+
This feature is only available when using `link` resources, not tokens.
147+
148+
**Prerequisites**
149+
150+
* Two sites
151+
* At least one site with `enable-link-access` enabled.
152+
* An HTTP CONNECT proxy accessible from the linking site
153+
* Network connectivity from the proxy to the listening site's router endpoints
154+
* The proxy must allow HTTP CONNECT requests to ports 55671 (inter-router) and 45671 (edge). For example, Squid requires:
155+
```
156+
acl skupper_ports port 55671 45671
157+
http_access allow CONNECT skupper_ports
158+
```
159+
160+
To link sites through a proxy, you create a Secret containing the proxy configuration, generate a `link` resource YAML file, reference the proxy Secret in the link settings, and apply that resource to create the link.
161+
162+
**Procedure**
163+
164+
1. On the listening site, make sure link access is enabled:
165+
```bash
166+
skupper site update --enable-link-access
167+
```
168+
169+
2. On the listening site, create a `link` resource YAML file:
170+
```bash
171+
skupper link generate > link.yaml
172+
```
173+
174+
3. Copy the generated `link.yaml` file to the linking site.
175+
176+
4. On the linking site, create a Secret with the proxy configuration:
177+
```yaml
178+
apiVersion: v1
179+
kind: Secret
180+
metadata:
181+
name: my-proxy-config
182+
type: kubernetes.io/basic-auth
183+
stringData:
184+
host: proxy.example.com
185+
port: "3128"
186+
```
187+
Apply the Secret:
188+
```bash
189+
kubectl apply -f proxy-secret.yaml
190+
```
191+
192+
**📌 NOTE**
193+
If your proxy requires authentication, add the username and password to the Secret:
194+
```yaml
195+
apiVersion: v1
196+
kind: Secret
197+
metadata:
198+
name: my-proxy-config
199+
type: kubernetes.io/basic-auth
200+
stringData:
201+
host: proxy.example.com
202+
port: "3128"
203+
username: myuser
204+
password: mypassword
205+
```
206+
207+
5. On the linking site, edit the `link.yaml` file to add the proxy configuration in the settings section:
208+
```yaml
209+
apiVersion: skupper.io/v2alpha1
210+
kind: Link
211+
metadata:
212+
name: link-to-remote-site
213+
spec:
214+
cost: 1
215+
endpoints:
216+
- host: remote-site.example.com
217+
name: inter-router
218+
port: "55671"
219+
- host: remote-site.example.com
220+
name: edge
221+
port: "45671"
222+
tlsCredentials: link-to-remote-site
223+
settings:
224+
proxy-configuration: my-proxy-config
225+
```
226+
where `my-proxy-config` is the name of the Secret created in step 4.
227+
228+
6. On the linking site, apply the `link` resource YAML file to create the link:
229+
```bash
230+
kubectl apply -f link.yaml
231+
```
232+
233+
7. Check the status of the link:
234+
```bash
235+
skupper link status
236+
```
237+
You might need to issue the command multiple times before the link is ready.
238+
239+
If the link remains in "Pending" or "Not Operational" status, check:
240+
241+
* The proxy Secret exists and contains the correct host and port
242+
* The proxy is accessible from the router pod
243+
* Router logs for connection errors: `kubectl logs deployment/skupper-router`
244+
245+
**📌 NOTE**
246+
If you update the proxy Secret, you must trigger a reconciliation to apply the changes:
247+
```bash
248+
kubectl annotate link <link-name> reconcile=$(date +%s) --overwrite
249+
```
250+
251+
All inter-site traffic is protected by mutual TLS and routed through the HTTP CONNECT proxy tunnel.
252+
You can now expose services on the application network.
253+
254+
There are many options to consider when linking sites using the CLI, see [CLI Reference][cli-ref], including *frequently used* options.

0 commit comments

Comments
 (0)