Skip to content
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

Add support for defining key names used for existing SASL and TSL Secrets #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kjvellajr
Copy link

  • Add support for defining key names used for existing SASL and TSL Secrets. This is useful when the existing secrets are generated from a different system, such as Strimzi.

    • Ideally the path for existingSecret should be changed to fit under the kafka.{x}.existing path, but I left it where it is currently at to not break backwards compatibility.
  • Fix documentation for SASL and TSL existingSecret paths. I found that the existing documented paths kafka.sasl.credentials.existingSecret and kafka.tls.certificates.existingSecret are incorrect and instead should be kafka.sasl.existingSecret and kafka.tls.existingSecret respectively. These are used within the templates/_helpers.tpl file.

Copy link
Member

@weeco weeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey,
I am not sure whether this change is justified. One could simply create a new secret (instead of using the one created by Strimzi or whatever operator) which complies with the desired format.

@kjvellajr
Copy link
Author

Hello!

First off thanks for the quick response.

Generating a secret specific to Kafka-Minion is pretty easy to do and I have that scripted right now. Part of the problem I have though is keeping that secret up-to-date. If / when a new cert is issued by Strimzi I need to regenerate the Kafka-Minion secret. Anything short of a controller dedicated to creating that secret (to my knowledge) will require some manual steps which I am trying to avoid.

The last piece of the puzzle for avoiding manual steps will be annotating the deployment for Kafka-Minion to tie the deployment to the secret so that when the secret is changed, the Kafka-Minion deployment is rolled. Reloader will handle that.

If this change, and another change to support custom annotations for the Kafka-Minion deployment is out of scope, I can work on a different strategy.

Thanks for your time.

Copy link
Member

@weeco weeco left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alright thank you for eloborating the usecase.

README.md Outdated
@@ -33,12 +33,18 @@ helm install --name=kafka-minion kafka-minion/kafka-minion
| `kafka.brokers` | Comma delimited list of brokers to connect to | (none) |
| `kafka.sasl.enabled` | Bool to enable/disable SASL authentication (only SASL_PLAINTEXT is supported) | `false` |
| `kafka.sasl.useHandshake` | Whether or not to send the Kafka SASL handshake first | `true` |
| `kafka.sasl.credentials.existingSecret` | Secretname of an existing secret which contains SASL credentials | (none) |
| `kafka.sasl.existingSecret` | Secretname of an existing secret which contains SASL credentials | (none) |
| `kafka.sasl.existing.username` | Keyname of an existing key on an existing secret which contains SASL username | `username` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kafka.sasl.existing.usernameKey is more accurate I think? Accordingly for the other property names

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went back and forth with that naming scheme and what I currently have. I am indifferent. I will update the PR to suffix these new values with Key.

…rets; also fix documentation for SASL and TSL existingSecret paths
@kjvellajr
Copy link
Author

Suggested changes have been made to the source branch.

@@ -33,12 +33,18 @@ helm install --name=kafka-minion kafka-minion/kafka-minion
| `kafka.brokers` | Comma delimited list of brokers to connect to | (none) |
| `kafka.sasl.enabled` | Bool to enable/disable SASL authentication (only SASL_PLAINTEXT is supported) | `false` |
| `kafka.sasl.useHandshake` | Whether or not to send the Kafka SASL handshake first | `true` |
| `kafka.sasl.credentials.existingSecret` | Secretname of an existing secret which contains SASL credentials | (none) |
| `kafka.sasl.existingSecret` | Secretname of an existing secret which contains SASL credentials | (none) |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unfortunately this is not correct. Apparently I was inconsistent with the naming between the SASL and TLS credentials. I can not merge this because this would be a breaking change :(. I'm sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants