bitter-father-26598
07/17/2023, 8:20 PMconst cluster = new KubernetesCluster(...)
const app1 = new Helm.V3.Release(..., ..., { cluster })
salmon-account-74572
07/17/2023, 8:29 PMbitter-father-26598
07/17/2023, 8:34 PMconst provider = new k8s.Provider('base-kube-provider', {
kubeconfig: JSON.stringify(cluster.kubeConfigs[0])
}, {
dependsOn: cluster
})
salmon-account-74572
07/17/2023, 8:37 PMJSON.stringify
, but that may depend on how you are creating the cluster. Can you share your code?
If the cluster is being created in the same Pulumi program, then no, you don’t need getOutput
(that’s only for stack references---when the cluster is getting created in a different Pulumi stack/project).bitter-father-26598
07/17/2023, 8:43 PMimport * as digitalocean from '@pulumi/digitalocean'
import * as k8s from '@pulumi/kubernetes'
// create cluster
const cluster = new digitalocean.KubernetesCluster('base-kube-cluster',
{
//...normal declared cluster with sensitive values
}
)
// new cluster does not exist in local kubesettings yet
const provider = new k8s.Provider('base-kube-provider', {
kubeconfig: cluster.kubeConfigs[0].apply(JSON.stringify)
}, {
dependsOn: cluster
})
// create db in new cluster
const db = new k8s.helm.v3.Release('crdb', {
name: 'crdb',
chart: 'cockroachdb',
repositoryOpts: {
repo: '<https://charts.cockroachdb.com>',
},
values: {
fullnameOverride: 'crdb',
'single-node': true,
statefulset: {
replicas: 1
}
},
}, {dependsOn: cluster, provider})
salmon-account-74572
07/17/2023, 8:46 PMbitter-father-26598
07/17/2023, 8:50 PMdoctl kubernetes cluster kubeconfig save base-kube
which would update my local kubeConfig after the cluster has been deployed. and then all other subsequent commands work finesalmon-account-74572
07/17/2023, 8:53 PMpulumi up
with only the cluster being created, then run pulumi stack output kubeconfig
(or whatever you called the stack output) and see if that looks correct/appropriate/functional.bitter-father-26598
07/17/2023, 9:17 PMcluster.kubeConfigs[0].apply(v=>_*console*_.log('out',v))
salmon-account-74572
07/17/2023, 9:22 PMcluster.kubeConfigs[0].rawConfig
when defining the new provider?bitter-father-26598
07/17/2023, 9:23 PMsalmon-account-74572
07/17/2023, 9:24 PM