# atmos kubernetes apply

Deploy the Kubernetes objects defined by a stack-configured component without
leaving Atmos. `apply` renders the manifests, prepares the component
environment, runs hooks, and applies the result to the target cluster.

**Configure Kubernetes Components**

Define where manifests come from, which values they receive, and which
credentials or hooks should run from the Kubernetes component stack
configuration.

Stack Configuration

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

atmos.yaml Configuration

[Read more](/cli/configuration/components/kubernetes)

## Usage

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

`apply` renders the final manifests and applies them through Kubernetes Go
clients. Atmos resolves each object from GVK to GVR using discovery and a
RESTMapper, then applies it through the dynamic client with server-side apply.

The command does not require the `kubectl` binary.

## Example

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

Example output:

```text
applied v1/Namespace argocd
applied apps/v1/Deployment argocd/argocd-server
```

To publish the rendered manifests to a Git deployment repository instead of
applying to the cluster, configure `provision.targets` and select a git target
with `--target`. See
[Deployment repositories (GitOps)](/cli/commands/kubernetes/deploy#deployment-repositories-gitops).

## Flags

- **`--stack`, `-s` (required)**
  Atmos stack.
- **`--target` (optional)**

  Provision target to deliver to (a named `provision.targets` entry, e.g. a git
  deployment repository). Defaults to `provision.default`, otherwise the cluster.
- **`--all` (optional)**
  Apply all Kubernetes components in dependency order.
- **`--affected` (optional)**
  Apply affected Kubernetes components and their dependencies.
- **`--include-dependents` (optional)**
  With 
  `--affected`
  , include dependent Kubernetes components.
