1. Docs
  2. Clouds
  3. Kubernetes
  4. Get started
  5. Destroy stack

Pulumi & Kubernetes: Destroy stack

    Now that we’ve seen how to deploy changes to our program, let’s clean up and tear down the resources that are part of our stack.

    To destroy resources, run the following:

    $ pulumi destroy
    

    You’ll be prompted to make sure you really want to delete these resources.

    Previewing destroy (dev):
         Type                              Name            Plan
     -   pulumi:pulumi:Stack               quickstart-dev  delete
     -   ├─ kubernetes:core/v1:Service     nginx           delete
     -   └─ kubernetes:apps/v1:Deployment  nginx           delete
    
    Outputs:
      - ip: "10.110.183.208"
    
    Resources:
        - 3 to delete
    
    Do you want to perform this destroy?  [Use arrows to move, type to filter]
    > yes
      no
      details
    

    Select yes using the arrows and hit enter to delete the resources in Kubernetes.

    Do you want to perform this destroy? yes
    Destroying (dev):
         Type                              Name            Status
     -   pulumi:pulumi:Stack               quickstart-dev  deleted (0.00s)
     -   ├─ kubernetes:core/v1:Service     nginx           deleted (0.94s)
     -   └─ kubernetes:apps/v1:Deployment  nginx           deleted (4s)
    
    Outputs:
      - ip: "10.110.183.208"
    
    Resources:
        - 3 deleted
    
    Duration: 6s
    
    The resources in the stack have been deleted, but the history and configuration associated with the stack are still maintained.
    If you want to remove the stack completely, run `pulumi stack rm dev`.
    

    To delete the stack itself, run pulumi stack rm. Note that this removes the stack entirely from the Pulumi Cloud, along with all of its update history.

    $ pulumi stack rm
    This will permanently remove the 'dev' stack!
    Please confirm that this is what you`d like to do by typing `dev`:
    

    Type dev and hit enter to remove the stack.

    Please confirm that this is what you`d like to do by typing `dev`: dev
    Stack 'dev' has been removed!
    

    Next, we’ll look at some next steps.

      Pulumi AI - What cloud infrastructure would you like to build? Generate Program