# Setup of cors plugin fails in K8s

**URL:** https://discuss.konghq.com/t/setup-of-cors-plugin-fails-in-k8s/5524
**Category:** Questions
**Tags:** kubernetes
**Created:** [February 12, 2020, 9:08am UTC](https://discuss.konghq.com/t/setup-of-cors-plugin-fails-in-k8s/5524 "2020-02-12T09:08:42Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![veny](https://avatars.discourse-cdn.com/v4/letter/v/b5ac83/32.png) [@veny](https://discuss.konghq.com/u/veny)
#### Post date: [February 12, 2020, 9:08am UTC](https://discuss.konghq.com/t/setup-of-cors-plugin-fails-in-k8s/5524/1 "2020-02-12T09:08:42Z")

</div>

Hi,  
I am trying to activate cors plugin in my K8s cluster, unfortunately a face a trouble not really clear to me.  
I have installed Kong as follows:

> helm3 repo add kong [https://charts.konghq.com](https://charts.konghq.com)  
> helm3 repo update  
> helm3 install -f values.yaml --skip-crds kong kong/kong

with this values.yaml:

```
image:
  tag: 2.0.1-alpine
ingressController:
  enabled: true
```

then I apply following KongPlugin configuration via ‘kubectl apply -f …’

```
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
plugin: cors
enabled: true
run_on: first
metadata:
  name: cors-ingress
  namespace: default
  labels:
    global: "true"
config:
  origins: ["*"]
  methods:
    - GET
    - POST
  headers:
    - Accept
    - Accept-Version
    - Content-Length
    - Content-MD5
    - Content-Type
    - Date
    - X-Auth-Token
  exposed_headers: ['X-Auth-Token']
  credentials: true
  max_age: 3600
```

and I can see an error message in logs of the ingress-controller pod ‘kong-kong-…’

> E0212 09:07:29.113337 1 controller.go:119] unexpected failure updating Kong configuration:  
> posting new config to /config: 400 Bad Request {“fields”:{“plugins”:[{“run\_on”:“unknown field”}]},“name”:“invalid declarative configuration”,“code”:14,“message”:“declarative config is invalid: {plugins={{run\_on="unknown field"}}}”}  
> W0212 09:07:29.113360 1 queue.go:112] requeuing kube-system/clusterrole-aggregation-controller-token-mx7p7, err posting new config to /config: 400 Bad Request {“fields”:{“plugins”:[{“run\_on”:“unknown field”}]},“name”:“invalid declarative configuration”,“code”:14,“message”:“declarative config is invalid: {plugins={{run\_on="unknown field"}}}”}

what is wrong here? I have my ‘run\_on’ parameter in plugin setup.  
thank you,  
veny

---

<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: [February 12, 2020, 5:01pm UTC](https://discuss.konghq.com/t/setup-of-cors-plugin-fails-in-k8s/5524/2 "2020-02-12T17:01:02Z")

</div>

Please upgrade to Controller 0.7.1.

---

<div class="post-metadata">

### Author: ![veny](https://avatars.discourse-cdn.com/v4/letter/v/b5ac83/32.png) [@veny](https://discuss.konghq.com/u/veny)
#### Post date: [February 13, 2020, 6:43am UTC](https://discuss.konghq.com/t/setup-of-cors-plugin-fails-in-k8s/5524/3 "2020-02-13T06:43:25Z")

</div>

that helped, thank you @hbagdi
