Skip to content

Commit 31c1515

Browse files
committed
Add README
Signed-off-by: Alex Ellis (OpenFaaS Ltd) <alexellis2@gmail.com>
1 parent 695923d commit 31c1515

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed

README.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
kubetrim
2+
====================================================
3+
4+
Tidy up any old or broken Kubernetes clusters and contexts from your kubeconfig.
5+
6+
kubetrim tries to connect to each cluster in the current kubeconfig file, and removes any that are unreachable, or which error.
7+
8+
## Usage
9+
10+
```bash
11+
$ kubectx
12+
13+
default
14+
do-lon1-openfaas-cluster
15+
kind-2
16+
kind-ingress
17+
18+
$ kubetrim
19+
20+
kubetrim (dev) by Alex Ellis
21+
22+
Loaded: /home/alex/.kube/config. Checking..
23+
- kind-2: ✅
24+
- kind-ingress: ❌ - (failed to connect to cluster: Get "https://127.0.0.1:40349/api/v1/nodes": dial tcp 127.0.0.1:40349: connect: connection refused)
25+
- default: ✅
26+
- do-lon1-openfaas-cluster: ❌ - (failed to connect to cluster: Get "https://da39a3ee5e6b4b0d3255bfef95601890afd80709.k8s.ondigitalocean.co.uk/api/v1/nodes": dial tcp: lookup da39a3ee5e6b4b0d3255bfef95601890afd80709.k8s.ondigitalocean.co.uk on 127.0.0.53:53: no such host)
27+
Updated: /home/alex/.kube/config (in 364ms).
28+
29+
$ kubectx
30+
31+
default
32+
kind-2
33+
```
34+
35+
Try out kubetrim without writing changes to the kubeconfig file:
36+
37+
```bash
38+
$ kubetrim --dry-run
39+
```
40+
41+
Use a different kubeconfig file:
42+
43+
```bash
44+
$ KUBECONFIG=$HOME/.kube/config.bak kubetrim
45+
```
46+
47+
## Installation
48+
49+
Getting `kubetrim` with arkade:
50+
51+
```bash
52+
curl -sfLS https://get.arkade.dev | sh
53+
54+
arkade get kubetrim
55+
```
56+
57+
## License
58+
59+
MIT license

hack/hashgen.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
for f in bin/kubetrim*; do shasum -a 256 $f > $f.sha256; done

0 commit comments

Comments
 (0)