Git Product home page Git Product logo

Comments (26)

tintoy avatar tintoy commented on July 17, 2024 1

Not at all - I think this is the best way to grow a client; when actual requirements arise, otherwise it's just guessing :)

Let me have a think about it for a day or so? I'll see what I can come up with.

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024 1

Mmm, yeah if I drill into the events on my cluster I am not seeing the Labels. There is a label array within Metadata but it seems to always be empty.

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024 1

Not much, I can do it this afternoon (it's 10am here in AU) if that suits. Just need to merge to master (and tag it once the build / publish succeeds) :)

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024 1

Got it and all builds fine. Thanks so much for being so responsive to ideas and changes! You set the standard for github repo management!

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

A good starting point might be https://github.com/tintoy/dotnet-kube-client#working-out-what-apis-to-call - can you try this out and see what APIs it's calling to do that?

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

Yeah I did in fact do that (from your previous advice!), and it's calling:

/api/v1/namespaces/default/events?fieldSelector=involvedObject.name%3Dmypodname-69bb65fc5c-slt69&limit=500

But I'm stuck on how to map that to an object in the api.

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

I'm guessing it's probably this. There's no KubeResourceClient currently implemented for this API but I don't imagine it would be particularly difficult to do. The only tricky part may be discriminator-based deserialisation of the event data (different events would have different KubeObjectV1-derived models as their body.

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

I did experiment with a custom JsonConverter before but I can't remember where it got up to. Let me have a look.

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

Yeah, looks like you've found the right api. And looks like I couldn't find the object because it isn't there! Back to the drawing board. ;-)

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Hmm, can't find the JsonConverter (might be hidden on a branch somewhere). I might need to think about what the API for this would look like because it needs a set of k8s model types to be able to deserialise based on kind/apiVersion. It's totally doable, but so far we haven't needed to maintain a registry of model types. I take it you don't know ahead of time which models you'll need for deserialisation?

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

FWIW, we already have a model for this, just not a JsonConverter that can handle it.

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

Indeed I don't know. As you may have guessed based on my questions over the last few months, I am slowly picking away at some of the core parts of the k8s dashboard that I want to show in our own UI which is tailored to just the parts of k8s that we use. So I may be stretching things for you a bit, my apologies!

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

I think I may have added some metadata caching (that could be reused / extended) as part of the dynamic API support used by PSKubectl, but I'll have to check.

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Ah, so at least the initial part of this can be reused:

https://github.com/tintoy/dotnet-kube-client/blob/6f00774cd785957eb4fb8f20421be9ae757f0830/src/KubeClient/Models/ModelMetadata.cs

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Ok - about to add IEventClientV1.

It looks like K8s events are a little complex, mind you, but this might be helpful:

https://lairdnelson.wordpress.com/2017/04/27/kubernetes-events-can-be-complicated/amp/

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Ok - I think these changes will do what you need. Could you take a look at #85 and let me know what you think?

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

These changes look to be the right direction from my end. But I'd be better able to tell if I could try them out. Could you pull a build together that would let me try them?

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

There is a MyGet feed where packages from CI builds are published. Could you try using that?

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

You’re after version 2.3.0-dynamic-resource0053 of each package.

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

Yeah this will work nicely! Sweet. :-)

I'm not able to get labelSelectors to work, but I wonder if Events really support that? I'm getting nothing back from EventsV1().List("label=selector");

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Hmm - according to the API docs, it should support that. But I suspect the issue may be that while ALL resources support label selectors, events are not labelled?

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

So I am good with these changes, thanks a TON!

What does it take in your process to get a mainstream release of this code?

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Sorry, took longer to start this than I’d have liked - about to do it now :)

from dotnet-kube-client.

brobichaud avatar brobichaud commented on July 17, 2024

I'm still not seeing the expected 2.2.14 build, am I missing something?

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Ugh, bloody GitVersion. Sometimes it doesn't increment the version as it should so the build failed when publishing to NuGet.

I've explicitly tagged the version and restarted the build.

from dotnet-kube-client.

tintoy avatar tintoy commented on July 17, 2024

Thanks!

from dotnet-kube-client.

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.