Storing custom entities on a custom plugin (DB-less)

Hi,

I’m running Kong 2.1 as Ingress Controller. I wrote a custom plugin which stores a custom entity, then I created a migration for it although I assume it’s not going to be executed since there is no DB…
the log error I get when trying to store my custom entity is:
cannot create ‘’ entities when not using a database
so my question is: can I store custom entities when using DB-less mode? and if so, How?

Many Thanks! :slightly_smiling_face:

Controller-managed DB-less instances can use custom entities, yes: https://docs.konghq.com/kubernetes-ingress-controller/1.0.x/guides/configuring-custom-entities/

You can’t use API endpoints to create them since the DB-less state file created all at once, but the system covered in that document will instruct the controller to add your entities when it builds the state file.

Thank @traines!

How can I find the ID used in the plugin’s config Configuring Custom Entities - v1.0.x (konghq.com)

I guessed

curl -k https://my-aks-ip:8444/<entity-name>

would return the custom entity’s info (including it’s IP) but for some reason, it doesn’t work. I get:

curl: (28) Failed to connect to my-aks-ip port 8444: Connection timed out

The documentation says that I should run:

kubectl port-forward kong/kong-pod-name 8444:8444

but it wasn’t working (server doesn’t have a resource type “kong”)
so I used:

kubectl port-forward kong-pond-name 8444:8444 -n kong
Forwarding from 127.0.0.1:8444 -> 8444
Forwarding from [::1]:8444 -> 8444

Doc had incorrect syntax. What you did with -n was correct, and I’ve sent in a request to fix it. Were you able to retrieve entities after the second port forward, with curl -k https://localhost:8444/<entity-name>?

No @traines, I tried both localhost and with our AKS-IP but both return the same result:

curl: (28) Failed to connect to <localhost/AKS-IP> port 8444: Connection timed out


© 2019 Kong Inc.    Terms  •  Privacy  •  FAQ