sparse-intern-71089
10/18/2021, 12:59 PMgreat-sunset-355
10/18/2021, 1:04 PMwet-noon-14291
10/18/2021, 1:05 PMgreat-sunset-355
10/18/2021, 1:07 PMpulumi up
-> creates a new provider
Pass that to all resources, you need.
pulumi up --target NEW_provider_urn
This performs an update without replacementgreat-sunset-355
10/18/2021, 1:08 PMprovider
inside the statewet-noon-14291
10/18/2021, 1:09 PMpulumi up --target provider_urn
pulumi up
great-sunset-355
10/18/2021, 1:11 PMgreat-sunset-355
10/18/2021, 1:12 PMgreat-sunset-355
10/18/2021, 1:12 PMwet-noon-14291
10/18/2021, 1:37 PMgreat-sunset-355
10/18/2021, 1:45 PMwet-noon-14291
10/19/2021, 12:01 PMwet-noon-14291
10/19/2021, 1:20 PMpulumi up -y -s stackname --target "urn:pulumi:dev::nextjstemplate.deploy::pulumi:providers:kubernetes::k8s-provider"
great-sunset-355
10/19/2021, 2:27 PMwet-noon-14291
10/20/2021, 7:52 PMpulumi up -y -s stackname --target "urn:pulumi:dev::nextjstemplate.deploy::pulumi:providers:kubernetes::k8s-provider"
but the message I get back when doing so is:
could not be found in the stack. Did you forget to escape $ in your shell?
Anyone know what I might be doing wrong?billowy-army-68599
wet-noon-14291
10/20/2021, 8:23 PMgrep
for providers to find the urn.billowy-army-68599
wet-noon-14291
10/20/2021, 8:25 PMwet-noon-14291
10/20/2021, 8:26 PMpulumi stack export -s <stack name> | grep provider
billowy-army-68599
grep
might be swallowing the $
billowy-army-68599
wet-noon-14291
10/20/2021, 8:28 PMwet-noon-14291
10/20/2021, 8:34 PM$
, it is only the kubernetes resources that has that.wet-noon-14291
10/20/2021, 8:36 PMwet-noon-14291
10/20/2021, 8:43 PMwet-noon-14291
10/20/2021, 8:48 PMgreat-sunset-355
10/21/2021, 6:05 AMwet-noon-14291
10/21/2021, 1:08 PMundefined
so the default one is used.
So the question is basically how do I create a provider that is using the default settings? It seems like I can't use new k8s.Provider("name")
, I think the provider complained about missing config when I did exactly that.
The code I use to create the provider:
export function createK8sProvider(kubernetesConfig: string, namespaceName: string) {
return kubernetesConfig ? new Provider(`k8s-provider`, {
kubeconfig: kubernetesConfig,
namespace: namespaceName,
}) : undefined;
}
I do add the provider to the resource options everywhere after this. What I would like to be able to do is one of the things below:
export function createK8sProvider(kubernetesConfig: string, namespaceName: string) {
return kubernetesConfig ? new Provider(`k8s-provider`, {
kubeconfig: kubernetesConfig,
namespace: namespaceName,
}) : new Provider(`k8s-provider`);
}
Which I mead would be use the config if present, if it isn't create a new provider (using the same name) but with what ever default options that exists.wet-noon-14291
10/21/2021, 1:13 PMgreat-sunset-355
10/21/2021, 5:52 PMpulumi stack export
quite often in this case. and compare it to the previous versions
note: you need to sort the output pulumi stack export | jq '.deployment.resources|=sort_by(.urn)'
to get consistent resultswet-noon-14291
10/21/2021, 8:11 PMwet-noon-14291
10/22/2021, 9:47 PMgreat-sunset-355
10/23/2021, 7:21 AM