# Adding secrets to KongCredential resources

**URL:** <https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134>\
**Category:** Questions\
**Tags:** kubernetes\
**Created:** [March 29, 2019, 8:28am UTC](https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134 "2019-03-29T08:28:41Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgarcial](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/bgarcial/32/776_2.png) [@bgarcial](https://discuss.konghq.com/u/bgarcial)\
**Post date:** [March 29, 2019, 8:28am UTC](https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134/1 "2019-03-29T08:28:41Z")

</div>

Hi people.

I have these `KongCredential`s, resources with their respective `KongConsumers` and the `basic-auth` and `acl` `KongPlugins`

My question is: Can I apply it kubernetes secrets to `KongCredential`s resource?  
What kind of secrets? `generic` may be?

```
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: swaggerapi-basic-auth
  namespace: default
  labels:
    global: "false"
disabled: false
config:
  hide_credentials: true
plugin: basic-auth
---
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: swaggerapi-acl
  namespace: default
  labels:
    global: "false"
disabled: false
config:
  hide_groups_header: true
  whitelist: ["dev", "azure"]
plugin: acl
---
# User standard
apiVersion: configuration.konghq.com/v1
kind: KongConsumer
metadata:
  name: zcrm365consumer
  namespace: default
username: user
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
group: dev
metadata:
  name: credential-zcrm365-acl
  namespace: default
consumerRef: zcrm365consumer
type: acl
config:
  group: "dev"
---
apiVersion: configuration.konghq.com/v1
kind: KongCredential
metadata:
  name: credential-zcrm365
  namespace: default
consumerRef: zcrm365consumer
type: basic-auth
config:
  username: user
  password: passwd
---

```

---

<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:** [April 4, 2019, 9:14pm UTC](https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134/2 "2019-04-04T21:14:11Z")

</div>

Hi @bgarcial,

It is not possible to do this currently but is definitely something on the radar.

---

<div class="post-metadata">

**Author:** ![bgarcial](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/bgarcial/32/776_2.png) [@bgarcial](https://discuss.konghq.com/u/bgarcial)\
**Post date:** [April 25, 2019, 12:30pm UTC](https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134/3 "2019-04-25T12:30:35Z")

</div>

Does KONG not have its own environment variables? Maybe are there some specific flags similar to these?

```auto
spec:
      serviceAccountName: kong-serviceaccount
      initContainers:
      - name: wait-for-migrations
        image: kong:1.1
        command: ["/bin/sh", "-c", "kong migrations list"]
        env:
        - name: KONG_ADMIN_LISTEN
          value: 'off'
        - name: KONG_PROXY_LISTEN
          value: 'off'
        - name: KONG_PROXY_ACCESS_LOG
          value: "/dev/stdout"
        - name: KONG_ADMIN_ACCESS_LOG
          value: "/dev/stdout"
        - name: KONG_PROXY_ERROR_LOG
          value: "/dev/stderr"
        - name: KONG_ADMIN_ERROR_LOG
          value: "/dev/stderr"
        - name: KONG_PG_HOST
          value: postgres
        - name: KONG_PG_PASSWORD
          value: kong

```

---

<div class="post-metadata">

**Author:** ![mignatko](https://avatars.discourse-cdn.com/v4/letter/m/76d3ee/32.png) [@mignatko](https://discuss.konghq.com/u/mignatko)\
**Post date:** [May 15, 2019, 9:55am UTC](https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134/4 "2019-05-15T09:55:02Z")

</div>

Hi @hbagdi,  
Is there any update on this?

---

<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:** [May 17, 2019, 5:58pm UTC](https://discuss.konghq.com/t/adding-secrets-to-kongcredential-resources/3134/5 "2019-05-17T17:58:44Z")

</div>

The last update stands as is as of now.  
Design proposals on how to update the KongCredential CRD to support this are welcome.
