# Add a Secret

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

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

<figure><img src="https://679325054-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FMdgxA76kWxcRmwybM8Ft%2Fuploads%2Fd87KU13Kwhof92UgDnih%2F2.40.0-secrets.png?alt=media&#x26;token=11af9fbd-36c5-4906-9e5a-f38b4161b976" 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="https://content.gitbook.com/content/MdgxA76kWxcRmwybM8Ft/blobs/y6xTv6GuiT8ZJrZgCF1w/2.19-kubernetes-configurations-secrets-add.png" 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="https://content.gitbook.com/content/MdgxA76kWxcRmwybM8Ft/blobs/qUzB8r5YZE3MlMGare1R/2.16-k8s-secret-data.png" alt=""><figcaption><p>Adding data in Simple mode</p></figcaption></figure>

<figure><img src="https://content.gitbook.com/content/MdgxA76kWxcRmwybM8Ft/blobs/eex8zNjz3hx2PydWOMLf/2.16-k8s-secret-data-adv.png" alt=""><figcaption><p>Adding data in Advanced mode</p></figcaption></figure>

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