# secret

The edit secret command allows you to modify an existing Secret in your Kubernetes cluster. This command lets you update key-value pairs stored in the Secret. However, note that all values must be base64-encoded when editing directly, and changes may be restricted by cluster security policies.

## Usage

```
cldkctl edit secret [name] [flags]
```

## Steps

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

1. Run the following command in your terminal:

```
cldkctl edit secret [secret name]
```

2. Replace `[secret name]` with the name of the Secret you want to modify.
3. If the Secret is in a namespace other than default, add the -n or --namespace flag followed by the namespace name.
4. To view the list of available resources before editing, refer to the corresponding get secret section.
5. The Secret manifest file will open in your default text editor (default: vim). Edit the configuration as needed, then save and close the editor to apply the changes. If you are using vim, press i to enter insert mode and make your edits. When you have finished editing, press Esc, type :wq, and press Enter to save and exit. To exit without saving changes, type :q! and press Enter.

<figure><img src="/files/OOZKtidA7kXJux1Fd9AQ" alt=""><figcaption></figcaption></figure>

6. Once the update is successful, a message “✓ Secret updated” will appear in your terminal.

<figure><img src="/files/uny6U90PbvH2Jvbw2Eqj" alt=""><figcaption></figcaption></figure>

## Flags

{% hint style="info" %}
This command supports [global flags](/cloudeka-api-list/global-flags.md). Refer to the Global Flags section for details
{% endhint %}

| Flag       | Description                   |
| ---------- | ----------------------------- |
| -h, --help | Help for edit secret command. |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.cloudeka.ai/cloudeka-api-list/command-reference/cldkctl-edit/secret.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
