Merge pull request #33856 from fjammes/patch-1

Update socks5-proxy-access-api.md
This commit is contained in:
Kubernetes Prow Robot
2022-06-14 15:19:34 -07:00
committed by GitHub
@@ -87,14 +87,14 @@ When you set the `https_proxy` variable, tools such as `curl` route HTTPS traffi
you configured. For this to work, the tool must support SOCKS5 proxying. you configured. For this to work, the tool must support SOCKS5 proxying.
{{< note >}} {{< note >}}
In the URL https://localhost/api, `localhost` does not refer to your local client computer. In the URL https://localhost:6443/api, `localhost` does not refer to your local client computer.
Instead, it refers to the endpoint on the remote server knows as `localhost`. Instead, it refers to the endpoint on the remote server known as `localhost`.
The `curl` tool sends the hostname from the HTTPS URL over SOCKS, and the remote server The `curl` tool sends the hostname from the HTTPS URL over SOCKS, and the remote server
resolves that locally (to an address that belongs to its loopback interface). resolves that locally (to an address that belongs to its loopback interface).
{{</ note >}} {{</ note >}}
```shell ```shell
curl -k -v https://localhost/api curl -k -v https://localhost:6443/api
``` ```
To use the official Kubernetes client `kubectl` with a proxy, set the `proxy-url` element To use the official Kubernetes client `kubectl` with a proxy, set the `proxy-url` element
@@ -105,7 +105,7 @@ apiVersion: v1
clusters: clusters:
- cluster: - cluster:
certificate-authority-data: LRMEMMW2 # shortened for readability certificate-authority-data: LRMEMMW2 # shortened for readability
server: https://localhost # the "Kubernetes API" in the diagram above server: https://<API_SERVER_IP_ADRESS>:6443 # the "Kubernetes API" server, in other words the IP address of kubernetes-remote-server.example
proxy-url: socks5://localhost:1080 # the "SSH SOCKS5 proxy" in the diagram above (DNS resolution over socks is built-in) proxy-url: socks5://localhost:1080 # the "SSH SOCKS5 proxy" in the diagram above (DNS resolution over socks is built-in)
name: default name: default
contexts: contexts:
@@ -142,4 +142,4 @@ Type `unset https_proxy` in a terminal to stop forwarding http traffic through t
## Further reading ## Further reading
* [OpenSSH remote login client](https://man.openbsd.org/ssh) * [OpenSSH remote login client](https://man.openbsd.org/ssh)