I have my custom plugin (external-oauth) lua codes available in “/usr/local/share/lua/5.1/kong/plugins” location inside the container.
bash-5.0$ cd /usr/local/share/lua/5.1/kong/plugins/external-oauth/
bash-5.0$ ls
access.lua handler.lua schema.lua
But, I cannot see the same in “available_on_server” segment in admin API output.
{“plugins”:{“enabled_in_cluster”:,
“available_on_server”:{
“correlation-id”:true,
“pre-function”:true,
“cors”:true,
“ldap-auth”:true,
“loggly”:true,
“hmac-auth”:true,
“zipkin”:true,
“request-size-limiting”:true,
“azure-functions”:true,
“request-transformer”:true,
“oauth2”:true,
“response-transformer”:true,
“ip-restriction”:true,
“statsd”:true,
“jwt”:true,
“proxy-cache”:true,
“basic-auth”:true,
“key-auth”:true,
“http-log”:true,
“datadog”:true,
“tcp-log”:true,
“rate-limiting”:true,
“post-function”:true,
“prometheus”:true,
“acl”:true,
“kubernetes-sidecar-injector”:true,
“syslog”:true,
“file-log”:true,
“udp-log”:true,
“response-ratelimiting”:true,
“aws-lambda”:true,
“session”:true,
“bot-detection”:true,
“request-termination”:true}}
As a result, when I tried to load the same using the following yaml in Kbernetes it throw error.
apiVersion: configuration.konghq.com/v1
kind: KongPlugin
metadata:
name: external-oauth
labels:
global: “false”
enabled: true
config:
authorize_url: “Sign in to your account”
token_url: “Sign in to your account”
user_url: “https://login.microsoftonline.com/xxxxxxxxxxxxxxxxxxx/oauth2/userinfo”
client_id: “xxxxxxxxx-xxxxxxxxxxxxxxxxxxxx-xxxxxxx”
client_secret: “xxxxxxxxxxxxxxxxxxxxxxxxxxxx”
hosted_domain: “yyyyyyyyyyy.onmicrosoft.com”
user_keys: “email,name,sub”
scopes: “openid+profile+email”
email_key: “email”
plugin: external-oauth
And the error in ingress-controller container shows…
W1204 05:11:44.016434 1 queue.go:113] requeuing kube-system/persistent-volume-binder-token-h5z7l, err posting new config to /config: 400 Bad Request {“fields”:{“services”:[{“routes”:[{“plugins”:[{“name”:“plugin ‘external-oauth’ not enabled; add it to the ‘plugins’ configuration property”}]}]}]},“name”:“invalid declarative configuration”,“code”:14,“message”:“declarative config is invalid: {services={{routes={{plugins={{name="plugin ‘external-oauth’ not enabled; add it to the ‘plugins’ configuration property"}}}}}}}”}
What am I missing here ?