-
Notifications
You must be signed in to change notification settings - Fork 835
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
Enables SSL_SASL #4416
Enables SSL_SASL #4416
Conversation
Hi @abohmeed. Thanks for your PR. I'm waiting for a SeldonIO or todo member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository. |
/assign @RafalSkolasinski |
@RafalSkolasinski I've reopened the PR since the last one was incorrect |
@RafalSkolasinski Thanks. The old PR had unnecessary files modified (like topics.go) on which @agrski placed comments. So, I had to fix my branch and reopen a new PR where only two files are changed: server.go and utils.go. Sorry for any inconvenience. |
@abohmeed Once you fix your branch and push the PR should automatically update itself. If this is not the case it could be because you opened it from your |
@RafalSkolasinski Can't we just use this PR instead? I'm afraid I cannot reopen the old one since I re-forked the repo to avoid any issues. |
Okay, re-forking probably changes the situation. Let's continue here then 👍 |
@agrski I've addressed your comments from the previous PR (closed) except for this one #4414 (comment). Can we open a new conversation about it in this PR? |
/test integration |
We have
|
@abohmeed you should be able to run these tests locally with |
@RafalSkolasinski Thanks for getting back to me. |
/test integration |
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.
Thanks again @abohmeed for improving the Kafka support here. Thanks also for tidying up the PR to
These comments aren't blockers, but it'd be good to discuss/implement them to make this PR even more useful.
On the other hand, I think this PR should also update executor/logger/worker.go
to add in equivalent config handling there. This is the component that writes inference logs to Kafka (as opposed to a REST endpoint).
@@ -157,6 +157,16 @@ func (o SslKakfa) String() string { | |||
return "SslKakfa" | |||
} | |||
|
|||
type SaslKafka struct { | |||
UserName string |
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.
UserName string | |
Username string |
🙃 Minor point for consistency with Kafka, which treats this as one word rather than two
executor/api/kafka/server.go
Outdated
sslKakfaServer := util.GetSslElements() | ||
saslKafkaServer := util.GetSaslElements() |
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.
💭 The SASL config is only relevant when we know we're using SASL_SSL
so belongs within that conditional, ideally. This isn't a major change, but would be a little cleaner.
/test integration |
@abohmeed: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the jenkins-x/lighthouse repository. |
@agrski Thanks for your comments. I've addressed both points. |
@RafalSkolasinski @agrski Any updates? 🙂 |
Hi @abohmeed, just getting back to this now. Thanks for being so responsive and applying the recommendations. |
executor/api/kafka/server.go
Outdated
} | ||
} | ||
} | ||
if util.GetKafkaSecurityProtocol() == "SASL_PLAIN" { //if we also have SASL enabled, then we need to provide the necessary (no SSL) |
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.
💭 To avoid the potential for duplication here, structuring this block of code like the below pseudo-code would help:
if protocol == "SSL" || protocol == "SASL_SSL" {
getSslElements()
// set up SSL
}
if protocol == "PLAIN" || protocol == "SASL_PLAIN" {
getSaslElements()
// set up SASL
}
Does that makes sense? The idea is that instead of nesting logic, we do SSL setup if we need to, and independently SASL setup if we need to.
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 pattern would then apply to all 3 locations where changes need to happen (currently plaintext is only handled in 2 of them!)
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.
Yes, but if the protocol is PLAIN
without SASL then why grap SASL username and password at all? afaik PLAIN
mean no authentication mechanism.
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.
OK after reading your second comment, I will apply the change (if the docs say so 😉)
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.
Done
executor/logger/worker.go
Outdated
} | ||
} | ||
} | ||
if util.GetKafkaSecurityProtocol() == "SASL_PLAIN" { //if we also have SASL enabled, then we need to provide the necessary (no SSL) |
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.
🔧 From checking Kafka docs, I'm pretty sure the security protocol should be SASL_PLAINTEXT
(or PLAINTEXT
) instead of SASL_PLAIN
.
It's the SASL mechanism that might be PLAIN
.
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.
Done
@agrski I've addressed your latest comments |
@RafalSkolasinski @agrski Any updates yet? 🙂 |
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.
Let's get this in!
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: agrski The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The docs test failing feels like flakiness given nothing in this PR affects it, so I'll merge in spite of that. |
What this PR does / why we need it:
Enables SASL_SSL for Kafka cluster connections
Which issue(s) this PR fixes:
#4415
Fixes #
Special notes for your reviewer: