Problem creating Global plugins

We are using kong-ingress-controller v0.7 and kong v 1.4.2 in DBLess mode and have difficulties creating global plugins.

An example plugin that we are trying to create is the following:

apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
  name: cors
  namespace: dev
  labels:
    global: "true"
config:
  origins:
    - "*"
  methods:
    - GET
    - PUT
    - POST
    - PATCH
    - DELETE
  headers:
    - Accept
    - Accept-Version
    - Content-Length
    - Content-MD5
    - Content-Type
    - Date
    - X-Auth-Token
    - Authorization
    - apikey
    - X-Request-ID
    - Consent-ID
  exposed_headers:
    - X-Auth-Token
    - Content-Disposition
  credentials: false
  max_age: 3600
plugin: cors

When I then try to verify the plugin through kongs admin api curl -k https://localhost:8444/plugins it has not been created.

The only thing I can see in the logs that are related to this plugin is a deprecation warning:

plugins.lua:174 DEPRECATED: /plugins/schema/:name endpoint is deprecated, please use /schemas/plugins/:name instead., client: 127.0.0.1, server: kong_admin, request: "GET /plugins/schema/cors HTTP/2.0", host: "localhost:8444"

So my question is what am I doing wrong here?

That error is harmless.

I took up your manifest and I was not able to reproduce. Can you delete the plugin and create it again.
While you are creating it again, tail the logs of the ingress controller and see if the controller records a successful sync or not.

Thanks for the fast reply. I will try to recreate the plugin and look for the output. In the meantime this is our config for the ingress-controller:

-------------------------------------------------------------------------------
Kong Ingress controller
Release:    0.7.0
Build:      e4605db
Repository: git@github.com:kong/kubernetes-ingress-controller.git
Go:         go1.13.1
-------------------------------------------------------------------------------
--update-status-on-shutdown=%!q(bool=true)
--kong-admin-filter-tag=["managed-by-ingress-controller"]
--election-id="ingress-controller-leader"
--kubeconfig=""
--vmodule=""
--kong-workspace=""
--kong-admin-concurrency='\n'
--admin-tls-skip-verify=%!q(bool=true)
--apiserver-host=""
--kong-admin-tls-skip-verify=%!q(bool=false)
--kong-url="https://localhost:8444"
--log_backtrace_at=":0"
--sync-period="10m0s"
--kong-admin-tls-server-name=""
--publish-service="integration/kong-ingress-proxy"
--admin-header=[]
--version=%!q(bool=false)
--watch-namespace="integration"
--log_dir=""
--kong-admin-ca-cert-file=""
--logtostderr=%!q(bool=true)
--admin-tls-server-name=""
--v="3"
--publish-status-address=""
--sync-rate-limit="0.3"
--alsologtostderr=%!q(bool=false)
--kong-admin-header=[]
--update-status=%!q(bool=true)
--stderrthreshold="2"
--anonymous-reports=%!q(bool=true)
--admission-webhook-cert-file="/admission-webhook/tls.crt"
--kong-admin-url="http://localhost:8001"
--kong-admin-token=""
--admin-ca-cert-file=""
--profiling=%!q(bool=true)
--admission-webhook-key-file="/admission-webhook/tls.key"
--ingress-class="kong"
--admission-webhook-listen="off"

--watch-namespace="integration"

You are creating the plugin in dev namespace but the controller is watching resources only in integration namespace.

Good catch, unfortunately that was just a copy paste error from our logs while I was creating this post.

It could be created without any issues when I re-applied the plugin once again. Sorry for taking your time and thanks for the response.


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ