-
Notifications
You must be signed in to change notification settings - Fork 344
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
Jaeger Operator generating secrets on a regular basis #521
Comments
How often are the secrets being created? |
They are being created quite frequently. In the last 20 hours for example I have had 193 msa-jaeger-ui-proxy-token secrets created. |
@samcrutt9900 would you be able to set |
@jpkrohling Attached is the log. I believe you can see a new secret being created here: |
Interesting. I assume you did not update your Jaeger CR, and yet, there are changes to some objects:
There might be a bug in the logic that compares the expected vs. existing objects. I'm looking into this now. |
Thanks for looking into this and no I did not update the Jaeger CR |
@jpkrohling One thing to add, in case it has any bearing on the situation, I have created my own kubernetes secret in the observability (jaeger) namespace. This secret is a standard secret that has none of the jager-operator annotations so should not be managed by it. |
I think I need more info to reproduce this. Would you be able to come up with a minimal CR that triggers the problem? Do you have access to an OpenShift 4.x cluster? I tried on both OpenShift 4.x with CRC (CodeReady Containers), and OpenShift 3.11 with minishift, and I couldn't really reproduce this. I tried deploying the $ kubectl get secrets | grep simplest
simplest-dockercfg-h47p4 kubernetes.io/dockercfg 1 5m
simplest-dockercfg-nf5t9 kubernetes.io/dockercfg 1 5m
simplest-token-88qn8 kubernetes.io/service-account-token 4 5m
simplest-token-jcsq2 kubernetes.io/service-account-token 4 5m
simplest-token-nr6cb kubernetes.io/service-account-token 4 5m
simplest-token-shfm4 kubernetes.io/service-account-token 4 5m
simplest-ui-oauth-proxy-tls kubernetes.io/tls 2 5m
simplest-ui-proxy-dockercfg-7xbnp kubernetes.io/dockercfg 1 5m
simplest-ui-proxy-dockercfg-z2s4z kubernetes.io/dockercfg 1 5m
simplest-ui-proxy-token-8nbkw kubernetes.io/service-account-token 4 5m
simplest-ui-proxy-token-g9v7b kubernetes.io/service-account-token 4 5m
simplest-ui-proxy-token-mztzf kubernetes.io/service-account-token 4 5m
simplest-ui-proxy-token-t4sjk kubernetes.io/service-account-token 4 5m I then changed the CR to trigger a reconciliation, and got two more: $ kubectl get secrets | grep simplest
simplest-dockercfg-h47p4 kubernetes.io/dockercfg 1 8m
simplest-dockercfg-nf5t9 kubernetes.io/dockercfg 1 8m
simplest-dockercfg-p5tzt kubernetes.io/dockercfg 1 30s
simplest-token-88qn8 kubernetes.io/service-account-token 4 8m
simplest-token-jcsq2 kubernetes.io/service-account-token 4 8m
simplest-token-nr6cb kubernetes.io/service-account-token 4 8m
simplest-token-qw7dk kubernetes.io/service-account-token 4 30s
simplest-token-shfm4 kubernetes.io/service-account-token 4 8m
simplest-token-sk9rm kubernetes.io/service-account-token 4 30s
simplest-ui-oauth-proxy-tls kubernetes.io/tls 2 8m
simplest-ui-proxy-dockercfg-7xbnp kubernetes.io/dockercfg 1 8m
simplest-ui-proxy-dockercfg-tmwxq kubernetes.io/dockercfg 1 30s
simplest-ui-proxy-dockercfg-z2s4z kubernetes.io/dockercfg 1 8m
simplest-ui-proxy-token-8nbkw kubernetes.io/service-account-token 4 8m
simplest-ui-proxy-token-g9v7b kubernetes.io/service-account-token 4 8m
simplest-ui-proxy-token-mqh4n kubernetes.io/service-account-token 4 30s
simplest-ui-proxy-token-mztzf kubernetes.io/service-account-token 4 8m
simplest-ui-proxy-token-t4sjk kubernetes.io/service-account-token 4 8m
simplest-ui-proxy-token-z974b kubernetes.io/service-account-token 4 30s Every change then seems to create two tokens, but there's no constant stream of new tokens appearing for me, as the bug report suggests. I guess I'm just not triggering the bug. In time: ideally, we'd have only one token per change, but the current version of the Jaeger Operator persists a complete CR with empty fields after the first reconciliation loop, which explains the duplicate reconciliation loop (one for the original CR, one for the CR with empty fields). This should be fixed by #517, as we'd then omit the empty fields. I expect the CR after the first reconciliation to be the same as what the user specified, so, no changes would be triggered. In any case, this does not explain why there are hundreds of service account tokens there. |
I will try out the simplest CR on our platform and see if I get the same issue. |
I tried deploying the same simple CR as you @jpkrohling but get the same result as before.
|
@jkandasa After some more investigation I believe I am seeing the same behaviour as you, whereby extra service account secrets are created for a change to the CR. The difference is the Jaeger CR reconciliation on my deployment seems to be being triggered on a regular basis by this:
So I guess I need to understand why I get so many watch too old messages and understand if the change #517 will resolve it. |
@jpkrohling I guess, the previous comment is for you. |
@samcrutt9900 I'll give some more attention to this issue today, but while I try to figure out why you are getting so many reconciliation loops, would you be willing to test a temporary image with master+ #517? |
@jpkrohling Yes I can test a temp image with #517. What is the best way to build this image? |
Awesome. I just fixed the merge conflicts from #517 and published an image for you: jpkroehling/jaeger-operator:466-ValidateCR |
@jpkrohling I am running the image provided above but see some issues around the cluster role that the operator SA uses in the log.
And then I repeatedly see this
Is there a change to the cluster role as part of this change that I need to apply ? |
Sorry, yes, there's a new rule to the The first message is OK, it's just the operator telling you that it might enable extra features if given more permissions. If you are curious about this feature, look for |
Unfortunately I am still seeing the generation of secrets when a change to the CR happens.
Which resulted in this being logged by the operator:
And the creation of these additional secrets
|
Depending on the change, this should indeed happen. I just found the root cause for this behavior: OpenShift is injecting the token into the ServiceAccount object, and the operator will detect that as something that needs to be "reconciled". In this case, the operator is removing the service account token from the service account, which is causing OpenShift to create a new one and update the SA again. I'll publish a new image soon fixing this. |
@jpkrohling I tested with the image built from the above pull request and confirm that I no longer see secrets getting created each time a change to the jaeger CR is picked up. |
Thanks for the confirmation, for the bug report and for the patience :) |
I have deployed jaeger operator version 1.13.1 onto Openshift version 3.11
The operator appears to be generating secrets for msa-jaeger-ui-proxy-token, msa-jaeger-ui-proxy-dockercfg and msa-jaeger-token on a regular basis and therefore the amount of secrets in the namespace is constantly growing.
I see there was a related issue #286 that has been marked as resolved but I am still seeing the issue.
The text was updated successfully, but these errors were encountered: