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

broad-boots-45639

12/13/2019, 6:53 PM
Copy code
const cluster = new digitalocean.KubernetesCluster(project_name, {
    region: digitalocean.Regions.NYC1,
    version: "1.15.5-do.2",
    nodePool: {
        name: `pulumi-${env}-default-nodepool`,
        size: "c-4",
        autoScale: true,
        minNodes: 2,
        maxNodes: 6
    }
});

export const kubeconfig = cluster.kubeConfigs[0].rawConfig;
export const clusterName = digitalocean.KubernetesCluster.name;
export const clusterID = cluster.id;

const provider = new kubernetes.Provider("do-k8s", { kubeconfig })
const nodepool_name = `${project_name}-secondary`;

const node_pool = new digitalocean.KubernetesNodePool(nodepool_name, {
      name: nodepool_name,
      clusterId: cluster.id,
      size: "c-32",
      autoScale: true,
      minNodes: 1,
      maxNodes: 3
    }, { provider, dependsOn: cluster } );