Comments (10)
Hi @ah8ad3,
Thanks for your reply. It's AKS, which, afaik, doesn't expose etcd - only via the k8s api. I think it's similar with EKS and GKE.
from kubernetes.
Joe Betz thanks. Could you elaborate that?
deleteCollection
sounds helpful, can't find details about it atm.
deleteCollection refers to the ability to perform a delete on a collection of resources, for example:
kubectl delete pods
In the API it would be of the form:
DELETE /api/v1/namespaces/{namespace}/pods
It's also possible to filter the list of resources to delete further using selectors. E.g. to delete only pods with a particular label:
kubectl delete pods -l app=my-app
It would still be helpful if I could use some sort of projection on lists. Let's say I only need the names of 100k items. It'd be silly to fetch gigs of data when all I need is perhaps 10kb. Now as I'm typing this, I wonder if this doesn't happen anyway. I have no knowledge of the internals, but I'd guess that the whole objects are stored in etcd, right? So at least from there the whole thing is retrieved anyway. We'd still not transfer everything along the (long) wire, though.
The Kubernetes API does not support arbitrary projections (it does get requested occasionally, but would be a HUGE project). However, it is possible to get back only the metadata of an object by using PartialObjectMetadata
` which is requested via Accept headers. I don't know if kubectl provides any support for this though. It's primarily used by the garbage collector. It is easy to call from client-go.
from kubernetes.
/sig api-machinery
/sig cli
from kubernetes.
Thanks for raising this issue, did you consider using etcdctl
directly?
from kubernetes.
/cc @jpbetz Thank you! :)
from kubernetes.
Could deleteCollection be used here?
Please reassign to sig-cli is this is purely a kubectl related request.
from kubernetes.
@jpbetz thanks. Could you elaborate that? deleteCollection
sounds helpful, can't find details about it atm.
It would still be helpful if I could use some sort of projection on lists. Let's say I only need the names of 100k items. It'd be silly to fetch gigs of data when all I need is perhaps 10kb. Now as I'm typing this, I wonder if this doesn't happen anyway. I have no knowledge of the internals, but I'd guess that the whole objects are stored in etcd, right? So at least from there the whole thing is retrieved anyway. We'd still not transfer everything along the (long) wire, though.
from kubernetes.
Thanks a lot, really helpful!
So,
A) Next time I need to delete a bunch of stuff I can just delete on a collection level using selectors.
B) At least for metadata there is a workaround by using the API directly. If you don't mind, could you provide a very simple example? The only docs I find are from the go package.
It probably doesn't make sense to keep this issue open then. At least something as simple as counting would be nice. Afaik in order to just count the number of some object I have to fetch them all and count locally. But that's a thing for another issue, I guess.
from kubernetes.
/triage accepted
/close
from kubernetes.
@fedebongio: Closing this issue.
In response to this:
/triage accepted
/close
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.
from kubernetes.
Related Issues (20)
- Node Labeling node.kubernetes.io/out-of-service Taint Label Delay HOT 2
- [FG:InPlacePodVerticalScaling] e2e test does not verify resource update in pod status HOT 3
- cronjob schedule with multiple conditions not working - conflict between day (week) and day (month) HOT 5
- NetPol block self pod trafic using an svc and not direct call HOT 12
- kube-apiserver logs watch requests before they end in 1.30 HOT 9
- Node Lifecycle Controller does not mark pods not ready when node becomes Ready=False HOT 8
- endpoints cannot be changed from notReadyAddresses to addresses HOT 8
- Enhancement: Add vTPM Configuration Fields for Enhanced Container Security HOT 3
- 'kubectl delete istag/$ISTAG --dry-run=server' is unexpectedly deleting the object from the server HOT 5
- [FG:InPlacePodVerticalScaling] resources in pod status are never updated if EventedPLEG is enabled HOT 2
- [Flaking test] ci-kubernetes-e2e-gci-gce.Overall HOT 4
- `kubernetes.io/legacy-token-last-used` label being added to long lived service token secrets HOT 2
- The endpoint status does not update when the pod state changes rapidly. HOT 8
- Pod with exitCode 137, The reason has nothing to do with resources。 HOT 2
- Failure cluster [9afae275...] HOT 2
- finish DRA for 1.31 HOT 4
- [Failing Test] ci-kubernetes-cloud-provider-kind-conformance-parallel-ipv6 (client rate limiter error) HOT 2
- TypeMeta is empty in Type client Apply and Patch responses HOT 3
- Job API: Relax validation enforcing Pod Failure Policy is only compatible with pod restart policy of "Never" HOT 7
- invalid memory address or nil pointer dereference" in wait.JitterUntil HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from kubernetes.