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

Externalizing of the configuration for kafka cluster creation with pr… #405

Merged
merged 3 commits into from
Jul 1, 2021
Merged

Externalizing of the configuration for kafka cluster creation with pr… #405

merged 3 commits into from
Jul 1, 2021

Conversation

rareddy
Copy link
Contributor

@rareddy rareddy commented Jun 29, 2021

…evious default values as starting point

@rareddy rareddy requested a review from shawkins June 29, 2021 20:36
@rareddy
Copy link
Contributor Author

rareddy commented Jun 29, 2021

// @ppatierno @MikeEdgar @grdryn

Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

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

I think this looks good. Just a few comments/thoughts.

@@ -81,31 +80,17 @@
// storage related constants
private static final double HARD_PERCENT = 0.95;
Copy link
Contributor

Choose a reason for hiding this comment

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

There's still an open issue on the hard/soft limits https://issues.redhat.com/browse/MGDSTRM-2836 I don't know however if there was agreement that the formula would just be based upon percentages. At some point we'll want to expand the settings to include that.

import java.util.TreeMap;
import java.util.stream.Collectors;

@ConfigProperties(prefix = "kafka")
Copy link
Contributor

Choose a reason for hiding this comment

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

It might be good if the root property prefix were more unique than kafka - we are kind of already using that for kafka=dev.

Looking a bit ahead it doesn't appear like using multiple configuration profiles (at least with a simplistic map / config property representation) is supported by quarkus - quarkusio/quarkus#8017

Copy link
Contributor Author

Choose a reason for hiding this comment

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

how about "managedkafka"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

used the "managedkafka" at the root level and collated "kafka" level properties into separate inner class now

.withXms("3G")
.withXmx("3G")
.withXx(JVM_OPTIONS_XX_MAP)
.withXms(this.config.getJvmXms())
Copy link
Contributor

Choose a reason for hiding this comment

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

In practice won't the min/max always be the same?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

true, but for flexibility I left as two, I can convert that to single value

Copy link
Contributor Author

Choose a reason for hiding this comment

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

remove the double and only has xms property now

@@ -451,10 +436,31 @@ private ResourceRequirements getKafkaExporterResources(ManagedKafka managedKafka
// this could be removed, when we contribute to Sarama to have the support for Elect Leader API
config.put("leader.imbalance.per.broker.percentage", 0);

if(managedKafka.getSpec().getVersions().isStrimziVersionIn(Versions.VERSION_0_22)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

This was probably hashed out on the other pr, but shouldn't this be more like a range check rather than in (or not in) a list of versions?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes, let us handle this in a separate issue. the version was not strictly semver, so I used something fast to release 0.7.0

@JsonProperty("kafka.enable-quota")
protected boolean enableQuota = true;

@JsonUnwrapped(prefix = "kafka.zoo-keeper.")
Copy link
Contributor

Choose a reason for hiding this comment

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

the "-" is actually weird :-) ... isn't "kafka.zookeeper" better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

right, that was due to your previous comment to use zookeeper vs zooKeeper the quarkus when camel case uses - in properties

Copy link
Contributor Author

Choose a reason for hiding this comment

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

removed the - and now it is simply zookeeper

@JsonProperty("kafka.jvm-xx")
protected String jvmXx = JVM_OPTIONS_XX;
@JsonProperty("kafka.enable-quota")
protected boolean enableQuota = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

imho we should have an inner Kafka class as we have for ZooKeeper. As I mention we see as KafkaInstance the overall deployment having Kafka, ZooKeeper, Canary, AdminServer and now even drain cleaner. I would see configuration parameter prefixed with kafka. or zookeeper. or maybe at some point canary. and adminserver. so encapsulating Kafka cluster related config into a specific inner class. Anyway, not a must do, just my view and my 2 cents.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started that way, but moved to this model where I thought I was fixing some configuration property confusion, I with later changes that is cleaner

Copy link
Contributor Author

@rareddy rareddy Jun 30, 2021

Choose a reason for hiding this comment

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

@ppatierno I reverted to my original model which exactly what you suggest above with Kafka and "ZooKeeperandExporter` classes and have room to grow easily with any additional compontents. The root is now called "managedkafka" and properties now look like

managedkafka.kafka.volume-size=1000Gi
managedkafka.kafka.jvm-xx=ExitOnOutOfMemoryError true
managedkafka.kafka.replicas=3
managedkafka.zookeeper.replicas=3
managedkafka.zookeeper.volume-size=10Gi```

@rareddy
Copy link
Contributor Author

rareddy commented Jun 30, 2021

@shawkins @ppatierno thanks for your comments give it another rinse.

Copy link
Contributor

@shawkins shawkins left a comment

Choose a reason for hiding this comment

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

LGTM

@k-wall the implication here is that every value is settable as an individual config property - which in the near-term could be useful.

Longer-term we are assuming broker per node apprach there will be multiple configurations - which would match the environment / instances the operator is deployed into.

For example if you install the operator into a cluster running on 2xlarge, it will have configuration set for 2xlarge installed somehow [1]. This way it will be possible for the operator to manage osd clusters that have different instance types.

[1] currently we just expect the normal quarkus mechanisms to supply the config properties. For the perf tests we will temporarily abuse the logging config override - since that can be used as a full configuration override as well. Ideally though this could have a dedicated config map or even mka settings. Alternatively we may eventually want to try to define multiple configuration profiles in the operator, rather than assuming that something will be providing those values. Assuming homogeneous deployments, the mka spec would then specify the default profile.

Copy link
Contributor

@ppatierno ppatierno left a comment

Choose a reason for hiding this comment

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

lgtm

@rareddy rareddy merged commit 43e1d55 into bf2fc6cc711aee1a0c2a:main Jul 1, 2021
@rareddy rareddy deleted the MGDSTRM-3981-LATEST branch July 1, 2021 16:01
@MikeEdgar MikeEdgar added this to the 0.8.0 milestone Jul 2, 2021
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.

None yet

4 participants