Kong / kubernetes-ingress-controller

:gorilla: Kong for Kubernetes: The official Ingress Controller for Kubernetes.
https://docs.konghq.com/kubernetes-ingress-controller/
Apache License 2.0
2.22k stars 592 forks source link

oauth2 tokens are dropped on KIC leader restart #4937

Open piermotte opened 1 year ago

piermotte commented 1 year ago

Is there an existing issue for this?

Current Behavior

When i restart pod which is the leader in db mode (postgres). A new leader is elected as expected, but recreates all the following resources: plugins, routes, uptreams, services, consumers.

This also deletes the oauth2 tokens present in the database.

Expected Behavior

A leader is elected without delete everything in db

Steps To Reproduce

Start kong, add consumers and create oauth2 tokens.
Kill the leader and check:
> select * from oauth2_tokens;

Kong Ingress Controller version

kong version: 3.2.2
kong ingress controller version: 2.9.1

Kubernetes version

1.24.14

Anything else?

Link to kong issue: https://github.com/Kong/kong/issues/11351

piermotte commented 10 months ago

Were you able to reproduce ?