Creating Kong Entities dynamically


#1

Hi,

I am using Kong as Ingress Controller on K8s and I would like to create consumers and credentials through a UI service.

Now my understanding is that Kong Ingress Controller deletes any consumer that was created using the Kong Admin api when Kong is deployed as an Ingress as a corresponding kongconsumer object is not created.

So, in order to create users and assign them authentication credentials using an existing ui, what would be the best way?
Would using a JavaScript k8s client to create a kongconsumer be the right way or is there any other way to create users at runtime through the ui. I don’t want to create yaml files and them do kubectl. That is not an option.


#2

You would need to create a KongConsumer CRD in k8s for Ingress controller to sync it properly.
Whether you do it via yaml/kubectl or do it via your JavaScript UI, it’s up to you…

Please be careful with exposing your k8s API-server on the Internet, and if you do so, make sure you’ve proper authentication and authorization in place.

That being said, we’ve plans for future, to support creating entities in Kong via the Admin API and configure Kong Ingress Controller to ignore the manually created entities.