its like next level docs, what do I infer from thi...
# python
l
its like next level docs, what do I infer from this? 🙂
c
@little-river-49422 these docs come from the Kubernetes OpenAPI spec. It’s basically a
v1/List
of only `Service`s
l
yeah, i understand that, but how do I use it, lol
c
Confusingly, you can’t give it a
namespace
because it is not instantiated by the API server.
Typically `List`s are used to return objects when you do a
kubectl get
for example
If you submit it to the API server, it will instantiate everything in the list, but not the list itself.
l
so i need to put something inside the items? but what?
c
`Service`s
the items need to be
Service
.
l
like, a pulumi resource?
c
whatever you’d pass to
new core.v1.Service
l
how do I do it without pulumi creating the actual service?
c
a list of those goes in
items
I’m confused, what are you trying to do, now?
l
ok, like you said, list is used to retrieve stuff, right? I'm trying to find the external IP of the nginx ingress service, because its not being created by pulumi, its being created by a helm chart during cluster provisioning
c
It can be used to retrieve stuff, but if you do
new ServiceList
with Pulumi, it tells Pulumi to create all the `Service`s inside.
Or I should say:
kubectl get svc
happens to return a
ServiceList
. But if you
kubectl apply
a
ServiceList
, it will create/update those `Service`s
l
ok, so this particular thing in python sdk is used to create services, not get them? so there is no method to get data from k8s in python sdk?
c
Come to think of it we should probably remove the
List
types. In practice I don’t think they’re useful in the context of Pulumi. In an
apply
they are really only useful if you have a single JSON document and you want to create a bunch of services.
I’m not sure, let me check if we implement
.get
l
i dont think i see any gets in the reference
only list, i thought lists are for that =\
c
hmm, yes, this is an easy feature to add, we can probably fix this next week.
let me file an issue
l
ok, thanks. i guess I'll just wait for now 😉
i'll use kubectl to retrieve it, probably