Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/u2takey/kubectl-clusters
https://github.com/u2takey/kubectl-clusters
Last synced: 16 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/u2takey/kubectl-clusters
- Owner: u2takey
- License: apache-2.0
- Created: 2020-02-05T07:49:10.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2023-02-28T02:08:28.000Z (over 1 year ago)
- Last Synced: 2024-10-04T13:30:07.250Z (about 1 month ago)
- Language: Python
- Size: 9.77 KB
- Stars: 19
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# kubectl-cluster
Exec command on multiple clusters.
## Set cluster.ini
Set cluster.ini in current dir or with Env `CLUSTER_CONFIG`
```
➜ cat clusters.ini
[test]
context=cls-test1 namespace=default
context=cls-test2[prod]
context=cls-prod
```clusters.ini is a `INI` like config, in which you can group clusters and set extra args for command.
## Exec
```
# exec in all groups
➜ kubectl clusters all get pod
[GROUP]: test --------------------------------------------------------------------------------
[CLUSTER]: cls-test1 --------------------------------------------------
[DEBUG] kubectl --context=cls-test1 --namespace=default get pod
NAME READY STATUS RESTARTS AGE
nginx-6dc5bfc797-vwdz7 1/1 Running 0 32d[GROUP]: prod --------------------------------------------------------------------------------
[CLUSTER]: cls-prod --------------------------------------------------
[DEBUG] kubectl --context=cls-qcvhpqog get pod
NAME READY STATUS RESTARTS AGE
a4cgfxv7srbfhbsn-78479b5cf7-f85d8 2/2 Running 0 37d# exec in single group
➜ kubectl clusters prod get pod
[GROUP]: prod --------------------------------------------------------------------------------
[CLUSTER]: cls-prod --------------------------------------------------
[DEBUG] kubectl --context=cls-qcvhpqog get pod
NAME READY STATUS RESTARTS AGE
a4cgfxv7srbfhbsn-78479b5cf7-f85d8 2/2 Running 0 37d
```