-
Notifications
You must be signed in to change notification settings - Fork 345
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
[oc] Auto create TLS cert in collector deployment #914
Conversation
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Juraci Paixão Kröhling <[email protected]>
Signed-off-by: Annanay <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good, thanks for this PR! I have only a couple of comments that would make our lives easier in the future.
The lint
step also failed because of tls.TLSConfig
. Rename to tls.Config
and it's all good :-)
cc @kevinearls, @jkandasa could one of you please give this a try? It should be sufficient to just run |
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
Thanks for the review @jpkrohling. I've addressed comments :) |
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
Looks good! The mentioned PR has been merged, so, this can be rebased against master again. @kevinearls, @jkandasa, could one of you please test this? |
Signed-off-by: Annanay <[email protected]>
@annanay25 do you need a cluster to test this? |
Yes, that would be great @jpkrohling :) . I need to confirm if |
Just sent you the details to your OpenShift cluster in private, via Gitter. |
Signed-off-by: Annanay <[email protected]>
There seems to be one warning -
I think its a client trying to connect to the collector without using TLS, but @jpkrohling could you PTAL? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This goes in the right direction and gets things deployed, but might need a couple of adjustments in order to work.
Signed-off-by: Annanay <[email protected]>
Looks like it's still not quite working yet. This is what I see in the Agent logs for the Query:
And this is from the collector logs:
I just got all the certs locally, and I was able to get a working setup. Looks like you are just missing the Agent parameter specifying the service-ca bundle, which makes the agent trust the certs generated by OpenShift's CA. Here's how to test it locally: $ kubectl get secrets simple-prod-collector-headless-tls -o=go-template='{{index .data "tls.crt"}}' | base64 -d > /tmp/cert.crt
$ kubectl get secrets simple-prod-collector-headless-tls -o=go-template='{{index .data "tls.key"}}' | base64 -d > /tmp/cert.key
$ kubectl apply -f deploy/examples/business-application-injected-sidecar.yaml
$ kubectl exec -c myapp myapp-7cb8b69d-nvvkv -- cat /var/run/secrets/kubernetes.io/serviceaccount/service-ca.crt > /tmp/service-ca.crt
$ SPAN_STORAGE_TYPE=memory go run -tags ui ./cmd/collector --collector.grpc.tls.enabled=true --collector.grpc.tls.cert=/tmp/cert.crt --collector.grpc.tls.key=/tmp/cert.key
$ sudo vi /etc/hosts # add a line with the cert's hostname: 127.0.0.1 simple-prod-collector-headless.default.svc
$ SPAN_STORAGE_TYPE=memory go run -tags ui ./cmd/agent --reporter.grpc.host-port=simple-prod-collector-headless.default.svc:14250 --reporter.grpc.tls.enabled=true --reporter.grpc.tls.ca=/tmp/service-ca.crt In the last command, you should see this in the logs:
TL;DR: it should be sufficient to add the following arg to the agent: |
Signed-off-by: Annanay <[email protected]>
Thanks @jpkrohling for the analysis. I've updated the PR. Also, thanks for provisioning the cluster, which can be taken down once this PR is merged :) |
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
Just added https://github.com/jaegertracing/jaeger-operator/pull/914/files#diff-acd8a9fe2d2997867f151eb11780379bR138-R146 in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's very close!
Signed-off-by: Annanay <[email protected]>
Done :) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great now, and I confirm that it works.
Could you add a couple of simple unit tests to cover the new lines? Especially about the issues we faced during these last tests.
When the platform is set to openshift
:
- the agent should have the TLS options, and the "server-name" should contain
${namespace}.svc.cluster.local
- same for the sidecar
- the collector should have the new TLS options
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, just update the deprecated flag and it's ready to be merged (provided that the CI tests pass).
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
Signed-off-by: Annanay <[email protected]>
@jpkrohling - Could you please re-run CI on this? I'm not sure if the operator deployment is failing because of this PR |
Merging, as the tests are passing locally:
Note that the last one had to be executed twice, because of #945. |
Thanks! 🎉 |
For OpenShift platform -
service.beta.openshift.io/serving-cert-secret-name
Resolves: #599
Signed-off-by: Annanay [email protected]