# atmos kubernetes delete

Remove the Kubernetes objects managed by a stack-configured component. Atmos
renders the same manifests used for deployment, resolves each object, and
deletes it from the target cluster by name and namespace.

**Configure Kubernetes Components**

Keep the desired objects in stack configuration, then use `delete` when a
component should be removed from an environment.

Stack Configuration[Read more](/stacks/components/kubernetes)

## Usage

```shell
atmos kubernetes delete <component> --stack <stack>
atmos kubernetes delete --all --stack <stack>
```

:::info Alias
The `destroy` alias runs the same command, so `atmos kubernetes destroy <component> --stack <stack>` is equivalent to `atmos kubernetes delete <component> --stack <stack>`. [`atmos stack destroy`](/cli/commands/stack/stack-destroy) uses this alias for Kubernetes components.
:::

`delete` renders the final manifests, resolves each object from GVK to GVR using
discovery and a RESTMapper, and deletes each object by name and namespace
through the Kubernetes dynamic client.

The command does not require the `kubectl` binary.

## Example

```shell
atmos kubernetes delete argocd -s plat-ue2-dev
```

Example output:

```text
deleted apps/v1/Deployment argocd/argocd-server
not-found v1/Service argocd/argocd-server
```

Delete components filtered by tags or labels (composes with `--all`/`--affected` to narrow the selected set further):

```shell
atmos kubernetes delete --all --tags production,tier-1
atmos kubernetes delete --affected --labels cost-center=platform

# Combine multiple selectors in one comma-separated --labels value
atmos kubernetes delete --affected --labels cost-center=platform,compliance=sox
```

## Flags

- **`--stack`, `-s` (optional)** — Atmos stack. Required when deleting a named component; not required with `--all`/`--affected`/`--tags`/`--labels` bulk selection.
- **`--all` (optional)** — Delete all Kubernetes components in dependency order.
- **`--affected` (optional)** — Delete affected Kubernetes components and their dependencies.
- **`--include-dependents` (optional)** — With `--affected`, include dependent Kubernetes components.
- **`--tags` (optional)** — Filter by tags (comma-separated, matches any): `--tags=production,tier-1`. Composes with `--all`/`--affected` to narrow the selected set further; cannot be combined with a single component argument.
- **`--labels` (optional)** — Filter by labels (comma-separated `key=value` or `key:value` pairs in one flag value, matches all): `--labels=cost-center=platform,compliance=sox`. Composes with `--all`/`--affected`/`--tags`; cannot be combined with a single component argument.

## Try it out

### kubernetes

Copy the example into a new directory and make it your own:

```shell
atmos init examples/kubernetes
cd kubernetes
```

Requires Docker or Podman and network access. Apply and delete the example in the local Kubernetes emulator, then stop it.

```shell
atmos emulator up kubernetes -s dev
atmos kubernetes apply demo -s dev --identity local-k3s
atmos kubernetes delete demo -s dev --identity local-k3s
atmos emulator down kubernetes -s dev
```

- [Installation guide](/install)
- [Explore the example](/examples/kubernetes)
- [Initialization and repository settings](/cli/commands/init#examples-and-source-directories)
