https://github.com/bpetit/kubectl-it
https://github.com/bpetit/kubectl-it
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/bpetit/kubectl-it
- Owner: bpetit
- Created: 2020-02-04T14:15:55.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-05T09:03:23.000Z (about 6 years ago)
- Last Synced: 2026-01-27T22:54:55.210Z (5 months ago)
- Language: Python
- Size: 30.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# kubectl-it
**Warning: this is work in progress**
kubectl it is a kubectl plugin to make kubernetes clusters fleet management easier.
## Usage
**kubectl it** manages kubernetes contexts for you, as distinct kubeconfig files (let's forget this **gigantic** and unmanageable ~/.kube/.config).
Each time you add add a context, from either an original kubeconfig file:
```sh
kubectl it add where/to/store/in/the/configuration/tree kubeconfig --path path/to/original/kubeconfig --original-name name-in-original-kubeconfig --name name-in-the-config-tree
```
or generating it with AWS EKS IAM authenticator:
```sh
kubectl it add where/to/store/in/the/configuration/tree awseks --name mycluster --profile my-iam-profile --region eu-west-2 --cluster-name mycluster --name name-in-the-config-tree
```
it will store those new kubconfig files in a configuration tree as the one below:
```
/home/bpetit/.kube/kubectlit
└── configs
├── foo
│ ├── bar
│ │ └── monitoring-clusters
│ │ └── monitoring-clu01_kube.config
│ └── foo
│ └── bar
│ └── monitoring-clusters
│ └── monitoring-clu02_kube.config
├── production
│ ├── monitoring
│ │ └── monitoring-clusters
│ │ └── monitoring-clu02_kube.config
│ └── webapps
│ └── app01
│ ├── admin-on-app01_kube.config
│ └── unprivileged-on-app01_kube.config
├── staging
│ └── webapps
│ └── app01
│ └── admin-on-app01_kube.config
└── where
└── to
└── store
└── in
└── the
└── configuration
└── tree
└── mycluster_kube.config
```
Then you can select which context or multiple contexts and run arbitrary actions on it (handy for cluster components upgrades for example).
To list what's inside a category/folder:
```sh
$ kubectl it ls production/webapps/app01
app01/
admin-on-app01_kube.config
unprivileged-on-app01_kube.config
```
To run an action on those contexts (be careful with what you do):
```sh
kubectl it run production/webapps/app01 kubectl get po -l app=myapp
```
or:
```sh
kubectl it run production/webapps/app01 ./upgrade.sh
```
## Run tests
To validate that everything is working, you can list all kubeconfig files stores in the tree:
```sh
kubectl it ls /
```
## Author
👤 **Benoit Petit**
* Website: https://bpetit.nce.re
## 🤝 Contributing
Contributions, issues and feature requests are welcome!
Feel free to check [issues page](https://github.com/bpetit/kubectl-it/issues).
## Show your support
Give a ⭐️ if this project helped you!
***
_This README was generated with ❤️ by [readme-md-generator](https://github.com/kefranabg/readme-md-generator)_