GithubHelp home page GithubHelp logo

kubectl-plugins's Introduction

kubectl-plugins

Some of my plugins for kubectl.

Installation

Clone the repo and add it to your path (or download individual files and make sure they are executable and on your path).

For Example, to install these plugins in $HOME/kubectl-plugins, do the following:

git clone https://github.com/luksa/kubectl-plugins $HOME/kubectl-plugins
export PATH=$PATH:$HOME/kubectl-plugins

Plugins

kubectl force delete

Force deletes an object by removing its finalizers and then deleting it.

Example usage:

kubectl force delete po my-stuck-pod

kubectl really get all

Lists absolutely all resources in a namespace, not just the ones returned by kubectl get all.

Example usage:

# List all resources in the current namespace
kubectl really get all

# List all resources in the specified namespace
kubectl really get all -n my-namespace

# List all resources in the whole cluster (all cluster-scoped 
# resources and all namespaced resources in all namespaces)
kubectl really get all --all-namespaces

# List all resources in the whole cluster with the label foo=bar
kubectl really get all --selector foo=bar

# List all resources in the whole cluster in YAML format
kubectl really get all -o yaml

kubectl really delete all

Deletes absolutely all resources in a namespace, not just the ones that kubectl delete all deletes.

Example usage:

kubectl really delete all
kubectl really delete all -n some-namespace

kubectl ssh node

Provider-agnostic way of opening a remote shell to a Kubernetes node.

Enables you to access a node even when it doesn't run an SSH server or when you don't have the required credentials. Also, the way you log in is always the same, regardless of what provides the Kubernetes cluster (e.g. Minikube, Kind, Docker Desktop, GKE, AKS, EKS, ...)

You must have cluster-admin rights to use this plugin.

The primary focus of this plugin is to provide access to nodes, but it also provides a quick way of running a shell inside a pod.

Example usage:

kubectl ssh node             # access the node in a single-node cluster 
kubectl ssh node my-node     # access a node in a multi-node cluster

You can get your node name with the kubectl get nodes command.

You can also execute a command inside the node and quit like with command below:

kubectl ssh node my-node ls   # access a node in a multi-node cluster and execute ls

Pull requests welcome

If anyone wants to help improve these plugins, please feel free to submit a pull request any time.

I don't have time to polish these plugins or create the krew metadata and submit them to the krew plugin repository. If you can do this, I and the rest of the Kubernetes community will be forever grateful!

kubectl-plugins's People

Contributors

bobmayuze avatar ildar-shaimordanov avatar luksa avatar smutel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

kubectl-plugins's Issues

Send complex command

Hi, very nice work, but I have an issue sending command e.g. ls -l:

"...... node ls -l
Error: must specify one of -f and -k

error: unknown command "ls -"
See 'kubectl create -h' for help and examples"

Any idea?
BR
Vaggelis

Terminal is messed up in `kubectl ssh node`

This is the first time I try to use kubectl ssh node, and the terminal is messed up:

$ kubectl ssh node ip-10-0-87-61.us-west-2.compute.internal
Created pod/ssh-node-646dc
Waiting for container to start...
If you don't see a command prompt, try pressing enter.

                                                      [root@ip-10-0-87-61 /]#
                                                                              [root@ip-10-0-87-61 /]# ls
                                                                                                        bin   dev  home  lib    local  mnt  proc  run   srv  tmp  var
                         boot  etc  host  lib64  media  opt  root  sbin  sys  usr
                                                                                 [root@ip-10-0-87-61 /]# reset
[root@ip-10-0-87-61 /]# echo $TERM
                                  xterm
                                       [root@ip-10-0-87-61 /]# ls /
                                                                   bin   dev  home  lib    local  mnt  proc  run   srv  tmp  var
                                                                                                                                boot  etc  host  lib64  media  opt  root  sbin  sys  usr

Creating Krew Metadata for kubectl-ssh plugin

Hi @luksa, I have found the kubectl-ssh plugin of yours interesting and helpful. I found that you need someone to help create a krew index for it . Can I help you with it? I have sent you an email also regarding this.

If yes, then please let me know.

kubectl ssh doesn't pick the `--kubeconfig` option

Using kubectl ssh node <node-name> --kubeconfig my-file.yaml will not work on the K8s cluster of the configuration file

@luksa Is this something we want to support? What about the rest of the kubectl options? What about the rest of the commands?
I am not proficient in BASH programming but would like to contribute this if seen as useful

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.