https://pulumi.com logo
#general
Title
# general
b

broad-boots-45639

12/13/2019, 6:53 PM
Has anyone got a working example, or see what I'm doing incorrectly?
g

gentle-diamond-70147

12/13/2019, 10:46 PM
You're passing a kubernetes provider (
provider
) as the provider to your
digitalocean.KubernetesNodePool
. This may be causing the panic - though it shouldn't be panicking, it should give you an error message. So you can remove that part from the node pool arguments. Also, you don't need the explicit
dependsOn
, because you've already specified the dependency to
clusterId: cluster.id
. It won't cause a problem, it's just superfluous.
This code works for me:
Copy code
import * as digitalocean from "@pulumi/digitalocean";

const projectName = "demo"
const cluster = new digitalocean.KubernetesCluster(`${projectName}`, {
    region: digitalocean.Regions.NYC1,
    version: "1.16.2-do.1",
    nodePool: {
        name: `${projectName}-default`,
        size: digitalocean.DropletSlugs.DropletS2VCPU4GB,
        autoScale: true,
        minNodes: 1,
        maxNodes: 2
    },
});
export const clusterName = cluster.name;

const nodePool = new digitalocean.KubernetesNodePool(`${projectName}`, {
    clusterId: cluster.id,
    size: digitalocean.DropletSlugs.DropletS2VCPU4GB,
    nodeCount: 1,
});
export const nodePoolName = nodePool.name;
I tried to reproduce the panic with the k8s provider and I get an error but not a panic. Could you make sure you're on the latest DigitalOcean provider in your package.json?
b

broad-boots-45639

12/26/2019, 6:25 PM
Apologies I never got back to you, this worked. Thank you!
👍 1