From c265dbae03637dd6be467d4ab19904f12a0d6cab Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Wed, 10 Dec 2025 11:29:26 +0100 Subject: [PATCH 1/3] docs(k8s): fix formatting external commit --- .../how-to/connect-private-cluster.mdx | 68 +++++++++---------- pages/kubernetes/menu.ts | 5 ++ 2 files changed, 37 insertions(+), 36 deletions(-) diff --git a/pages/kubernetes/how-to/connect-private-cluster.mdx b/pages/kubernetes/how-to/connect-private-cluster.mdx index 15862d9bcd..a0c2d29b22 100644 --- a/pages/kubernetes/how-to/connect-private-cluster.mdx +++ b/pages/kubernetes/how-to/connect-private-cluster.mdx @@ -29,71 +29,67 @@ To connect to the fully isolated Kubernetes Kapsule control plane, you can open ### Finding your cluster's URL -In the Scaleway console, go to the [Kubernetes product section](https://console.scaleway.com/kubernetes), then click your cluster's name. - -Scroll down to the **Network** section, and click on the **URL** value. The URL is copied to your clipboard. +1. Click **Kubernetes** in the **Containers** section of the [Scaleway console](https://console.scaleway.com) side menu. The Kubernetes dashboard displays. +2. From the drop-down menu, select the geographical region you want to manage. +3. Click on the name of the cluster you want to connect to. The cluster overview page displays. +4. Scroll down to the **Network** section, then click the **URL** value. The URL is copied to your clipboard. ### Opening the SSH tunnel Open a terminal on your computer, then run the following command: -```bash -ssh -fNL 6443: bastion@ -p -``` - -Make sure to replace the values with the appropriate values. `` should end in `:6443`, which is the control plane's port. - -Here is an example command: - -```bash -ssh -fNL 6443:1379355f-f36a-4383-9791-b6c573dea811.api.k8s.fr-par.scw.cloud:6443 bastion@51.159.153.192 -p 61000 -``` + ```bash + ssh -fNL 6443: bastion@ -p + ``` + Make sure to replace the values with the appropriate values. `` should end in `:6443`, which is the control plane's port. - + Here is an example command: -The command contains several `ssh` flags: + ```bash + ssh -fNL 6443:1379355f-f36a-4383-9791-b6c573dea811.api.k8s.fr-par.scw.cloud:6443 bastion@51.159.153.192 -p 61000 + ``` -- `-f` runs the command in the background; -- `-N` tells `ssh` not to run a remote command, which is the case here since we only want to port-forward; -- `-L` sets up port-forwarding from a local port (here, port `6443`) and a given host and port on the remote side; -- `-p` indicates the remote SSH port. + + The command contains several `ssh` flags: - + - `-f` runs the command in the background; + - `-N` tells `ssh` not to run a remote command, which is the case here since we only want to port-forward; + - `-L` sets up port-forwarding from a local port (here, port `6443`) and a given host and port on the remote side; + - `-p` indicates the remote SSH port. + A tunnel to the Kubernetes Kapsule control plane is opened: all local traffic to port `6443` will now be redirected to the control plane through the Public Gateway's SSH bastion. ## Accessing the cluster -### Editing the `/etc/hosts` file +### Editing the /etc/hosts file The downloaded `kubeconfig` file points to the control plane's URL, which is currently unreachable due to its lack of public IP. However, you can redirect traffic to your local port-forwarded port by editing your `/etc/hosts` file. Open the `/etc/hosts` file on your computer using a text editor, and add the following line: -``` -127.0.0.1 -``` + ``` + 127.0.0.1 + ``` -Using the same values as the previous example, the line would be: + Using the same values as the previous example, the line would be: -``` -127.0.0.1 1379355f-f36a-4383-9791-b6c573dea811.api.k8s.fr-par.scw.cloud -``` + ``` + 127.0.0.1 1379355f-f36a-4383-9791-b6c573dea811.api.k8s.fr-par.scw.cloud + ``` -Processes on your computer now resolve your cluster's hostname to `127.0.0.1`, your `localhost` address. + Processes on your computer now resolve your cluster's hostname to `127.0.0.1`, your `localhost` address. ### Using `kubectl` You can now manage your cluster using `kubectl`. Run the following command: -```bash -kubectl get nodes -``` + ```bash + kubectl get nodes + ``` A list of nodes from your Kapsule cluster should appear. - -You need to run the `ssh` command again every time your computer reboots. This can be automated using various tools such as shell scripts. - + You need to run the `ssh` command again every time your computer reboots. This can be automated using various tools such as shell scripts. diff --git a/pages/kubernetes/menu.ts b/pages/kubernetes/menu.ts index 3f78eaf718..b67f27b700 100644 --- a/pages/kubernetes/menu.ts +++ b/pages/kubernetes/menu.ts @@ -42,6 +42,11 @@ export const kubernetesMenu = { label: 'Connect to a cluster with kubectl', slug: 'connect-cluster-kubectl', }, + { + label: 'Connect to a cluster within a Private Network', + slug: 'connect-private-cluster', + }, + { { label: 'Manage Kapsule node pools', slug: 'manage-node-pools', From 96964801bf0808d8056374ab1b8db889d0b7147f Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Wed, 10 Dec 2025 11:31:40 +0100 Subject: [PATCH 2/3] fix(k8s): fix typo --- pages/kubernetes/menu.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/pages/kubernetes/menu.ts b/pages/kubernetes/menu.ts index b67f27b700..48ce6e5af4 100644 --- a/pages/kubernetes/menu.ts +++ b/pages/kubernetes/menu.ts @@ -46,7 +46,6 @@ export const kubernetesMenu = { label: 'Connect to a cluster within a Private Network', slug: 'connect-private-cluster', }, - { { label: 'Manage Kapsule node pools', slug: 'manage-node-pools', From 699d7e4dc3ce66a837afd75dd592a99c5f581bb6 Mon Sep 17 00:00:00 2001 From: Benedikt Rollik Date: Wed, 10 Dec 2025 11:34:59 +0100 Subject: [PATCH 3/3] docs(k8s): fix headline --- pages/kubernetes/how-to/connect-private-cluster.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/kubernetes/how-to/connect-private-cluster.mdx b/pages/kubernetes/how-to/connect-private-cluster.mdx index a0c2d29b22..41f349dd55 100644 --- a/pages/kubernetes/how-to/connect-private-cluster.mdx +++ b/pages/kubernetes/how-to/connect-private-cluster.mdx @@ -80,7 +80,7 @@ Open the `/etc/hosts` file on your computer using a text editor, and add the fol Processes on your computer now resolve your cluster's hostname to `127.0.0.1`, your `localhost` address. -### Using `kubectl` +### Using kubectl You can now manage your cluster using `kubectl`. Run the following command: