-->

DEVOPSZONES

  • Recent blogs

    How to get all the running pods for a specific Helm release

     To get all the running pods for a specific Helm release, you can use kubectl and filter by the Helm release label.

    Here’s a command that works in most cases:

    kubectl get pods -l "release=<release-name>" --field-selector=status.phase=Running -A

    Explanation:

    • -l "release=<release-name>": Filters pods by the Helm release label.

    • --field-selector=status.phase=Running: Only returns pods in Running state.

    • -A: Checks across all namespaces

    Example:

    kubectl get pods -l "release=my-app" --field-selector=status.phase=Running -n my-namespace

    If you're unsure about the labels used by Helm (as newer versions might use different labels), you can find them by inspecting the resources:


    kubectl get all -n <namespace> --selector app.kubernetes.io/instance=<release-name>

    Or for just pods:


    kubectl get pods -n <namespace> -l app.kubernetes.io/instance=<release-name>

    No comments