# Kong spec authentication with Postgres DB

**URL:** <https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608>\
**Category:** General\
**Tags:** kubernetes, kong-gateway\
**Created:** [September 1, 2022, 2:46pm UTC](https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608 "2022-09-01T14:46:40Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Heman\_Malve](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/heman_malve/32/3549_2.png) [@Heman\_Malve](https://discuss.konghq.com/u/Heman_Malve)\
**Post date:** [September 1, 2022, 2:46pm UTC](https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608/1 "2022-09-01T14:46:40Z")

</div>

Hi Team,

Referring to this link [Kong Spec Expose - Plugin | Kong Docs](https://docs.konghq.com/hub/optum/kong-spec-expose/)  
how to configure this plugin if its a k8s cluster which is connecting via KUBCONFIG from windows machine? please share insights here.  
(kong version is 2.8)

kong-spec-expose plugin is not available in “enabled\_plugins” list . my understanding is, installation process ([Kong Spec Expose - Plugin | Kong Docs](https://docs.konghq.com/hub/optum/kong-spec-expose/#installation)) will get enabled and below yaml file to apply on kubernetes cluster globally

apiVersion: [configuration.konghq.com/v1](http://configuration.konghq.com/v1)  
kind: KongClusterPlugin  
metadata:  
name: kong-spec-expose  
annotations:  
[kubernetes.io/ingress.class:](http://kubernetes.io/ingress.class:) kong  
labels:  
global: “true”  
config:  
spec\_url: [OpenAPI-Specification/examples/v2.0/json/petstore.json at main · OAI/OpenAPI-Specification · GitHub](https://github.com/OAI/OpenAPI-Specification/blob/master/examples/v2.0/json/petstore.json)  
plugin: kong-spec-expose

Link :[plugin configuration · Issue #12 · Optum/kong-spec-expose · GitHub](https://github.com/Optum/kong-spec-expose/issues/12)

please share some pointers on this …

---

<div class="post-metadata">

**Author:** ![traines](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/traines/32/158_2.png) [@traines](https://discuss.konghq.com/u/traines)\
**Post date:** [September 6, 2022, 10:16pm UTC](https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608/2 "2022-09-06T22:16:29Z")

</div>

KongClusterPlugin resources only configure plugins; they do not install them. You’ll want to instead store the plugin files in a ConfigMap and then use [charts/values.yaml at 1f5011ecca812f57c8d8e489c0eedc1a95c086b2 · Kong/charts · GitHub](https://github.com/Kong/charts/blob/1f5011ecca812f57c8d8e489c0eedc1a95c086b2/charts/kong/values.yaml#L364-L383) to load it.

You can alternately build a custom Docker image using the stock Kong image as a base and running `luarocks install kong-spec-expose`. You’ll need to set a `plugins` value under the `env` block that includes it with this method.

---

<div class="post-metadata">

**Author:** ![Heman\_Malve](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/heman_malve/32/3549_2.png) [@Heman\_Malve](https://discuss.konghq.com/u/Heman_Malve)\
**Post date:** [September 7, 2022, 2:27pm UTC](https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608/3 "2022-09-07T14:27:57Z")

</div>

Hi Travis,

I’m not preferring this solution to rebuild docker image after adding this plugin.

merely looking for the easy option to deploy this plugin (reference in yaml to get enabled in plugins-list )into Kong gateway which is residing on k8s cluster.

---

<div class="post-metadata">

**Author:** ![Heman\_Malve](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/heman_malve/32/3549_2.png) [@Heman\_Malve](https://discuss.konghq.com/u/Heman_Malve)\
**Post date:** [September 10, 2022, 7:03am UTC](https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608/4 "2022-09-10T07:03:33Z")

</div>

Additionally  
[charts/values.yaml at main · Kong/charts · GitHub](https://github.com/Kong/charts/blob/main/charts/kong/values.yaml) (# Custom Kong plugins can be loaded into Kong by mounting the plugin code)  
[Setting up custom plugin in Kubernetes environment - v2.5.x | Kong Docs](https://docs.konghq.com/kubernetes-ingress-controller/latest/guides/setting-up-custom-plugins/)  
[kong/kong.conf.default at master · Kong/kong · GitHub](https://github.com/Kong/kong/blob/master/kong.conf.default)  
I got some references on internet, let me try above options

Would be great, if you can share the sample /working of “[Setting up custom plugin in Kubernetes environment - v2.5.x | Kong Docs](https://docs.konghq.com/kubernetes-ingress-controller/latest/guides/setting-up-custom-plugins/#yaml)”

---

<div class="post-metadata">

**Author:** ![Heman\_Malve](https://yyz2.discourse-cdn.com/flex036/user_avatar/discuss.konghq.com/heman_malve/32/3549_2.png) [@Heman\_Malve](https://discuss.konghq.com/u/Heman_Malve)\
**Post date:** [September 13, 2022, 2:43pm UTC](https://discuss.konghq.com/t/kong-spec-authentication-with-postgres-db/10608/5 "2022-09-13T14:43:34Z")

</div>

Referring to this link - [Setting up custom plugin in Kubernetes environment - v2.5.x | Kong Docs](https://docs.konghq.com/kubernetes-ingress-controller/latest/guides/setting-up-custom-plugins/)

1. kubectl create configmap --from-file=.lua  
-n   
2)In Deployment kind added below entries and deployed again  
- name: KONG\_PLUGINS  
value: bundled,  
- name: KONG\_LUA\_PACKAGE\_PATH  
value: “./?.lua;./?/init.lua;”  
volumeMounts & volumes also
2. 

custom plugin deployed  
apiVersion: [configuration.konghq.com/v1](http://configuration.konghq.com/v1)  
kind: KongPlugin  
metadata:  
name:   
config:  
header\_value: “vault-auth plugin”  
plugin:
