sparse-intern-71089
01/27/2020, 9:26 PMgorgeous-egg-16927
01/27/2020, 11:14 PMconst clusterDataSource = cluster.name.apply(name => digitalocean.getKubernetesCluster({name}));
const kubeconfig = clusterDataSource.kubeConfigs[0].rawConfig;
gorgeous-egg-16927
01/27/2020, 11:15 PMcertificate-authority-data
field changes on every update, but shouldn’t affect things otherwise AFAICTgorgeous-egg-16927
01/27/2020, 11:36 PMgetKubernetesCluster
if the cluster didn’t exist yet, but this should do the trick:
const cluster = new digitalocean.KubernetesCluster("do-cluster", {
region: digitalocean.Regions.SFO2,
version: digitalocean.getKubernetesVersions({versionPrefix: "1.16"}).then(p => p.latestVersion),
nodePool: {
name: "default",
size: digitalocean.DropletSlugs.DropletS2VCPU2GB,
nodeCount: 2,
},
});
const kubeconfig = cluster.status.apply(status => {
if (status === 'running') {
const clusterDataSource = cluster.name.apply(name => digitalocean.getKubernetesCluster({name}));
return clusterDataSource.kubeConfigs[0].rawConfig;
} else {
return cluster.kubeConfigs[0].rawConfig;
}
});
const provider = new k8s.Provider("k8s", {kubeconfig});
numerous-airport-64744
01/27/2020, 11:51 PMnumerous-airport-64744
01/27/2020, 11:53 PMnew k8s.Provider("k8s", {kubeconfig}, { ignoreChanges: ["kubeconfig"] });
Not sure if this will have some side effects but for now it seems to work.gorgeous-egg-16927
01/27/2020, 11:56 PMignoreChanges
will bypass that checking. As long as you’re aware of that, should be fineNo matter how you like to participate in developer communities, Pulumi wants to meet you there. If you want to meet other Pulumi users to share use-cases and best practices, contribute code or documentation, see us at an event, or just tell a story about something cool you did with Pulumi, you are part of our community.
Powered by