Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucasrodcosta/kubeexec
Enables you to run commands in multiple k8s pods at once
https://github.com/lucasrodcosta/kubeexec
kubectl kubernetes
Last synced: 4 days ago
JSON representation
Enables you to run commands in multiple k8s pods at once
- Host: GitHub
- URL: https://github.com/lucasrodcosta/kubeexec
- Owner: lucasrodcosta
- License: mit
- Created: 2018-12-18T12:45:31.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-07T18:14:40.000Z (over 4 years ago)
- Last Synced: 2024-12-14T23:30:51.414Z (10 days ago)
- Topics: kubectl, kubernetes
- Language: Ruby
- Size: 2.93 KB
- Stars: 10
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubeexec
Enables you to run commands in multiple k8s pods at once (via [itermocil](https://github.com/TomAnthony/itermocil)).
This is the same as running `kubectl exec -c ` in each container.Example:
$ kubeexec my-redis-cluster -c node redis-cli
```
.------------------.------------------.
| (0) redis cli | (1) redis cli |
| | |
|------------------|------------------|
| (2) redis cli | (3) redis cli |
| | |
.------------------.------------------.
| (4) redis cli | (5) redis cli |
| | |
'------------------'------------------'
```## Installation
Just download the [kubeexec.rb](https://raw.githubusercontent.com/lucasrodcosta/kubeexec/master/kubeexec.rb) file (or
any of the releases) and you're good to go.#### Homebrew
$ brew tap lucasrodcosta/kubeexec && brew install kubeexec
## Usage
First find the names of all your pods:
$ kubectl get pods
This will return a list looking something like this:
```bash
NAME READY STATUS RESTARTS AGE
redis-cluster-aba8y 2/2 Running 0 1d
redis-cluster-gc4st 2/2 Running 0 1d
redis-cluster-m8acl 2/2 Running 0 6d
redis-cluster-s20d0 2/2 Running 0 1d
rails-v31-9pbpn 1/1 Running 0 1d
rails-v31-q74wg 1/1 Running 0 1d
```To run the command `/bin/sh` in all pods starting with `redis-cluster`, just run the following:
$ kubeexec redis-cluster /bin/sh
It's very easy to specify a container to run the command:
$ kubeexec redis-cluster -c redis-node /bin/sh