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

Don't default roleGroup replicas to zero when not specified #398

Closed
Tracked by #435
sbernauer opened this issue Sep 22, 2023 · 0 comments · Fixed by #402
Closed
Tracked by #435

Don't default roleGroup replicas to zero when not specified #398

sbernauer opened this issue Sep 22, 2023 · 0 comments · Fixed by #402
Assignees
Labels

Comments

@sbernauer
Copy link
Member

Affected version

0.0.0-dev

Current and expected behavior

In

/// Return replicas for a certain rolegroup.
pub fn role_group_replicas(&self, hdfs: &HdfsCluster, role_group: &str) -> i32 {
match self {
HdfsRole::NameNode => hdfs
.namenode_rolegroup(role_group)
.and_then(|rg| rg.replicas)
.unwrap_or_default()
.into(),
HdfsRole::DataNode => hdfs
.datanode_rolegroup(role_group)
.and_then(|rg| rg.replicas)
.unwrap_or_default()
.into(),
HdfsRole::JournalNode => hdfs
.journalnode_rolegroup(role_group)
.and_then(|rg| rg.replicas)
.unwrap_or_default()
.into(),
}
}
we set the sts replicas to 0, when the user does not configure a replicas number on a rolegroup.
Instead we should change the fn to pub fn role_group_replicas(&self, hdfs: &HdfsCluster, role_group: &str) -> Option<i32> and pass the Option<i32> directly into the sts.
This way when the user does not specify replicas, the sts will have not set set replicas and k8s will default to 1 pod.
Users can than use HPA to scale their Pods based on e.g. resource usage.
This is how other operators e.g. trino are doing it (the right way)

Possible solution

No response

Additional context

No response

Environment

No response

Would you like to work on fixing this bug?

None

@sbernauer sbernauer changed the title Don't default roleGroup replicas to zerowhen not specified Don't default roleGroup replicas to zero when not specified Sep 22, 2023
@sbernauer sbernauer self-assigned this Sep 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant