# Secret Type - KEYVALUE

The KEYVALUE-Type is made for synchronising Secrets stored in a KV Secret Engine with Kubernetes Secrets.

{% hint style="warning" %}
It only supports simple Key-Value pairs and not nested Values.
{% endhint %}

### How To

First write some secrets to HashiCorp Vault:

```bash
$ vault write secret/test-secret key=value key1=value1
```

After this create the following Vault-Resource and apply it to Kubernetes:

```yaml
apiVersion: "koudingspawn.de/v1"
kind: Vault
metadata:
  name: test-secret
spec:
  type: "KEYVALUE"
  path: "secret/test-secret"
```

Now you should see, that new Secret and the Vault resource are available:

```bash
$ kubectl get vault test-secret
NAME             AGE
test-secret      7d
```

```bash
$ kubectl get secret test-secret
NAME                                   TYPE                                  DATA      AGE
test-secret                            Opaque                                2         7d
```

### Change Adjustment Callback

For more details please see [Change Detection](/change-detection.md)!


---

# 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://vault.koudingspawn.de/supported-secret-types/secret-type-keyvalue.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.
