capabilities.work

Inventory and Tear Down a Namespace

A 5-step recipe with Kubernetes. We can help you get access.

Recipe · 5 steps

Inventory and Tear Down a Namespace

with Kubernetes · IT Infrastructure Management

Inventory a namespace's workloads, then delete the namespace and confirm termination.

  1. List the deployments about to be destroyed by the namespace cascade, so the teardown leaves a record of the workloads that existed.
  2. List the services in the namespace. LoadBalancer services deprovision their cloud load balancers as part of the cascade.
  3. List the running pods so the record shows the live workload the teardown is about to terminate.
  4. Delete the namespace. Every resource it scopes is deleted with it; the namespace stays in Terminating until the cascade completes.
  5. Read the namespace back to confirm it is Terminating. A namespace stuck in this phase usually has a finalizer that has not been cleared.
What you'll need to have ready
  • namespace: The namespace to inventory and delete.
For your developer

Arazzo workflow kubernetes:teardown-namespace, 5 operations: listNamespacedDeployments → listNamespacedServices → listNamespacedPods → deleteNamespace → getNamespace. Specs on APIs.io.