https://pulumi.com logo
#getting-started
Title
# getting-started
i

important-energy-56546

01/25/2024, 8:12 PM
I deployed once using pulumi to a home built k8s cluster. I have another machine I'd like to use pulumi with, but refresh doesn't import anything. If I try to destroy the deployments using pulumi, it doesn't see them. Any advice on moving forward?
i'm guessing i should create an import script and run it before bringing in other machines to deploy from?
a

ancient-policeman-24615

01/25/2024, 8:53 PM
pulumi refresh
and
pulumi destroy
only effect resources that are managed by the Pulumi stack they are applied to. If you have a bunch of existing stuff deployed that you would like Pulumi to manage, you will need to import it.
i

important-energy-56546

01/25/2024, 8:53 PM
gotcha. got importing services, but i'm having touble importing deploymenets
pulumi import --stack dev -y kubernetes:core/v1:Deployment demo default/demo
isn't importing my depoy named
demo
a

ancient-policeman-24615

01/25/2024, 8:55 PM
We have effectively reached the end of my k8s knowledge, but I can take a look if it is a generic Pulumi error. When you run the ☝️ import command, what happens?
i

important-energy-56546

01/25/2024, 8:57 PM
Copy code
/app/src # pulumi import --stack dev -y kubernetes:core/v1:Deployment demo default/demo
Previewing import (dev):
     Type                              Name   Plan       Info  
     pulumi:pulumi:Stack               demo             1 error
 =   └─ kubernetes:core/v1:Deployment  demo   import     1 error

Diagnostics:
  kubernetes:core/v1:Deployment (demo):
    error: Preview failed: resource 'default/[secret]' does not exist

  pulumi:pulumi:Stack (demo-dev):
    error: preview failed
The names are probably not matching up
a

ancient-policeman-24615

01/25/2024, 9:01 PM
It looks like your using everything correctly as far as I can tell. If the deploy is named
demo
in k8s, I would try this if you haven’t already (just to see if it works):
Copy code
pulumi import --stack dev -y kubernetes:core/v1:Deployment demo demo
We have definitely reached the end of my knowledge. If someone else knows, please jump in. I would ask in #kubernetes, I think your odds of finding a more knowledgeable k8s user are higher their.
i

important-energy-56546

01/25/2024, 9:02 PM
will do. i thought i need the namepace in there, but i tried w/o and got similar results. wish me luck 🤞
Found out the problem
if you do an
up -d
, the types are right there. I edited from
kubernetes:core/v1:Service
into
kubernetes:core/v1:Deployment
when it should be
kubernetes:apps/v1:Deployment
Doing an up -d shows the right types, and I botched editing
a

ancient-policeman-24615

01/25/2024, 9:53 PM
I’m glad you got it working.
s

stale-answer-34162

01/26/2024, 2:15 PM
how do you deploy on local hardware?