## NAME

`gcluster deploy` - deploys all resources in a Cluster Toolkit
deployment directory or directly from a blueprint file.

## SYNOPSIS

```
gcluster deploy {DEPLOYMENT_DIRECTORY | BLUEPRINT_FILE} [FLAGS]
```

## DESCRIPTION

The `gcluster deploy` command deploys all resources defined in a deployment
directory. If you provide a blueprint file instead of a deployment directory,
then Cluster Toolkit runs the equivalent of the
[`gcluster create`](https://docs.cloud.google.com/cluster-toolkit/docs/reference/gcluster-create.md.txt) command to
create the deployment directory first, and then deploys it. To destroy the
deployed resources, use the
[`gcluster destroy`](https://docs.cloud.google.com/cluster-toolkit/docs/reference/gcluster-destroy.md.txt) command.

## FLAGS

- `-a`, `--artifacts ARTIFACTS_DIR`: The directory where deployment artifacts are stored. If you omit this flag, then the `gcluster` CLI configures the directory automatically.
- `--auto-approve`: Automatically approves proposed changes without prompting.
- `--json-output`: Writes Terraform output to a JSON file instead of standard text output to the console.
- `--parallelism N`: Limits the number of concurrent
  Terraform operations. Specify an integer of `0` or greater:

  - `1` or greater: passes `N` to Terraform and overrides the `GCLUSTER_TERRAFORM_PARALLELISM` environment variable.
  - `0` or omitted: uses the `GCLUSTER_TERRAFORM_PARALLELISM` environment variable if set to a positive integer, or falls back to the Terraform default of `10`.
- `--skip GROUPS`: A comma-separated list of group names to
  skip during deployment.

- `--only GROUPS`: A comma-separated list of group names to
  deploy exclusively. This flag can't be used with the `--skip` flag.

- `--skip-gke-security-check`: Bypasses the dynamic Google Kubernetes Engine (GKE)
  version security vulnerability check.

### CREATE FLAGS

If you provide a <var translate="no">BLUEPRINT_FILE</var> argument, then the following
flags from the [`gcluster create`](https://docs.cloud.google.com/cluster-toolkit/docs/reference/gcluster-create.md.txt)
command are also available:

- `-o`, `--out OUTPUT_DIR`: The directory where the deployment directory is created.
- `-w`, `--overwrite-deployment`: Lets you overwrite an existing deployment directory.
- `--force`: Forces an overwrite without prompting.
- `-d`, `--deployment-file DEPLOYMENT_FILE`: A deployment file to override blueprint variables and backend configuration.
- `--vars VARS`: A comma-separated list of `name=value` variables to override YAML configuration.
- `--backend-config BACKEND_CONFIG`: A comma-separated list of `name=value` variables to set Terraform backend configuration.
- `-l`, `--validation-level LEVEL`: Sets the validation level to `ERROR`, `WARNING`, or `IGNORE`.
- `--skip-validators VALIDATORS`: A comma-separated list of validators to skip.
- `--add-creator-label`: Adds the `ghpc_creator` label with your account identity to the expanded blueprint. Turned on by default for `@google.com` accounts. To turn off this label, pass the `--add-creator-label=false` flag.

## EXAMPLES

To deploy all resources in a deployment directory:

```bash
gcluster deploy ./my-deployment
```

To automatically approve and apply changes without prompting:

```bash
gcluster deploy ./my-deployment --auto-approve
```

To create and immediately deploy a cluster from a blueprint file:

```bash
gcluster deploy blueprint.yaml -o ./my-deployment --auto-approve
```

To deploy only a specific group within a multi-group deployment:

```bash
gcluster deploy ./my-deployment --only=primary-cluster
```