Skip to content
This repository has been archived by the owner on Mar 16, 2024. It is now read-only.

Fix: Remove PDB for single replica deployment #2481

Closed
wants to merge 1 commit into from

Conversation

StrongMonkey
Copy link
Contributor

@StrongMonkey StrongMonkey commented Feb 16, 2024

Checklist

  • The title of this PR would make a good line in Acorn's Release Note's Changelog
  • The title of this PR ends with a link to the main issue being address in parentheses, like: This is a title (#1216). Here's an example
  • All relevant issues are referenced in the PR description. NOTE: don't use GitHub keywords that auto-close issues
  • Commits follow contributing guidance
  • Automated tests added to cover the changes. If tests couldn't be added, an explanation is provided in the Verification and Testing section
  • Changes to user-facing functionality, API, CLI, and upgrade impacts are clearly called out in PR description
  • PR has at least two approvals before merging (or a reasonable exception, like it's just a docs change)

We should remove PDB for single-replica container. It has casued us issues that prevent pods being evicted and node being consolidated.

Signed-off-by: Daishan Peng <daishan@acorn.io>
@@ -980,7 +980,10 @@ func ToFunctions(req router.Request, appInstance *v1.AppInstance, tag name.Refer
}
result = append(result, perms...)
}
result = append(result, sa, dep, pdb.ToPodDisruptionBudget(dep))
result = append(result, sa, dep)
if dep.Spec.Replicas != nil && *dep.Spec.Replicas > 1 {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: here and other places

Suggested change
if dep.Spec.Replicas != nil && *dep.Spec.Replicas > 1 {
if z.Dereference(dep.Spec.Replicas) > 1 {

@cjellick cjellick closed this Feb 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants