Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabeduke/kubectl-iexec
Kubectl plugin to interactively exec into a pod
https://github.com/gabeduke/kubectl-iexec
kubectl kubectl-plugin kubectl-plugins kubernetes
Last synced: 2 months ago
JSON representation
Kubectl plugin to interactively exec into a pod
- Host: GitHub
- URL: https://github.com/gabeduke/kubectl-iexec
- Owner: gabeduke
- License: mit
- Created: 2019-04-18T21:38:24.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2023-12-28T02:11:06.000Z (about 1 year ago)
- Last Synced: 2024-08-02T06:13:02.778Z (6 months ago)
- Topics: kubectl, kubectl-plugin, kubectl-plugins, kubernetes
- Language: Go
- Homepage:
- Size: 210 KB
- Stars: 132
- Watchers: 4
- Forks: 18
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
- awesome-kubectl-plugins - kubectl-iexec
README
![](https://github.com/gabeduke/kubectl-iexec/workflows/Test/badge.svg)
![](https://github.com/gabeduke/kubectl-iexec/workflows/Lint/badge.svg)
![](https://github.com/gabeduke/kubectl-iexec/workflows/Fmt/badge.svg)# Kubectl Interactive Exec
## Summary
`Kubectl-iexec` is a plugin providing an interactive selector to exec into a running pod. For a search filter, the plugin will return a list of pods and containers that match, then perform a `kubectl exec` to the selection.
_Notes:_
Kubectl >= `v1.12.0` is required for plugins to work
For more information on kuberctl plugins see [documentation](https://kubernetes.io/docs/tasks/extend-kubectl/kubectl-plugins/)
## Usage:
```
$ kubectl iexec --helpKubectl-iexec is an interactive pod and container selector for `kubectl exec`
Arg[1] will act as a filter, any pods that match will be returned in a list
that the user can select from. Subsequent args make up the array of commands that
should be executed on the pod.example:
kubectl iexec busybox /bin/shexample:
kubectl iexec busybox cat /etc/hostsUsage:
iexec [pod filter] [remote command(s)] [flags]Flags:
-c, --container string Container to search
-h, --help help for iexec
--log-level string log level (trace|debug|info|warn|error|fatal|panic)
-x, --naked Decolorize output
-n, --namespace string Namespace to search
-v, --vim-mode Vim Mode enabled
-l, --label string Label selector to filter pods
```[![asciicast](https://asciinema.org/a/kW4u4sPSaFo77O7BaSwMM1Kuh.svg)](https://asciinema.org/a/kW4u4sPSaFo77O7BaSwMM1Kuh)
## Install:
To install the plugin, the binary simply needs to be somewhere on your path in the format kubectl-[plugin_name]. the simplest way to do this is to `go get` the package:
`go get -u github.com/gabeduke/kubectl-iexec`
Alternatively you may pull the binary from the releases page on Github:
Select OS
```bash
# Linux
OS=LINUX# Mac
OS=DARWIN
```Run:
```bash
# Get latest release
TAG=$(curl -s https://api.github.com/repos/gabeduke/kubectl-iexec/releases/latest | grep -oP '"tag_name": "\K(.*)(?=")')# Donwload and extract binary to /usr/local/bin
curl -LO https://github.com/gabeduke/kubectl-iexec/releases/download/${TAG}/kubectl-iexec_${TAG}_${OS:-Linux}_x86_64.tar.gzmkdir -p /tmp/kubectl-iexec
tar -xzvf kubectl-iexec_${TAG}_${OS}_x86_64.tar.gz -C /tmp/kubectl-iexec
chmod +x /tmp/kubectl-iexec/kubectl-iexecsudo mv /tmp/kubectl-iexec/kubectl-iexec /usr/local/bin
```