Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ramizpolic/kubesh
Tool to access Kubernetes nodes via SSH
https://github.com/ramizpolic/kubesh
kubectl kubernetes ssh
Last synced: about 6 hours ago
JSON representation
Tool to access Kubernetes nodes via SSH
- Host: GitHub
- URL: https://github.com/ramizpolic/kubesh
- Owner: ramizpolic
- Created: 2019-08-12T17:55:58.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2024-04-12T14:30:06.000Z (7 months ago)
- Last Synced: 2024-04-12T22:18:06.009Z (7 months ago)
- Topics: kubectl, kubernetes, ssh
- Language: Python
- Size: 28.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Kubesh
Tool to access Kubernetes nodes via SSH.
It creates a port-forward against a pod running socat, allowing SSH via localhost, and assigns a shell within the cluster.Install
----
```
$ pip3 install -r requirements.txt
$ export PATH="$PATH:$pwd"
$ kubesh
```Example usage
----
```bash
$ kubesh --help
usage: k8s-worker-ssh.py [-h] [--connect NODE] [--destroy] [--init] [--list]Tool to create an SSH port-forward and shell to a k8s worker node
optional arguments:
-h, --help show this help message and exit
--connect NODE specify node to connect to by name or id
--destroy delete created resources
--init create related resources
--list list nodes in k8s cluster$ kubesh --list
List of nodes:
1 gke-eu-cluster-default-pool-00000000-0000
2 gke-eu-cluster-default-pool-00000001-0001$ kubesh --init
Initialized environment successfully.$ kubesh --connect 1
Assigning pod 'tunneling-bznrfgxo'
Pod created, waiting to be ready...
Pod status is: [Pending]Creating port-forward rules, please wait...
Forwarding from 127.0.0.1:8022 -> 8022
Forwarding from [::1]:8022 -> 8022Initializing SSH connection...
Handling connection for 8022user@gke-eu-cluster-default-pool-00000000-0000:~ $ echo "hello from k8s cluster"
user@gke-eu-cluster-default-pool-00000000-0000:~ $ hello from k8s cluster
user@gke-eu-cluster-default-pool-00000000-0000:~ $$ ./kubesh --destroy
================ Roles
Deleting Role 'tunneling-bznrfgxo'
================ Role Bindings
Deleting Role Binding 'tunneling-bznrfgxo'
================ Namespace
Deleting Namespace 'tunneling'
```License
----
MIT