# Add a Secret

From the menu select **ConfigMaps & Secrets**, ensure the **Secrets** tab is selected, then click **Add with form**.

{% hint style="info" %}
Secrets can also be added [using a manifest or Helm chart](/sts/user/kubernetes/applications/manifest.md) by clicking **Create from code**.
{% endhint %}

<figure><img src="/files/0wpDEuPG2ECkfppiHaUO" alt=""><figcaption></figcaption></figure>

Define the secret, using the table below as a guide.

| Field/Option | Overview                                                                                                                           |
| ------------ | ---------------------------------------------------------------------------------------------------------------------------------- |
| Namespace    | Select the namespace where the secret will be saved.                                                                               |
| Name         | Give the secret a descriptive name.                                                                                                |
| Annotations  | You can add annotations to your secret as required by clicking **Add annotation** and filling in the **Key** and **Value** fields. |
| Secret Type  | Select from the list of available secret types or select **Custom** to define your own type.                                       |

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

Data fields change to reflect the type of Data to be entered based on the secret type selection above. In the **Data** section you can enter the details of your secret, in either **Simple mode** or **Advanced mode**. Under simple mode you can add entries in a key and value format, and in advanced mode you can paste in multiple values in YAML format.

<figure><img src="/files/KmTAR4QDGt8ZvgWMGYCe" alt=""><figcaption><p>Adding data in Simple mode</p></figcaption></figure>

<figure><img src="/files/Z6J5BZ0qlFkJYA38DyvE" alt=""><figcaption><p>Adding data in Advanced mode</p></figcaption></figure>

When you have finished defining the secret, click **Create Secret.**


---

# 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.portainer.io/sts/user/kubernetes/configurations/add-1.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.
