Giter VIP home page Giter VIP logo

Comments (10)

black-snow avatar black-snow commented on June 30, 2024 1

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.

jpbetz avatar jpbetz commented on June 30, 2024 1

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.

black-snow avatar black-snow commented on June 30, 2024

/sig api-machinery
/sig cli

from kubernetes.

ah8ad3 avatar ah8ad3 commented on June 30, 2024

Thanks for raising this issue, did you consider using etcdctl directly?

from kubernetes.

cici37 avatar cici37 commented on June 30, 2024

/cc @jpbetz Thank you! :)

from kubernetes.

jpbetz avatar jpbetz commented on June 30, 2024

Could deleteCollection be used here?

Please reassign to sig-cli is this is purely a kubectl related request.

from kubernetes.

black-snow avatar black-snow commented on June 30, 2024

@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.

black-snow avatar black-snow commented on June 30, 2024

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.

fedebongio avatar fedebongio commented on June 30, 2024

/triage accepted
/close

from kubernetes.

k8s-ci-robot avatar k8s-ci-robot commented on June 30, 2024

@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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.