This message was deleted.
# general
s
This message was deleted.
b
How are you running the code? You can't just run the python code, you have to run
pulumi up
You can follow the instructions to install Pulumi and get it set up with python (which I think you're using?) here: https://www.pulumi.com/docs/get-started/aws/begin/ I know you're not using AWS, but there are instructions to set up Pulumi with python
e
The main problem is I dunno what content to fill the pulumi resources. For example, how does one know the s-2vcpu-2gb in this link: https://github.com/pulumi/examples/blob/327afe30ce820901f210ed2a01da408071598ed6/digitalocean-py-k8s/__main__.py#L19
After posting this question, I came across the upstream API docs: https://developers.digitalocean.com/documentation/v2/#regions This comes a step closer. But dunno how pulumi itself provides hints on these values.
b
You can get the node sizes using the
GetSizes
function: https://www.pulumi.com/docs/reference/pkg/digitalocean/getsizes/
If you don't add a filter to the request, it'll return a full list of all available droplet sizes
e
The problem is, I have to run it with pulumi up. I shall run it as a simple python script.
b
You can use our automation api, but you do need to have the Pulumi CLI installed
Where are you running the update from?
e
I have pulumi installed. I
Dunno what “from” means. Now the problem is reduced to find out the region slug names with pulumi.
b
"from" - I mean are you running the code from your local machine, are you running it in a container, in a CI/CD pipeline?
If you call
GetRegions
without a filter it will return the slugs for the regions
e
Thanks for your consistent help on this. I’ve another question, for this line: https://github.com/pulumi/examples/blob/327afe30ce820901f210ed2a01da408071598ed6/digitalocean-py-k8s/__main__.py#L23, kubeconfig=cluster.kube_configs.apply I don’t understand why apply could be called on the kube_config object. According to the doc, https://www.pulumi.com/docs/reference/pkg/digitalocean/kubernetescluster/#kube_configs_python kube_configs is a Sequence.
b
Apply is used here because we don't know what the value of the kubeconfig will be until everything is complete. Think of it like a callback in javascript.
e
What’s the type of kube_configs ?
b
a sequence