简体   繁体   English

如何列出kubernetes对象的所有resourceVersion?

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

How does one list all the resourceVersion of a Kubernetes object? 如何列出Kubernetes对象的所有resourceVersion?

For instance, I want to retrieve all the resourceVersions of a configmap from the past. 例如,我想从过去检索configmap的所有resourceVersions。 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). 如果这是可能的,我想观看来自configmap的过去resourceVersion的所有更改(这是我的解决方法,我想尝试)。 Because currently, K8s does not support rollback of ConfigMaps. 因为目前,K8s不支持回滚ConfigMaps。

Here is the ongoing feature request for that:- https://github.com/kubernetes/kubernetes/issues/22368 以下是正在进行的功能请求: - https://github.com/kubernetes/kubernetes/issues/22368

How does one list all the resourceVersion of a Kubernetes object? 如何列出Kubernetes对象的所有resourceVersion?

Not supported by the API side yet as of this writing. 截至本文撰写时,API方不支持。 (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 . (另外,如问题中所述)另外,删除的对象可以保存在etcd中以获取--auto-compaction-retention的值,我想你可以改变那个值,如果你想让对象更长,并用etdctl查询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. 另一种强力选项是备份 etcd然后在其他节点上恢复它,然后手动查询该特定快照的etcd。

For example to get the kube-proxy ConfigMap: 例如,获取kube-proxy ConfigMap:

$ etcdctl --endpoints=https://:2379 get "/registry/configmaps/kube-system/kube-proxy" --cert=client.crt --key=client.key --cacert=ca.crt $ 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. 正如您所提到的,有一个历史版本的功能请求。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 在 pod 列表的 Kube.netes 监视操作中,resourceVersion 是否保证单调递增? - In a Kubernetes watch operation for list of pod, are resourceVersion guaranteed to be monotonically increasing? 有没有一种方法可以在特定的resourceVersion上检索kubernetes资源? - Is there a way to retrieve a kubernetes resource at a specific resourceVersion? kubernetes一直都在看节目列表吗? - Does kubernetes watch show item list first all the time? 如何将所有kubernetes对象包含到一个文件中 - How to include all kubernetes objects into one file 如何将所有证书从一台服务器上的Kubernetes复制到另一台服务器上的Kubernetes? - How to copy all certificates from Kubernetes on one server to Kubernetes on another one? 如何一次性删除 Kubernetes 中的所有资源? - How to delete all resources from Kubernetes one time? 如何修复 metadata.resourceVersion:无效值:“”:必须为更新指定 - How to fix metadata.resourceVersion: Invalid value: "": must be specified for an update Kubernetes-如何列出在特定实例组中运行的所有Pod? - Kubernetes - How to list all pods running in a particular instance group? 如何列出在 kubernetes 中为服务提供流量的所有 pod 的名称 - How to list names of all pods serving traffic behind a service in kubernetes 如何在 Kubernetes 集群中使用给定的 ConfigMap 列出所有部署 - How to list all deployments using given ConfigMap in Kubernetes cluster
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM