简体   繁体   中英

How does one list all the resourceVersion of a kubernetes object?

How does one list all the resourceVersion of a Kubernetes object?

For instance, I want to retrieve all the resourceVersions of a configmap from the past. If this is possible I would like to watch all the changes from the past resourceVersion(s) of the configmap (this is my workaround, which I would like to try). Because currently, K8s does not support rollback of ConfigMaps.

Here is the ongoing feature request for that:- https://github.com/kubernetes/kubernetes/issues/22368

How does one list all the resourceVersion of a Kubernetes object?

Not supported by the API side yet as of this writing. (Also, as described in the issue) Also, deleted objects can be kept in etcd for the value of --auto-compaction-retention , I suppose you can change that value if you want to keep the objects longer and query etcd with etdctl .

Another sort of brute force option is to back up etcd and then restore it on some other node, then manually query etcd for that particular snapshot.

For example to get the kube-proxy ConfigMap:

$ etcdctl --endpoints=https://:2379 get "/registry/configmaps/kube-system/kube-proxy" --cert=client.crt --key=client.key --cacert=ca.crt

These are some other backup tools:

As you mentioned, there's a feature request for historical versions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM