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 fine