Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marjamis/kubectl-kcn
A script and kubectl plugin which makes it easier to ssh into nodes within your cluster.
https://github.com/marjamis/kubectl-kcn
kubectl kubectl-plugins kubernetes
Last synced: 2 months ago
JSON representation
A script and kubectl plugin which makes it easier to ssh into nodes within your cluster.
- Host: GitHub
- URL: https://github.com/marjamis/kubectl-kcn
- Owner: marjamis
- License: mit
- Created: 2018-06-15T00:11:10.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-19T04:32:40.000Z (over 4 years ago)
- Last Synced: 2024-08-02T06:13:03.480Z (6 months ago)
- Topics: kubectl, kubectl-plugins, kubernetes
- Language: Shell
- Homepage:
- Size: 12.7 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-kubectl-plugins - kubectl-kcn
README
# kubectl-kcn
A kubectl plugin which makes it simple to ssh into nodes within your cluster.### Requirements
* bash
* ssh
* kubectl
* [AWS CLI](https://docs.aws.amazon.com/cli/latest/userguide/installing.html)
* This [script](./kubectl-n)This script heavily relies on your [ssh_config](https://linux.die.net/man/5/ssh_config) to determine how the connections are made to the nodes which allows you to easily connect to the nodes based on your unique networking configuration.
This is made simpler by flags which will allow you to select what value is passed into the ssh command, i.e. hostname/nodename, private-ip (as registered to k8s) or public-ip (obtained using AWS API calls).
### How to use
Install the plugin by having the [script](./kubectl-n) in the $PATH of your shell. Once in the $PATH run:
```bash
kubectl plugin list
```
to ensure kubectl can find the plugin and it will use it. Once properly in place the plugin can be used by running:
```bash
kubectl n [options] [node]
```
For a complete list of options run:
```bash
kubectl n -h
```More information about kubectl plugins in general can be found here: https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/
### Samples
Sample ~/.ssh/config file:
```bash
# Defaults
Host *
ServerAliveInterval 120
ServerAliveCountMax 30
Compression yes
LogLevel INFO
VisualHostKey yesHost bastion
HostName bastion.example.com
User ec2-user
IdentityFile ~/.ssh/bastion_private_key.pemHost *.us-west-2.compute.internal
IdentityFile ~/.ssh/node_private_key.pem
User ec2-user
ProxyCommand ssh bastion -W %h:%p
```