Git Product home page Git Product logo

kubectl-kcn's Introduction

kubectl-kcn

A kubectl plugin which makes it simple to ssh into nodes within your cluster.

Requirements

This script heavily relies on your 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 in the $PATH of your shell. Once in the $PATH run:

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:

kubectl n [options] [node]

For a complete list of options run:

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:

# Defaults
Host *
  ServerAliveInterval 120
  ServerAliveCountMax 30
  Compression yes
  LogLevel INFO
  VisualHostKey yes

Host bastion
  HostName bastion.example.com
  User ec2-user
  IdentityFile ~/.ssh/bastion_private_key.pem

Host *.us-west-2.compute.internal
  IdentityFile ~/.ssh/node_private_key.pem
  User ec2-user
  ProxyCommand ssh bastion -W %h:%p

kubectl-kcn's People

Contributors

snowmean avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

kubectl-kcn's Issues

Update the caching mechanism to be more within this function and remove the line...

Something like the below but actually working.


kubectl-kcn/kcn

Lines 11 to 16 in de6dfdf

# @todo TODO Update the caching mechanism to be more within this function and remove the lines in the other functions
# BODY Something like the below but actually working.
# function check_cache {
# data=$(grep "$1,$2" $FILE_LOCATION 2> /dev/null) | awk -F\, '{print $3}'
# if [ "$data" != "" ] ; then
# >&2 echo "Cache hit for $1"


This issue was generated by todo based on a TODO comment in de6dfdf. It's been assigned to @marjamis because they committed the code.

Update the caching mechanism

Something like the below but actually working. Also remove the lines in the other functions


kubectl-kcn/kcn

Lines 31 to 36 in f8364a7

# TODO Update the caching mechanism
# BODY Something like the below but actually working. Also remove the lines in the other functions
# function check_cache {
# data=$(grep "$1,$2" $FILE_LOCATION 2> /dev/null) | awk -F\, '{print $3}'
# if [ "$data" != "" ] ; then
# >&2 echo "Cache hit for $1"


This issue was generated by todo based on a TODO comment in f8364a7. It's been assigned to @marjamis because they committed the code.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.