Coder Social home page Coder Social logo

kubectl-extras's Introduction

kubectl-extras

This repository contains a list of small and useful kubectl plugins I use on a daily basis.

plugin description
ca-cert print PEM CA certificate of current cluster
extract-context extract current-context on kubectl as a kubeconfig yaml
gke-ssh SSH into the GKE node the pod is running on
gke-ui launch GKE web interface
mtail tail logs from multiple pods matching label selector
refresh-tokens make a call to all clusters in kubeconfig to refresh access tokens
rm-standalone-pods remove all pods without owner references
view-secret decode secrets

You can install these plugins on your machine with krew plugin manager: https://github.com/GoogleContainerTools/krew

kubectl krew install <plugin-name>

kubectl-extras's People

Contributors

ahmetb avatar mariusv avatar muenchdo avatar seboudry avatar trecloux 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

kubectl-extras's Issues

krew installs an old version of view-secret plugin

Hi,

I have view-secret plugin installed using krew 0.3.0 and I've run into the issue fixed by #4. Turns out that krew installs an older version of the plugin (from before that fix) and believes it's the latest available. I'm not sure what has to be updated where but it would be nice to have the latest version easily available.

Thank you!

[krew] Distribute with license

👋 Hello, maintainer of the kubectl plugin manager krew here.

Thank you for your commitment to open source by making this plugin available via krew!

Krew wants to give credit where credit is due by installing the proper license file for the plugins it distributes. However, your plugin was found to not contain any license file. We wanted to remind you that if you're using a license such as Apache 2.0, you should be bundling your LICENSE file with your plugin’s distributions.

What do you have to do?

  • Please ensure your GitHub repository has a license file.
  • Make sure your archive file (.tar.gz or .zip) contains the license file.
  • Please submit a pull-request to krew-index and update the files: section to copy the file to the installation directory. Have a look at this PR for an example: https://github.com/kubernetes-sigs/krew-index/pull/314/files

If you need further assistance, don't hesitate to ask for help.

[mtail] - add support for pods with multiple containers

Often pods have more than one container. In this case mtails returns :

+ kubectl logs --follow prometheus-main-0 --tail=10
+ kubectl logs --follow prometheus-main-1 --tail=10
Error from server (BadRequest): a container name must be specified for pod prometheus-main-1, choose one of: [prometheus prometheus-config-reloader rules-configmap-reloader]
Error from server (BadRequest): a container name must be specified for pod prometheus-main-0, choose one of: [prometheus prometheus-config-reloader rules-configmap-reloader]

solution :
additional -c parameter to specify container would solve the case

view-secret mapfile dependency

On latest macOS, the system version of Bash is 3.2.57, which does not support mapfile built-in. The script uses a #!/usr/bin/env bash shebang, so it is running via the standard bash, therefore resulting in an error:

❯ kubectl view-secret test-secret
/Users/me/.krew/bin/kubectl-view_secret: line 28: mapfile: command not found

I use ZSH so I have no interest in maintaining a separate bash install via brew, would be very nice if it could be made more portable :)

Versions:

krew         dc2f2e1ec8a0acb6f3e23580d4a8b38c44823e948c40342e13ff6e8e12edb15a
view-secret  208fde0b9f42ef71f79864b1ce594a70832c47dc5426e10ca73bf02e54d499d0
kubectl      v1.14.3
macOS        Mojave_10.14.6_18G87
bash         3.2.57(1)-release

[mtail] - How to view logs of a namespace and live tail?

I am trying to tail logs of pods in a platform namespace and can't figure out where to specify the platform namespace.

I've tried this so far.

root@1db5fb660216:~# kubectl mtail app=flux 
root@1db5fb660216:~# kubectl -n platform mtail app=flux 
Error: unknown command "mtail" for "kubectl"
Run 'kubectl --help' for usage.
root@1db5fb660216:~#
root@1db5fb660216:~# kubectl mtail app=flux -n platform
The general script's help msg
Usage: /root/.krew/bin/kubectl-mtail [-c|--container <arg>] [-h|--help] <label-selector>
        <label-selector>: Label selector to use, comma separated, i.e. app=prometheus,tier=system
        -c,--container: specify container (no default)
        -h,--help: Prints help
FATAL ERROR: There were spurious positional arguments --- we expect exactly 1 (namely: 'label-selector'), but got 3 (the last one was: 'platform').
root@1db5fb660216:~# 
root@1db5fb660216:~# kubectl mtail -n platform app=flux    
The general script's help msg
Usage: /root/.krew/bin/kubectl-mtail [-c|--container <arg>] [-h|--help] <label-selector>
        <label-selector>: Label selector to use, comma separated, i.e. app=prometheus,tier=system
        -c,--container: specify container (no default)
        -h,--help: Prints help
FATAL ERROR: There were spurious positional arguments --- we expect exactly 1 (namely: 'label-selector'), but got 3 (the last one was: 'app=flux').
root@1db5fb660216:~# 

Also, is there an option to live tail logs, something like kubectl logs -f <pod_name>

Feature request: Namespace support for view-secret

Great plugins in here! :D
It would be awesome if the view-secret plugin could support namespaces, so I can print out a decoded secret from a namespace other than the one currently set in the context.

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.