Hi, we are upgrading Pulumi.Kubernetes from 2.7.2 ...
# kubernetes
b
Hi, we are upgrading Pulumi.Kubernetes from 2.7.2 to 3.23.1 and getting lots of problems. I can't get the state in position where it won't recreate a bunch of resources. Any advice here? How does pulumi know the provider has changed, where is this actually stored, because its not in the state. Is this stored in kubernetes/aks somewhere?
m
What does the diff shows? What fields are changed so Pulumi want's to recreate?
b
various problems, the issue I am looking at now has exactly the same diff:
Copy code
~ location          : "westeurope" => "westeurope"
but it wants to recreate the resource
m
for the k8s manifest or the cloud resource?
b
thanks for reply, this is for the azure-nativenetworkVirtualNetwork
but having problems with most of the k8s resources too
ok, trying a new stack from scratch and importing now
I've imported the cluster with pulumi import and copied the code it creates. Now running pulumi preview gives:
Copy code
azure-native:containerservice:ManagedCluster  staging         update     [diff: ~networkProfile]
fixed that by nulling out the diff properties
Copy code
networkProfile: {
          ~ loadBalancerProfile: {
              + allocatedOutboundPorts: 0
              + idleTimeoutInMinutes  : 30
            }
        }
Copy code
AllocatedOutboundPorts = null,
                        IdleTimeoutInMinutes = null
how do you import the kubernetes provider?
m
Did you try a pulumi import?
b
what physically is a kubernetes provider? there is no import section in the docs https://www.pulumi.com/registry/packages/kubernetes/api-docs/provider/
how do I find its type, name and id?
ok, I got the name id and type from the existing state
try to import, I get
Copy code
panic: fatal: An assertion has failed: inputs was non-nil 'dotnet build -nologo .' completed successfully

goroutine 132 [running]:
<http://github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)|github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.failfast(...)>
        /home/runner/work/pulumi/pulumi/sdk/go/common/util/contract/failfast.go:23
<http://github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.Assertf|github.com/pulumi/pulumi/sdk/v3/go/common/util/contract.Assertf>(0x20?, {0x2c94c1c?, 0x27d7460?}, {0x0?, 0x27d7460?, 0x4304e80?})
        /home/runner/work/pulumi/pulumi/sdk/go/common/util/contract/assert.go:33 +0xed
<http://github.com/pulumi/pulumi/sdk/v3/go/common/resource.NewState({0xc0004a2390|github.com/pulumi/pulumi/sdk/v3/go/common/resource.NewState({0xc0004a2390>, 0x17}, {0xc000c305a0, 0x43}, _, _, {_, _}, _, 0x0, ...)
        /home/runner/work/pulumi/pulumi/sdk/go/common/resource/resource_state.go:72 +0xeb
<http://github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*importer).registerProviders(0xc00095b928|github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*importer).registerProviders(0xc00095b928>, {0x3284b30, 0xc000154e80})
        /home/runner/work/pulumi/pulumi/pkg/resource/deploy/import.go:257 +0x699
<http://github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*importer).importResources(0xc00095b928|github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*importer).importResources(0xc00095b928>, {0x3284b30, 0xc000154e80})
        /home/runner/work/pulumi/pulumi/pkg/resource/deploy/import.go:299 +0xc7
<http://github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*deploymentExecutor).importResources(0xc000508540|github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*deploymentExecutor).importResources(0xc000508540>, {0x3284bd8, 0xc000aac960}, {{0x1fd43eb29e0, 0xc0005d1680}, 0x7fffffff, 0x0, 0x0, {{0x0, 0x0, ...}, ...}, ...}, ...)
        /home/runner/work/pulumi/pulumi/pkg/resource/deploy/deployment_executor.go:455 +0x132
<http://github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*deploymentExecutor).Execute(0xc000508540|github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*deploymentExecutor).Execute(0xc000508540>, {0x3284bd8?, 0xc000aac960}, {{0x1fd43eb29e0, 0xc0005d1680}, 0x7fffffff, 0x0, 0x0, {{0x0, 0x0, ...}, ...}, ...}, ...)
        /home/runner/work/pulumi/pulumi/pkg/resource/deploy/deployment_executor.go:144 +0xe58
<http://github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*Deployment).Execute(0xc000b0c2c0|github.com/pulumi/pulumi/pkg/v3/resource/deploy.(*Deployment).Execute(0xc000b0c2c0>, {0x3284bd8, 0xc000aac960}, {{0x1fd43eb29e0, 0xc0005d1680}, 0x7fffffff, 0x0, 0x0, {{0x0, 0x0, ...}, ...}, ...}, ...)
        /home/runner/work/pulumi/pulumi/pkg/resource/deploy/deployment.go:534 +0xd0
<http://github.com/pulumi/pulumi/pkg/v3/engine.(*deployment).run.func1()|github.com/pulumi/pulumi/pkg/v3/engine.(*deployment).run.func1()>
        /home/runner/work/pulumi/pulumi/pkg/engine/deployment.go:289 +0x290
created by <http://github.com/pulumi/pulumi/pkg/v3/engine.(*deployment).run|github.com/pulumi/pulumi/pkg/v3/engine.(*deployment).run>
        /home/runner/work/pulumi/pulumi/pkg/engine/deployment.go:272 +0x35b