I then developed a custom plugin (test-introspection) which I have tested on my local deployment which is not Kubernetes and it also works fine. Now I need to move it to my AKS environment and I’m stuck!! Looked for a step-by-step guide/documentation on how to do this and I can’t find any except this discussion Custom Plugin not enabled
From what I gathered I need to do the following steps
Create a ConfigMap. - DONE
$ kubectl get configMap
NAME DATA AGE
test-custom-plugin 2 26h
Mount the volumes to the pods - No idea how to do this but I created the chart below
Update the deployment YAML for both kong and ingress. Setting the KONG_PLUGINS environment variable to bundled, test-introspection. And set the KONG_LUA_PACKAGE_PATH environment variable as well.
Exec into the Kong container and curl the / on Admin interface and make sure that these properties are set correctly - How do I do this?
Do you have any news about it?
I have the same situation, doubts about how to install a custom plugin in kong ingress controller, and I am following up on this case.
Let me see if I can help. Here are the steps I followed and eventually got my custom plugin working. Please backup your deployment yaml for kong and kong-ingress-controller
Create the configMap
kubectl get configMap NAME DATA AGE custom-plugin 2 26h
Make sure you can describe it kubectl describe configMap custom-plugin
Mount the configMap as Volume on your Kong and Ingress Deployments kubectl edit deployment kong and kubectl edit deployment kong-ingress-controller
Set Environment variables (both Kong and Kong-Ingress) by editing your deplyments kubectl edit deployment kong and kubectl edit deployment kong-ingress-controller
Thanks for the answer, as far as I tried, i managed to install my custom plugin, now I had another problem, if you could help me.
My custom plugin uses https://luarocks.org/modules/cdbattags/lua-resty-jwt as a dependency, when the containers are deployed again, the kong container fails because it does not find this dependency, therefore, there would be a way to add this dependency without modifying the image of Kong?
So far I was able to operate by installing the dependency on the kong image with luarocks, but I don’t think it is a clean solution when touching the image, I would like a more dynamic strategy similar to that of ConfigMaps, if it exists.
If you don’t want to install it in the image itself, you have two options that I can think of:
You can run luarocks install <lib> as an init-container. This means that luarocks should be reachable and up whenever your Kong container starts, which is a little risky.
Copy the code for the above lib, put it in another ConfigMap, mount that as a volume and include it in lua package path like you did for the plugin.
After updating the YAML finally custom pluing get install but after that got next issue. Now same POD, Deployment and Replicaset throwing “CrashloopOff”. After checking the log of the pod we got following error.