# create

The cldkctl guard create command creates a new Guard in your project. A Guard defines network access control rules (ingress and egress) for your workloads. This command allows you to interactively configure Guard properties such as name, namespace, endpoint selector, and traffic rules.

## Usage&#x20;

```
cldkctl guard create [flags]
```

## Aliases

```
create, add
```

## Steps

Follow the steps below to run and view the result of this command:

1. Run the following command in your terminal:

```
./cldkctl guard create
```

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FEfRbptbzRVQKrrx3vejY%2Funknown.png?alt=media&#x26;token=1e78892a-6314-45ac-86dc-72aa2b386bee" alt=""><figcaption></figcaption></figure>

2. Enter the Guard Name to identify the configuration.
3. Select the Namespace where the Guard will be created. Choose from the available namespaces.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FO5HmFwmml6qAipnXY0nN%2Funknown.png?alt=media&#x26;token=449a325b-7b45-4a53-8d11-8dde1603b3c4" alt=""><figcaption></figcaption></figure>

4. Define the Endpoint Selector to specify which workloads this Guard applies to.
5. When prompted, choose whether to add an ingress rule (for incoming traffic). Select Yes to define inbound rules, or No to skip.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FqmGY1tRsGbfm113rVa0z%2Funknown.png?alt=media&#x26;token=67ffa693-1d7f-4855-91ee-93081152e926" alt=""><figcaption></figcaption></figure>

6. Next, choose whether to add an egress rule (for outgoing traffic). Select Yes to define outbound rules, or No to skip.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FUcdk4b2XDqVFZgzD4l05%2Funknown.png?alt=media&#x26;token=51900fb7-e05e-403c-8225-6477ab6c4041" alt=""><figcaption></figcaption></figure>

7. Decide whether to deny all other ingress traffic. Choose Yes, deny to block unspecified inbound traffic, or No, allow to permit it.
8. Decide whether to deny all other egress traffic. Choose Yes, deny to block unspecified outbound traffic, or No, allow to permit it.
9. Review your configuration, then select Confirm & Create to finalize the Guard.

<figure><img src="https://2882153758-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fi9YWb69HFXLHYlXffReU%2Fuploads%2FQF3GAH4QaewgMA2nebpi%2Funknown.png?alt=media&#x26;token=99966624-347e-4df4-a402-61fe6d9de44b" alt=""><figcaption></figcaption></figure>

10. Once completed successfully, a message will appear in your terminal.

## Flags

{% hint style="info" %}
This command supports global flags. Refer to the Global Flags section for details
{% endhint %}

| Flag                           | Description                             |
| ------------------------------ | --------------------------------------- |
| -e, --endpoint-selector string | Specify endpoint selector.              |
| -f, --file string              | Specify a YAML file for creating Guard. |
| -h, --help                     | Help for the guard create command.      |
| -n, --name string              | Specify Guard name.                     |
| -s, --namespace string         | Specify namespace.                      |
| --yaml                         | Create a Guard with YAML.               |
