many-psychiatrist-74327
08/26/2020, 11:33 PMConfigFile
.
Iâm trying to deploy some existing k8s yaml objects with Pulumi/Python. Iâm creating a k8s.yaml.ConfigFile
from my file as shown in this tutorial. However, the tutorial then suggests querying the resources inside the ConfigFile by calling `get_resource(type, name)`[0]. but that function doesnât exist. Is there a way to âqueryâ the resources inside the ConfigFile in Python?
[0] Code snippet:
guestbook = k8s.yaml.ConfigFile('guestbook', 'guestbook-all-in-one.yaml')
# Export the private cluster IP address of the frontend.
frontend = guestbook.get_resource('v1/Service', 'frontend') # <- fails
gorgeous-egg-16927
08/27/2020, 7:02 PMget_resource
method should be the way to go. Perhaps youâre using the wrong name for the Service? You can also directly access the resources
property on that ConfigFile
class.
You can see the implementation of that method here: https://github.com/pulumi/pulumi-kubernetes/blob/d9e686f4f9d6996e3eee3fece902d29a226bcf49/sdk/python/pulumi_kubernetes/yaml.py#L344-L363many-psychiatrist-74327
08/27/2020, 7:10 PMget_resource
doesnât exist on the ConfigFile, not that itâs not finding the resource Iâm querying forâŚ
Let me paste my entire code snippet, maybe Iâm doing something stupid