Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

added pdb to helm

Type of Change

  • New feature

Testing

Tested manually

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the Contributor License Agreement (CLA)

@vercel
Copy link

vercel bot commented Oct 13, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
docs Ready Ready Preview Comment Oct 13, 2025 7:10pm

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

Greptile Overview

Summary

Adds PodDisruptionBudget (PDB) resources for the app and realtime deployments to improve availability during voluntary disruptions like node drains and rolling updates.

Key Changes:

  • Created PDB templates for both app and realtime components
  • PDBs are conditionally enabled based on podDisruptionBudget.enabled and component enabled flags
  • Uses minAvailable constraint from values configuration
  • Properly integrates with existing selector labels

Issues Found:

  • Critical: With default replicaCount: 1 and minAvailable: 1, the PDB will completely block voluntary disruptions, preventing rolling updates and node drains
  • Limited flexibility: only supports minAvailable, missing maxUnavailable option

Confidence Score: 3/5

  • This PR has a critical configuration issue that will block updates in default setup
  • The PDB implementation is structurally sound with proper templating and conditionals, but has a critical logic flaw: with default values (replicaCount: 1, minAvailable: 1), voluntary disruptions will be completely blocked, preventing rolling updates and node maintenance. This needs to be addressed before merging.
  • helm/sim/templates/poddisruptionbudget.yaml requires attention for the minAvailable configuration logic

Important Files Changed

File Analysis

Filename Score Overview
helm/sim/templates/poddisruptionbudget.yaml 3/5 Added PDB for app and realtime deployments with minAvailable configuration; potential issues with default single replica setup

Sequence Diagram

sequenceDiagram
    participant User
    participant Helm
    participant K8s API
    participant PDB Controller
    participant Deployments
    
    User->>Helm: Install/Upgrade with podDisruptionBudget.enabled=true
    Helm->>Helm: Check app.enabled and realtime.enabled
    Helm->>K8s API: Create PDB for app (if app.enabled)
    Helm->>K8s API: Create PDB for realtime (if realtime.enabled)
    K8s API->>PDB Controller: Register PDB resources
    PDB Controller->>Deployments: Monitor pod counts via selector labels
    
    Note over PDB Controller,Deployments: Ongoing: PDB Controller enforces minAvailable constraint
    
    User->>K8s API: Trigger voluntary disruption (drain/update)
    K8s API->>PDB Controller: Check if disruption allowed
    alt minAvailable constraint met
        PDB Controller->>K8s API: Allow disruption
        K8s API->>Deployments: Proceed with disruption
    else minAvailable constraint violated
        PDB Controller->>K8s API: Block disruption
        K8s API->>User: Disruption blocked by PDB
    end
Loading

1 file reviewed, 2 comments

Edit Code Review Agent Settings | Greptile

@waleedlatif1 waleedlatif1 merged commit 2da7a67 into staging Oct 13, 2025
3 of 4 checks passed
@waleedlatif1 waleedlatif1 deleted the fix/helm branch October 13, 2025 19:06
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.

2 participants