# KongPlugin request-transformer reading value from k8s secret

**URL:** https://discuss.konghq.com/t/kongplugin-request-transformer-reading-value-from-k8s-secret/6924
**Category:** Questions
**Tags:** kubernetes
**Created:** [August 14, 2020, 11:51am UTC](https://discuss.konghq.com/t/kongplugin-request-transformer-reading-value-from-k8s-secret/6924 "2020-08-14T11:51:08Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![Robert.Kapala](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/robert.kapala/32/1993_2.png) [@Robert.Kapala](https://discuss.konghq.com/u/Robert.Kapala)
#### Post date: [August 14, 2020, 11:51am UTC](https://discuss.konghq.com/t/kongplugin-request-transformer-reading-value-from-k8s-secret/6924/1 "2020-08-14T11:51:08Z")

</div>

What would be best way to pick up values from k8s secret in `KongPlugin` config?

```auto
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  (...)
config:
  add:
    header:
    - Authorization:Basic $(<<reading from K8S secret >>)
plugin: request-transformer

```

Should I create an own version of this plugin, where value should be an  
name of secret and then read value of secret in lua code? (is it possible?)  
Or is there any other way get values from secrets?

Business reason: avoid to keep confidential values in repository with `KongPlugin` configuration.

---

<div class="post-metadata">

### Author: ![hbagdi](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/hbagdi/32/562_2.png) [@hbagdi](https://discuss.konghq.com/u/hbagdi)
#### Post date: [August 14, 2020, 7:49pm UTC](https://discuss.konghq.com/t/kongplugin-request-transformer-reading-value-from-k8s-secret/6924/2 "2020-08-14T19:49:15Z")

</div>

You can use `configFrom` to supply the entire configuration from a secret:

> <https://github.com/Kong/kubernetes-ingress-controller/blob/main/docs/references/custom-resources.md#kongplugin>
