-
Notifications
You must be signed in to change notification settings - Fork 594
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
KongCredentials are not associated immediately or never with KongConsumers #234
Comments
I found that if we recreated consumer, it will sync the credentials. Hope developer team to fix it. |
@HsinHeng What steps did you follow to make the sync work? |
versions:
Steps for me: please check you ingress-controller has any error message or not. Hope it could help you. |
Also experiencing this issue. I find the credentials do eventually populate but it takes a couple of hours. Is this expected behavior? |
@srleyva Can you share your steps to reproduce? |
Thanks for the response @hbagdi I'll give some context as well. I am working with an existing set of users that I am attempting to import into kong via a utility script I've written.
To reproduce locally I would try creating bulk consumers and credentials. I would use the Kong API directly but waiting on #246 |
I reproduced this issue above with a significant number of kong consumers (2750 consumers), using kong-ingress-controller v0.3.0 When I create the 2751th consumer, it is added to Kong's postgresql database by kong-ingress-controller pod but its jwt and basic auth credentials are never added, although I can list the credentials as custom resources from /apis/configuration.konghq.com/v1/namespaces/APP-NAMESPACE/kongcredentials API route. No error message is given either. The only way to have the 2751 consumers along with the matching 2751 JWTs and 2751 basic auths is to delete everything from Kong's consumers, jwt_secrets and basicauth_credential tables and wait for kong-ingress-controller to sync custom resources again i was wondering if this had something to to with kong consumers synchronisation not being over before its next round starts? |
An update here: I ran the tests ranging up to 4000 consumers and was not successful in reproducing this problem. Please test it with 0.5.0 (expect at least a release candidate to be out next week) and let us know if you run into this yet again. I'll leave the issue open for now. |
Closing this issue. |
However,I reproduce this problem with 0.5.0, Is there a problem with my configuration?
Ask for help , thx |
While ,After about seven minutes , postgresql has credential record, |
I am facing the same issue with 0.5.0 and Kong 1.3.0 with key-auth and Postgres. It's been over 10 minutes, but the credential didn't sync. However, if I first delete the keys (all keys for now) from Kong directly and then deleting (in K8s) one of the Credentials that synced, then the missing credential appears in Kong. Unfortunately, the deleted Credential (in K8s) also appears in Kong. (I know the Update and Delete are not yet implemented). I hope I am clear. Please ask if it's confusing. Thanks for your help! @hbagdi |
@hbagdi i'm testing the new 0.6.0 with 1.3.0 kong and somehow the issue is now much worse. I'm not sure how i arrived at this problem but it seems that kong no longer picks up any consumers that are created either via kubectl or helm.
Nothing happens at all. Kong ingress logs don't show anything at all. No error message of any kind. |
@dcherniv Are you using the default |
@hbagdi kong-internal is the class. These are startup params:
|
Okay, then you need to specify |
@hbagdi oh "duh" moment. Is there documentation that needs updating? i couldn't find anything relating to annotations. I can submit a PR, just point me where you want it. |
This is documented here: https://github.com/Kong/kubernetes-ingress-controller/blob/master/docs/references/annotations.md#kubernetesioingressclass PR to make it clearer welcome! |
@hbagdi What do you think about namespace level annotation? We need to change two many stuff's annotation when using different staging namespaces. |
Not totally against the idea. Another idea would be to watch a bunch of namespace. PRs/Issues to discuss this at length are welcome. |
NOTE: GitHub issues are reserved for bug reports only.
For anything else, please join the conversation
in Kong Nation https://discuss.konghq.com/c/kubernetes.
Summary
When a KongConsumer is created along with an associated KongCredential, it can take anywhere between 0 to infinite time in sec for the KongCredential records to get stored in Cassandra. The KongConsumer info is immediately stored whereas the credential info shows an unacceptable amount of latency almost every time.
As a result, Authentication fails as Kong can't find a valid consumer-credential pair.
Note:
Latency is mostly seen from creation of the second consumer and credential onwards or if CRDs are created back to back one after the other.
Kong Ingress controller version
0.3.0
Kong or Kong Enterprise version
1.0.3
Kubernetes version
Client Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.5", GitCommit:"f01a2bf98249a4db383560443a59bed0c13575df", GitTreeState:"clean", BuildDate:"2018-03-19T15:59:24Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"9", GitVersion:"v1.9.5", GitCommit:"f01a2bf98249a4db383560443a59bed0c13575df", GitTreeState:"clean", BuildDate:"2018-03-19T15:50:45Z", GoVersion:"go1.9.3", Compiler:"gc", Platform:"linux/amd64"}
Environment
uname -a
): Linux ****-master-01 3.10.0-514.el7.x86_64 Status of controller? #1 SMP Tue Nov 22 16:42:41 UTC 2016 x86_64 x86_64 x86_64 GNU/LinuxWhat happened
Unacceptable latency occurred whenever a new consumer and credential crd objects were created and authentication kept failing.
I created the following CRDs :
I then checked cassandra records and there is no credential for consumer with username 'pqr'.
API call result:
Expected behavior
KongConsumers and KongCredentials should get created at the same time and authentication plugins should be effective immediately.
Steps To Reproduce
The text was updated successfully, but these errors were encountered: