Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to extract keys not starting with /kubernetes.io/ ? #174

Open
ybrock opened this issue Dec 9, 2024 · 2 comments
Open

how to extract keys not starting with /kubernetes.io/ ? #174

ybrock opened this issue Dec 9, 2024 · 2 comments

Comments

@ybrock
Copy link

ybrock commented Dec 9, 2024

Hi,

Is there a way to extract keys and values stored elsewhere than in /kubernetes.io/ ?

I try to extract everything from an etcd backup taken on Openshift with etcdctl snapshot , and auger gives a warning and does not produce output for keys other than the one starting by /kubernetes.io/. Is there a way to extract objects located in /openshift.io/ for example ?

I use :

auger extract -f $DBFILE --fields=key,value

to extract everything in the snapshot to backup my openshift clusters.

We can see that trying to extract a key outside /kubernetes.iodoes not succeed :

auger extract -f snapshot_2024-11-26_154401.db -k /openshift.io/routes/openshift-console/console
Error: error decoding from application/vnd.kubernetes.storagebinary: no kind "Route" is registered for version "route.openshift.io/v1" in scheme "pkg/runtime/scheme.go:100"

Am I missing something ?

Kind regards

@siyuanfoundation
Copy link
Contributor

Hi @ybrock,

auger uses APIs in k8s.io/apimachinery/pkg/runtime/schema to decode the data. In order to decode types outside /kubernetes.io, you would need to provide your own decoder in

var Codecs = serializer.NewCodecFactory(Scheme)

@ybrock
Copy link
Author

ybrock commented Jan 13, 2025

Hello,
Thank you for your input.
I made a fork to try this and I have something working. I was able to add the Openshift API. I had to comment some objects in gen_scheme.sh as well.

You can have a look at https://github.com/ybrock/auger if you want

Thank you
Regards

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants