-
Notifications
You must be signed in to change notification settings - Fork 100
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
Kafka SSL with KRaft #951
Kafka SSL with KRaft #951
Conversation
e8c2bd2
to
8ab8296
Compare
corev1.EnvVar{ | ||
Name: "KAFKA_CFG_OFFSETS_TOPIC_NUM_PARTITIONS", | ||
Value: "25", | ||
}, |
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.
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.
I wonder if we should expose this from the CR? cc @agrare ?
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.
I've removed this since the partition limit is no longer necessary as #936 is now merged
Spec: corev1.PodSpec{ | ||
Hostname: "kafka", | ||
}, |
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 was needed because by default the hostname FQDN is the pod name however, for SSL it needs to match the CN used in the certs. See https://github.com/bitnami/containers/blob/main/bitnami/kafka/README.md#security
8ab8296
to
aee7643
Compare
Added |
service.Spec.Ports[0].Name = "kafka" | ||
service.Spec.Ports[0].Port = 9092 | ||
|
||
service.Spec.Ports = []corev1.ServicePort{ |
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.
I thikn there are issues with recreating the ports inside the func. @bdunne?
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.
I think this is okay since nothing else should be editing the ports
}, | ||
corev1.EnvVar{ | ||
Name: "KAFKA_CFG_BROKER_ID", | ||
Value: "1", |
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.
Does this number have to be configurable?
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 does not need to be configurable as the value itself doesn't matter and since we are only using one broker
The value should match the voter set in the quorum controller, in this case it is set to 1
to match the voter set here i.e. 1@kafka:9093
@@ -228,7 +240,51 @@ func KafkaDeployment(cr *miqv1alpha1.ManageIQ, scheme *runtime.Scheme) (*appsv1. | |||
}, | |||
Env: []corev1.EnvVar{ | |||
corev1.EnvVar{ | |||
Name: "KAFKA_BROKER_USER", | |||
Name: "KAFKA_ENABLE_KRAFT", |
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.
Please move all of the ENV vars into the reconcile function. You can use addOrUpdateEnvVar
like here that way if any of these change or become configurable in the future, they will be updated in the deployment.
}, | ||
} | ||
|
||
if certSecret := InternalCertificatesSecret(cr, client); certSecret.Data["kafka_truststore"] != nil && certSecret.Data["kafka_keystore"] != nil && certSecret.Data["kafka_keystore_pass"] != nil { |
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 conditional should also move into the reconcile function with the same env var comment above.
@bdunne I've moved the env vars to the reconcile function, please have another look when possible |
Checked commits nasark/manageiq-pods@aee7643~...ba480b3 with ruby 2.6.10, rubocop 1.28.2, haml-lint 0.35.0, and yamllint |
This pull request has been automatically marked as stale because it has not been updated for at least 3 months. If these changes are still valid, please remove the Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
This pull request is not mergeable. Please rebase and repush. |
This pull request has been automatically closed because it has not been updated for at least 3 months. Feel free to reopen this pull request if these changes are still valid. Thank you for all your contributions! More information about the ManageIQ triage process can be found in the triage process documentation. |
Depends on:
Ref:
See https://github.com/bitnami/containers/blob/main/bitnami/kafka/3.4/debian-11/rootfs/opt/bitnami/scripts/libkafka.sh for justification of env vars