Skip to content
Snippets Groups Projects
Commit beccd076 authored by marcoemi.poleggi's avatar marcoemi.poleggi
Browse files

Update README.md with tips and tricks

parent 4c5a8f59
No related branches found
No related tags found
No related merge requests found
......@@ -302,3 +302,33 @@ Destroy you cluster.
Snapshot your VM for further use and terminate it.
## Tips and tricks
### Controlling your cluster from a remote console
KinD is not designed to be operated remotely because its security is quite limited. Indeed KinD's
[API frontend](https://kind.sigs.k8s.io/docs/user/configuration/#api-server) listens by default to a local address/port.
However it is possible to [set up an SSH "tunnel"](https://www.ssh.com/academy/ssh/tunneling-example) over which to
[convey control commands from your workstation](https://github.com/kubernetes-sigs/kind/issues/3417):
1. Install `kubectl` on your workstation.
1. Open an SSH tunnel to the instance *from your workstation* (mind that 6443 is the standard kubectl port):
```bash
workstation$ ssh -i YOUR_KEY -o IdentitiesOnly=yes -L 6443:localhost:6443 INSTANCE_USER@INSTANCE_IP
```
1. Add to your KinD config file `kind-config.yaml` the following snippet that fixes the API port:
```yaml
networking:
apiServerPort: 6443
```
1. Recreate your cluster with the new config above.
1. Leave the SSH tunnel connection open! Switch to a different *local* terminal and import the remote cluster config:
```bash
workstation$ scp -i YOUR_KEY -o IdentitiesOnly=yes INSTANCE_USER@INSTANCE_IP:~/.kube/config ~/.kube/
```
Now, you should be able to send commands over the tunnel, e.g.:
```bash
workstation$ kubectl get services
```
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment