Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
lab-k8s
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LSDS
Teaching
Bachelor
Cloud-and-Deployment
lab-k8s
Commits
beccd076
Commit
beccd076
authored
8 months ago
by
marcoemi.poleggi
Browse files
Options
Downloads
Patches
Plain Diff
Update README.md with tips and tricks
parent
4c5a8f59
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
README.md
+30
-0
30 additions, 0 deletions
README.md
with
30 additions
and
0 deletions
README.md
+
30
−
0
View file @
beccd076
...
...
@@ -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
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment