ashleyschuett / kubeconfig-cleanup Goto Github PK
View Code? Open in Web Editor NEWGet rid of non responsive clusters, and unused users
License: Apache License 2.0
Get rid of non responsive clusters, and unused users
License: Apache License 2.0
Plugins were fundamentally changed in Kubernetes v1.12.x. This should be updated to work with the new plugin mechanism.
I just discovered this project and am keen to give it a try. I followed the instructions in the README to clone the repo into the .kube/plugins/kubeconfig-cleanup
folder but I get the following error when I try to run it:
$ kubectl plugin kubeconfig-cleanup
error: fork/exec ./cleanup: exec format error
I also tried to grab the source with go get
but get an error with that too:
# github.com/ashleyschuett/kubeconfig-cleanup/pkg/config
pkg/config/config.go:164:52: cannot use m.getContextsUser(context) (type *"k8s.io/client-go/tools/clientcmd/api".AuthInfo) as type *"k8s.io/kubernetes/vendor/k8s.io/client-go/tools/clientcmd/api".AuthInfo in assignment
pkg/config/config.go:166:118: cannot use "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions literal (type "k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions) as type "k8s.io/kubernetes/vendor/k8s.io/apimachinery/pkg/apis/meta/v1".GetOptions in argument to client.CoreV1().ConfigMaps("k8s.io/apimachinery/pkg/apis/meta/v1".NamespacePublic).Get
Any suggestions? :-)
I get this when trying to run:
Testing context's 'gke-skeenan-eaa3d8e68f' cluster...
error converting to clientset: failed to create API client: No Auth Provider found for name "gcp"
Remove 'gke-skeenan-eaa3d8e68f' from context (Y/n)? panic: reflect: call of reflect.Value.Type on zero Value
goroutine 75 [running]:
reflect.Value.Type(0x0, 0x0, 0x0, 0x1c81aa0, 0x1b5d640)
/usr/local/Cellar/go/1.10.3/libexec/src/reflect/value.go:1713 +0x16d
github.com/ashleyschuett/kubeconfig-cleanup/vendor/github.com/imdario/mergo.Merge(0x1a85600, 0xc4203ec000, 0x1a85600, 0x0, 0xc42039c498, 0xc420396301)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/vendor/github.com/imdario/mergo/merge.go:95 +0x114
github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/client-go/tools/clientcmd.(*DirectClientConfig).getAuthInfo(0xc4203b2000, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, ...)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/client-go/tools/clientcmd/client_config.go:423 +0x2df
github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/client-go/tools/clientcmd.(*DirectClientConfig).ClientConfig(0xc4203b2000, 0x0, 0x0, 0x0)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/client-go/tools/clientcmd/client_config.go:113 +0x71
github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig.ToClientSet(0xc4203991a0, 0xc42039a6f0, 0x0, 0x0)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/kubernetes/cmd/kubeadm/app/util/kubeconfig/kubeconfig.go:80 +0x80
github.com/ashleyschuett/kubeconfig-cleanup/pkg/config.(*Manager).Validate(0xc4201ed500, 0xc42016c960, 0x0, 0x0, 0x0)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/pkg/config/config.go:163 +0x195
github.com/ashleyschuett/kubeconfig-cleanup/pkg/config.(*Manager).ValidateAndAddToWorkqueue(0xc4201ed500, 0xc42033e5b0, 0x7, 0xc42016c960)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/pkg/config/workqueue.go:26 +0x3c
created by github.com/ashleyschuett/kubeconfig-cleanup/pkg/config.(*Manager).Run
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/pkg/config/config.go:64 +0xc1
Hi,
Getting a panic directly after involvement.
$ k plugin kubeconfig-cleanup
[kubeconfig] Using default path '$HOME/.kube/config'
| panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x80 pc=0x19a6603]
goroutine 23 [running]:
github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/client-go/kubernetes.(*Clientset).CoreV1(...)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/vendor/k8s.io/client-go/kubernetes/clientset.go:273
github.com/ashleyschuett/kubeconfig-cleanup/pkg/config.(*Manager).Validate(0xc420312940, 0xc42028f2c0, 0x0, 0x0, 0x0)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/pkg/config/config.go:164 +0x1a3
github.com/ashleyschuett/kubeconfig-cleanup/pkg/config.(*Manager).ValidateAndAddToWorkqueue(0xc420312940, 0xc4202befc0, 0x15, 0xc42028f2c0)
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/pkg/config/workqueue.go:26 +0x3c
created by github.com/ashleyschuett/kubeconfig-cleanup/pkg/config.(*Manager).Run
/Users/ashley/go/src/github.com/ashleyschuett/kubeconfig-cleanup/pkg/config/config.go:64 +0xc1
error: exit status 2
Hi,
When I run ./install.sh
I got this error:
./install.sh: 3: set: Illegal option -o pipefail
https://github.com/GoogleContainerTools/krew
Krew makes it easy to package and distribute plugins for kubectl. This plugin would be also a great addition there.
Hi Ashley,
Thx for switching to goreleaser :)
I found some issues with the new installation procedure:
export BINARY=kubeconfig-cleanup_1.0.1_Linux_x86_64.tar.gz
curl -LO -o cleanup https://github.com/ashleyschuett/kubeconfig-cleanup/releases/download/v1.0.1/$BINARY && \
curl -LO https://raw.githubusercontent.com/ashleyschuett/kubeconfig-cleanup/v1.0.1/plugin.yaml && \
mkdir ~/.kube/plugins/kubeconfig-cleanup && mv cleanup plugin.yaml
error: fork/exec ./cleanup: exec format error
)chmod +x
), otherwise error: fork/exec ./cleanup: permission denied
curl -LO -o
does not work because -o
has no effect here (just remove -O
to fix)mkdir
should use option -p
to not error out when plugins does not exist or when kubeconfig-cleanup already exists (e.g. upgrade)mv
needs a target folder, i.e. mv cleanup plugin.yaml ~/.kube/plugins/kubeconfig-cleanup
Will file PR :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.