This message was deleted.
# kubernetes
s
This message was deleted.
c
you could talk to the kubernetes api directly using your language of choice
put the code with your pulumi stack and then import the resource if neeeded
n
How can u talk to the kubernetes api directly using pulumi?
c
Pulumi allows you to execute any piece of code - even code that doesn't use it's API directly ``````
Example: https://www.pulumi.com/blog/deploying-mysql-schemas-using-dynamic-providers/ This example uses the
mysql-connector-python
module, it's referred to in requirements You can use any upstream code base and/or build your own that can be called when running your stack
n
Okay thanks, will take a look at dynamic providers!
c
If you're using python check out https://github.com/kubernetes-client/python
actually looks like there's one for each language
n
This can work really well for my purpose. I use typescript so the javascript version should fit me well. Then it won't be completely pulumi, but I can at-least write it in the same project. And also looks easier then using the dynamic providers.
Btw using the kubernets client was the way to go. I was able to get the information I needed like so:
Copy code
const k8sApi = kc.makeApiClient(CustomObjectsApi);
const volumeSnapshotContents = await k8sApi.listClusterCustomObject("<http://snapshot.storage.k8s.io|snapshot.storage.k8s.io>","v1","volumesnapshotcontents");