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

Fix: pdb-min-available when Replica number is controlled via HPA #688

Merged
merged 15 commits into from
Jan 23, 2024

Conversation

jpedrobf
Copy link
Contributor

@jpedrobf jpedrobf commented Jan 8, 2024

I believe this solves #637.

The commit history might be a little messy but it was made with heart 💚

@jpedrobf jpedrobf requested a review from janisz as a code owner January 8, 2024 14:59
pkg/templates/pdbminavailable/template.go Outdated Show resolved Hide resolved
pkg/templates/pdbminavailable/template.go Outdated Show resolved Hide resolved
pkg/templates/pdbminavailable/template.go Outdated Show resolved Hide resolved
jpedrobf and others added 4 commits January 8, 2024 13:44
* feat: creates an HPA Map Object to avoid nested for

* chore: rm unused code
* feat: creates an HPA Map Object to avoid nested for

* chore: rm unused code

* fix: map inicialization size

* fix: bool check error
@jpedrobf jpedrobf requested a review from janisz January 9, 2024 21:39
@jpedrobf
Copy link
Contributor Author

jpedrobf commented Jan 9, 2024

@janisz, giving an update: @jvtartaglia helped a lot in refining the code to avoid nested for inside the code and reduce complexity. If there's any other feedback, we're happy to follow up on it 😄

Copy link
Collaborator

@janisz janisz left a comment

Choose a reason for hiding this comment

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

LGTM except one last comment about supported versions.
Also if you like it will be great to have a e2e test for that with different autoscaling version .e.g: that will pass on this PR

---
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
  name: baz
  namespace: bar
spec:
  minAvailable: 1
  selector:
    matchLabels:
      name: example
---
apiVersion: autoscaling/v2beta1
kind: HorizontalPodAutoscaler
metadata:
  name: app
  namespace: bar
spec:
  minReplicas: 4
  maxReplicas: 100
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: foo
    namespace: bar
  targetCPUUtilizationPercentage: 85
---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: foo
  namespace: bar
spec:
  selector:
    matchLabels:
      name: example
  template:
    metadata:
      labels:
        name: example

pkg/templates/pdbminavailable/template.go Outdated Show resolved Hide resolved
@janisz janisz added the bug Something isn't working label Jan 18, 2024
jpedrobf and others added 3 commits January 22, 2024 17:34
…on-v2 version (#6)

* feat: support to others autoscaling versions using extract package and an e2e-test with a non v2 version

* Chore/reorganize code (#7)

* chore: reorg code

* chore: rename var

---------

Co-authored-by: João Tartaglia <[email protected]>
@janisz
Copy link
Collaborator

janisz commented Jan 23, 2024

@jpedrobf Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants