Ran into some annoyance with passing a Cluster obj...
# kubernetes
g
Ran into some annoyance with passing a Cluster object from pulumi_eks to the pulumi_kubernetes model as a Provider. I had to use the below snippet to generate a Provider from a Kubeconfig. I'm curious if this is expected or if there is a better way to do this?
Copy code
k8s_provider = Provider("k8s-provider", kubeconfig=k8s_cluster.cluster.kubeconfig.apply(lambda k: json.dumps(k)))
m
I do it like this:
Copy code
import pulumi_eks as eks
import pulumi_kubernetes as k8s

cluster = eks.Cluster("my-cluster", ...)
k8s_provider = k8s.Provider("k8s-provider", kubeconfig=cluster.kubeconfig)
Which is also what's described in the docs. Does that not work for you?