{"data":{"slug":"github-google-skills-skills-cloud-gke-statefulset-without-probes-c24acf8d54f1","title":"Audit GKE StatefulSets for Missing Readiness Probes","summary":"This skill identifies GKE StatefulSets protected by a PodDisruptionBudget (PDB) but missing readiness probes, which can lead to premature eviction during disruptions. It provides recommendations for fixing the issue.","url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-statefulset-without-probes-c24acf8d54f1","json_url":"https:\/\/skillshunter.net\/api\/public\/v1\/skills\/github-google-skills-skills-cloud-gke-statefulset-without-probes-c24acf8d54f1","markdown_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-statefulset-without-probes-c24acf8d54f1.md","download_url":"https:\/\/skillshunter.net\/skills\/github-google-skills-skills-cloud-gke-statefulset-without-probes-c24acf8d54f1\/download","category":{"slug":"software-development","name":"Software & Development"},"editor_note":"Before executing any commands, ensure that the Google Cloud SDK is installed and configured, the Kubernetes Engine and Recommender APIs are enabled, and the user has the appropriate IAM roles (`roles\/container.viewer` or `roles\/container.developer`). Verify that the cluster is not part of a Managed Airflow environment, as changes to such clusters may be restricted.","instructions":"---\nname: gke-statefulset-without-probes\nmetadata:\n  version: \"1.0.0\"\n  category: Containers\ndescription: >-\n  Audits, detects, and proposes fixes for GKE StatefulSets that are protected\n  by a PodDisruptionBudget (PDB) but lack container readiness probes (GKE\n  insight subtype PDB_STATEFULSET_WITHOUT_PROBES), causing replacement Pods to\n  be counted as healthy before they are ready during voluntary disruptions. Use\n  when asked to check, audit, or propose fixes for the\n  PDB_STATEFULSET_WITHOUT_PROBES condition, missing readinessProbe\n  configurations on PDB-protected GKE StatefulSets, or premature eviction of\n  StatefulSet replicas during node pool upgrades or drains despite having a\n  PDB. Don't use for StatefulSets missing a PDB (PDB_UNPROTECTED_STATEFULSET),\n  PDBs that allow zero disruptions (PDB_UNPERMISSIVE), general probe and PDB\n  setup unrelated to this condition (use gke-reliability), Pods stuck in\n  Pending (use gke-workload-troubleshooting), ComputeClass configuration (use\n  gke-compute-classes), manifest generation (use gke-manifest-generation), or\n  cluster upgrade planning (use gke-upgrades).\n---\n\n# GKE StatefulSet without readiness probes\n\nUse this skill to find, verify, and propose fixes for `StatefulSet` workloads in\nGKE clusters that are configured with a `PodDisruptionBudget` (PDB) but without\ncontainer readiness probes (`readinessProbe`), corresponding to the\n`PDB_STATEFULSET_WITHOUT_PROBES` insight subtype.\n\nAs explained in the section\n[When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt),\nPDBs respect readiness probes when they look at which Pods can be counted as\nhealthy. Therefore, if a Pod covered by a PDB does not have a readiness probe\nconfigured, the PDB has limited visibility into whether the Pod is healthy or is\njust up and running. A Pod is considered healthy by a PDB when its `Ready`\ncondition is `True` (see the section\n[Healthiness of a Pod](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)),\nand a container without a readiness probe defaults to a `Success` readiness\nstate once started (see the section\n[Probe results](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)).\n\n> **Read-only rule**: Run read-only diagnostic commands only. Never drain,\n> delete, or re-create nodes, never dismiss a recommendation, and never run any\n> other command that changes the cluster. Give the user any fix to apply\n> themselves.\n\nWhen guiding the user or recommending a check or fix, always include the exact\nlinked section names and URLs from this skill in your response (do not search\nlocal repository files to copy commands).\n\n## Usage attribution\n\n**MUST READ**: Before executing any `gcloud`, REST API, or MCP command, you MUST\nread and follow the instructions in\n[Usage Attribution](references\/attribution.md).\n\n## Prerequisites\n\n-   **Google Cloud SDK and tools**:\n    -   To install and initialize `gcloud` (project selection and\n        authentication) and enable the Kubernetes Engine API\n        (`container.googleapis.com`), follow the instructions in the section\n        [Before you begin](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/optimize-with-recommenders.md.txt).\n        Also ensure that the Recommender API (`recommender.googleapis.com`) is\n        enabled to view insights and recommendations.\n    -   To install `kubectl` and configure cluster credentials, follow the\n        \"Install kubectl\", \"Install required plugins\", and \"Store cluster\n        information for kubectl\" sections of\n        [Install kubectl and configure cluster access](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/cluster-access-for-kubectl.md.txt).\n-   **Billing**: Verify that the Google Cloud project has an active Cloud\n    Billing account attached.\n-   **IAM roles**:\n    -   `roles\/container.viewer` to read cluster details, StatefulSets, PDBs,\n        and GKE diagnosis insights and recommendations.\n    -   `roles\/container.developer` only if the user later applies the fix.\n-   **Documentation**:\n    -   [Ensure workloads are disruption-ready](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)\n        (Sections: \"Identify workloads with vulnerability to disruption\", \"When\n        GKE identifies workloads with vulnerability to disruption\", \"Implement\n        the guidance to improve disruption readiness\")\n    -   [Optimize your usage of GKE with insights and recommendations](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/optimize-with-recommenders.md.txt)\n        (Sections: \"Before you begin\", \"View insights and recommendations\")\n    -   [Deploying a stateful application](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/stateful-apps.md.txt)\n        (Sections: \"Inspecting a StatefulSet\", \"Updating a StatefulSet\",\n        \"Inspecting update rollout\", \"Update strategies\")\n    -   [Install kubectl and configure cluster access](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/cluster-access-for-kubectl.md.txt)\n        (Sections: \"Install kubectl\", \"Install required plugins\", \"Store cluster\n        information for kubectl\")\n    -   [Manage clusters](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/managing-clusters.md.txt)\n        (Sections: \"View your clusters\")\n    -   [Deploy a Redis cluster on GKE](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/tutorials\/upgrading-stateful-workload.md.txt)\n        (Sections: \"Create a Redis Cluster on GKE\")\n    -   [Node upgrade strategies](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/node-pool-upgrade-strategies.md.txt)\n        (Sections: \"maxSurge: GKE creates a new surge node before removing an\n        existing one\", \"maxUnavailable: GKE makes an existing node unavailable\n        to recreate it\", \"Phase 3: Drain blue pool\")\n    -   [Autopilot cluster upgrades](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/cluster-upgrades-autopilot.md.txt)\n        (Sections: \"Automatic node upgrades\")\n    -   [Troubleshoot cluster upgrades](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/upgrades.md.txt)\n        (Sections: \"Troubleshoot node pool upgrades taking longer than usual\")\n    -   [Environment architecture](https:\/\/docs.cloud.google.com\/composer\/docs\/composer-2\/environment-architecture.md.txt)\n        (Sections: \"Environment's cluster\")\n    -   [Get support](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/getting-support.md.txt)\n        (Sections: \"Before you contact support\", \"Recommendations for efficient\n        support\")\n    -   [Configure Liveness, Readiness and Startup Probes](https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/configure-liveness-readiness-startup-probes\/)\n        (Sections: \"Define readiness probes\", \"Define a liveness command\")\n    -   [Liveness, Readiness, and Startup Probes](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)\n        (Sections: \"Liveness probe\", \"Startup probe\", \"Check mechanisms\", \"Probe\n        results\")\n    -   [Specifying a Disruption Budget for your Application](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)\n        (Sections: \"Specifying a PodDisruptionBudget\", \"Healthiness of a Pod\",\n        \"Check the status of the PDB\", \"Unhealthy Pod Eviction Policy\")\n\nThis skill only reads cluster and recommender state and creates no billable\nresources, so no teardown is required.\n\n--------------------------------------------------------------------------------\n\n## Diagnostic workflow\n\n> **Scope check**: If the user says that the cluster belongs to a Managed\n> Service for Apache Airflow (formerly Cloud Composer) environment, don't\n> propose changes to its workloads, because clusters for Managed Airflow and\n> workloads deployed into them are managed by Google, and introducing changes in\n> the environment's cluster might break the environment (see the section\n> [Environment's cluster](https:\/\/docs.cloud.google.com\/composer\/docs\/composer-2\/environment-architecture.md.txt)).\n> If you aren't sure whether the cluster belongs to a Managed Airflow\n> environment, ask the user. If the problem is a StatefulSet that has no\n> matching PDB at all (`PDB_UNPROTECTED_STATEFULSET`), or an existing PDB is\n> impossible to adhere to for maintenance because its `minAvailable` setting is\n> not less than the total Pod count or its `maxUnavailable` setting is zero\n> (`PDB_UNPERMISSIVE`, or node pool upgrades stall with\n> `\"Cannot evict pod as it would violate the pod's disruption budget.\"` as\n> described in the section\n> [Troubleshoot node pool upgrades taking longer than usual](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/troubleshooting\/upgrades.md.txt)),\n> stop using this skill and point the user to the `PDB_UNPROTECTED_STATEFULSET`\n> or `PDB_UNPERMISSIVE` action in the section\n> [When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt).\n> Note that `disruptionsAllowed: 0` on a PDB can also occur temporarily while a\n> replacement Pod is not `Ready` yet (see the \"Check the status of the PDB\" and\n> \"Healthiness of a Pod\" sections of\n> [Specifying a Disruption Budget for your Application](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)).\n> If Pods are stuck in `Pending`, use `gke-workload-troubleshooting` instead,\n> because PDBs and readiness probes do not control initial Pod scheduling.\n\n> **Inline telemetry**: If the user already provides the `StatefulSet` and\n> `PodDisruptionBudget` specifications in the prompt (and the cluster does not\n> belong to a Managed Airflow environment), skip Steps 1\u20132 and evaluate all\n> provided workloads directly in Step 3 without running terminal commands or\n> searching the workspace.\n\n### Step 1: Identify the cluster\n\nObtain `{project_id}`, `{cluster_name}`, and `{location}` from the user prompt.\nIf the cluster is unknown, ask the user, or follow the instructions in the\nsection\n[View your clusters](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/managing-clusters.md.txt)\nto list clusters in `{project_id}`. If you aren't sure whether `{cluster_name}`\nbelongs to a Managed Airflow environment, ask the user (see the Scope check\nabove and the section\n[Environment's cluster](https:\/\/docs.cloud.google.com\/composer\/docs\/composer-2\/environment-architecture.md.txt)).\n\n### Step 2: Get the insight and inspect live resources\n\n1.  **Get the insight and recommendation**: As documented in the section\n    [Identify workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt),\n    disruption readiness insights are viewed using the Google Cloud CLI or the\n    Recommender API and are not available in the Google Cloud console. To find\n    StatefulSets with this insight in `{project_id}` and `{location}`, follow\n    the `gcloud` or API instructions in the section\n    [View insights and recommendations](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/optimize-with-recommenders.md.txt),\n    filter for the `PDB_STATEFULSET_WITHOUT_PROBES` subtype, and read the\n    associated recommendation.\n    -   **No insight**: If the insight list is empty, tell the user that no\n        StatefulSet has the `PDB_STATEFULSET_WITHOUT_PROBES` insight, and note\n        that recommendations are assessed once daily (see the section\n        [Implement the guidance to improve disruption readiness](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)).\n        If the user named or pasted a StatefulSet, still check its live state in\n        items 2\u20133 below because a recent change might not have an insight yet.\n        If no insight was found and the user reported early replica evictions\n        during an upgrade or drain, follow the section \"StatefulSet has\n        readiness probe\" under Remediation.\n    -   **Cannot get the insight**: If you cannot retrieve the insight (for\n        example, because the Recommender API `recommender.googleapis.com` is not\n        enabled or permissions are missing), point the user to the section\n        [View insights and recommendations](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/optimize-with-recommenders.md.txt)\n        and the Recommender API prerequisite in Prerequisites, and if the user\n        named a StatefulSet, continue to items 2\u20133 below.\n2.  **Configure `kubectl` access and check PDBs**: For each StatefulSet that the\n    insight flags, and for any StatefulSet that the user names, configure\n    `kubectl` to communicate with `{cluster_name}` in `{location}` by following\n    the section\n    [Store cluster information for kubectl](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/cluster-access-for-kubectl.md.txt).\n    Then list and inspect the `PodDisruptionBudget` objects in the namespace by\n    following the section\n    [Check the status of the PDB](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/),\n    and check their selectors (see the section\n    [Specifying a PodDisruptionBudget](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)).\n3.  **Inspect `StatefulSet` configurations and probes**: Check the live state of\n    each StatefulSet that the insight flags, and of any StatefulSet that the\n    user names, by following the section\n    [Inspecting a StatefulSet](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/stateful-apps.md.txt).\n    Check its Pod selector (`spec.selector.matchLabels`) and whether any\n    container in `spec.template.spec.containers` defines `readinessProbe` (and\n    whether `livenessProbe` is configured).\n4.  **When you cannot run `gcloud` or `kubectl`**: If you can't run `gcloud` or\n    `kubectl`, or the user wants to run the checks, don't write custom scripts.\n    Point the user to the sections linked in this step, and continue with Step 3\n    when the user pastes the output back.\n\n### Step 3: Evaluate PDB coverage and container readiness probes\n\nEvaluate every StatefulSet in scope:\n\n1.  **Check namespace-scoped PDB coverage**:\n    -   Check whether a `PodDisruptionBudget` in the same namespace\n        (`{namespace}`) selects the StatefulSet's Pods\n        (`spec.selector.matchLabels`) by following the selector rules in the\n        section\n        [Specifying a PodDisruptionBudget](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/).\n    -   **StatefulSets without a matching PDB**: If no PDB in `{namespace}`\n        matches the StatefulSet's Pod selector labels, classify it as\n        **`StatefulSet Not Protected by PDB`**. Per the\n        `PDB_UNPROTECTED_STATEFULSET` entry in the section\n        [When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt),\n        all Pods in the StatefulSet can be taken down during an event such as a\n        node upgrade. List each such StatefulSet in one line and point the user\n        to the `PDB_UNPROTECTED_STATEFULSET` action in that section.\n2.  **Check container readiness probes**: For each PDB-protected StatefulSet,\n    check `spec.template.spec.containers`:\n    -   **Missing readiness probe (`0` containers define `readinessProbe`)**: If\n        none of the containers in `spec.template.spec.containers` define a\n        `readinessProbe`, classify the workload as\n        **`StatefulSet Protected by PDB Without Readiness Probe`**. A\n        `livenessProbe` or `startupProbe` alone does not satisfy this check,\n        which the section\n        [When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)\n        defines as \"without readiness probes\": liveness probes determine when to\n        restart a container (see the section\n        [Liveness probe](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)),\n        and startup probes are only executed at startup (see the section\n        [Startup probe](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)).\n        By contrast, PDBs count Ready Pods (see the section\n        [Healthiness of a Pod](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)),\n        and a container with no readiness probe defaults to a `Success`\n        readiness state once started (see the section\n        [Probe results](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)).\n    -   **Has readiness probe (`>= 1` container defines `readinessProbe`)**: If\n        at least one container in `spec.template.spec.containers` defines a\n        `readinessProbe`, classify the workload as\n        **`StatefulSet Has Readiness Probe`** and follow the section\n        \"StatefulSet has readiness probe\" under Remediation. If no StatefulSet\n        is missing a `readinessProbe` (or no insight was found) and the user\n        reported early replica evictions during an upgrade or drain, also follow\n        the section \"StatefulSet has readiness probe\" under Remediation.\n\n### Step 4: Classify each evaluated StatefulSet\n\nClassify evaluated workloads using these categories:\n\n| Classification | Next step |\n| :--- | :--- |\n| `StatefulSet Protected by PDB Without Readiness Probe` | Add readiness probe |\n| `StatefulSet Has Readiness Probe` | Check liveness \/ drain |\n| `StatefulSet Not Protected by PDB` | Point to action |\n\n--------------------------------------------------------------------------------\n\n## Remediation\n\nPropose these changes for the user to review and apply.\n\n### StatefulSet protected by PDB without readiness probe\n\n1.  **Add readiness and liveness probes**: Follow the action in the section\n    [When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt):\n    add readiness probes to Pods in StatefulSets for the covering PDB, and also\n    recommend adding liveness probes. Point the user to the \"Define readiness\n    probes\" and \"Define a liveness command\" sections of\n    [Configure Liveness, Readiness and Startup Probes](https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/configure-liveness-readiness-startup-probes\/).\n    As an example of a StatefulSet with readiness and liveness probes on GKE,\n    point the user to the section\n    [Create a Redis Cluster on GKE](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/tutorials\/upgrading-stateful-workload.md.txt).\n2.  **Ask the user which check shows application readiness**: Ask the user which\n    check (`httpGet`, `exec`, `grpc`, or `tcpSocket`) indicates that their\n    application is ready to serve traffic, rather than picking a probe for them.\n    Explain that per the section\n    [Check mechanisms](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/),\n    a `tcpSocket` check is considered successful if the port is open, so it can\n    succeed before the application finishes initializing.\n3.  **Apply and verify the update (user action only)**: Point the user to the\n    \"Updating a StatefulSet\" (to apply the change), \"Update strategies\", and\n    \"Inspecting update rollout\" (to check the rollout) sections of\n    [Deploying a stateful application](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/stateful-apps.md.txt).\n    Note that changing the Pod template in a StatefulSet can trigger a rolling\n    update of its replicas, depending on the StatefulSet's `updateStrategy`, and\n    do not run the commands in those sections yourself because they modify the\n    StatefulSet (`kubectl apply`, `kubectl edit`, and `kubectl rollout undo`).\n4.  **Resolution delay and dismissing the recommendation**: Tell the user that\n    recommendations are assessed once daily, so it may take up to 24 hours for\n    the recommendation to resolve after a change is implemented, and that they\n    can dismiss the recommendation if they decide not to add a probe (see the\n    section\n    [Implement the guidance to improve disruption readiness](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)).\n    Never dismiss a recommendation yourself.\n\n### StatefulSet has readiness probe\n\n1.  **Explain the 24-hour resolution delay if the insight is still present**: If\n    the StatefulSet already defines a `readinessProbe` (for example, because the\n    user recently added one) and the `PDB_STATEFULSET_WITHOUT_PROBES` insight or\n    recommendation is still visible, tell the user that recommendations are\n    assessed once daily, so it may take up to 24 hours for the recommendation to\n    resolve after a change is implemented (see the section\n    [Implement the guidance to improve disruption readiness](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)).\n    Never dismiss a recommendation yourself.\n2.  **Check liveness probe configuration**: If the StatefulSet already defines a\n    `readinessProbe` but has no `livenessProbe`, mention the recommendation in\n    the section\n    [When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)\n    to also add liveness probes (see the section\n    [Define a liveness command](https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/configure-liveness-readiness-startup-probes\/)).\n3.  **When replicas were still evicted before replacement Pods were ready**: If\n    a `readinessProbe` exists on the StatefulSet (or no missing-probe\n    StatefulSet was found) but replicas were still evicted early during an\n    upgrade or drain, point the user to these documented causes:\n    -   **Surge or blue-green upgrade drain limits**: During surge upgrades on\n        Standard node pools, GKE respects PDBs for up to one hour, and after one\n        hour any remaining Pods are forcefully evicted so that the upgrade can\n        proceed (see the \"maxSurge: GKE creates a new surge node before removing\n        an existing one\" and \"maxUnavailable: GKE makes an existing node\n        unavailable to recreate it\" sections of\n        [Node upgrade strategies](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/node-pool-upgrade-strategies.md.txt));\n        on Autopilot clusters, `PodDisruptionBudget` is also respected for 1\n        hour during node upgrades (see the section\n        [Automatic node upgrades](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/cluster-upgrades-autopilot.md.txt)).\n        In blue-green upgrades, Pods with PDB violations are deleted when the\n        blue pool is deleted (see the section\n        [Phase 3: Drain blue pool](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/concepts\/node-pool-upgrade-strategies.md.txt)).\n    -   **PDB `unhealthyPodEvictionPolicy: AlwaysAllow`**: With\n        `unhealthyPodEvictionPolicy: AlwaysAllow` on the PDB, running Pods that\n        are not healthy yet can be evicted regardless of whether the criteria in\n        a PDB are met (see the section\n        [Unhealthy Pod Eviction Policy](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)).\n    -   **Readiness probe succeeds before the application is ready**: A\n        readiness probe that succeeds before initialization completes\u2014such as a\n        `tcpSocket` check, which is considered successful as soon as the port is\n        open\u2014marks the Pod `Ready` prematurely (see the section\n        [Check mechanisms](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)).\n    -   **Escalate if unexplained**: If none of these sections explains the\n        early eviction, direct the user to Cloud Customer Care by following the\n        \"Before you contact support\" and \"Recommendations for efficient support\"\n        sections of\n        [Get support](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/getting-support.md.txt).\n\n--------------------------------------------------------------------------------\n\n## Output format\n\nReport the audit in this structure. Include all workloads classified as\n`StatefulSet Protected by PDB Without Readiness Probe` in the summary table and\nper-workload remediation sections. If any evaluated StatefulSet has no matching\nPDB (`StatefulSet Not Protected by PDB`), list it in one line and point the user\nto the `PDB_UNPROTECTED_STATEFULSET` action in the section\n[When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt).\nDo not include healthy (`StatefulSet Has Readiness Probe`) StatefulSets in the\nsummary table unless zero unhealthy StatefulSets exist or the user asked about a\nspecific workload by name.\n\n```markdown\n### Executive summary\n\nFound {actionable_count} PDB-protected StatefulSet(s) lacking a container\n`readinessProbe` on cluster `{cluster_name}` (`{location}`, Project:\n`{project_id}`):\n\n| StatefulSet | Namespace | Covering PDB | Readiness probe |\n| :--- | :--- | :--- | :--- |\n| `{name}` | `{namespace}` | `{pdb_name}` | Missing (`liveness`: `{status}`) |\n\n### StatefulSet: `{name}` (`{namespace}`)\n\n> **Diagnosis:** StatefulSet Protected by PDB Without Readiness Probe\n\n**Root cause analysis:**\n\n*   **Missing readiness probe on PDB-protected StatefulSet:** StatefulSet\n    `{name}` ({replicas} replicas) is covered by PodDisruptionBudget\n    `{pdb_name}`, but container `{container_name}` has no `readinessProbe`\n    configured. A `livenessProbe` or `startupProbe` alone does not satisfy this\n    check: liveness probes determine when to restart a container (see the\n    section\n    [Liveness probe](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)),\n    and startup probes are only executed at startup (see the section\n    [Startup probe](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)).\n*   **Limited PDB visibility during disruptions:** PDBs respect readiness\n    probes when they look at which Pods can be counted as healthy (`Ready`\n    condition `True`; see the section\n    [Healthiness of a Pod](https:\/\/kubernetes.io\/docs\/tasks\/run-application\/configure-pdb\/)).\n    Because `{name}` has no `readinessProbe`, `{pdb_name}` has limited\n    visibility into whether a Pod is healthy or is just up and running (see the\n    section\n    [When GKE identifies workloads with vulnerability to disruption](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)).\n\n**Actionable remediation:**\n\n*   Ask which check shows that `{container_name}` in `{name}` is ready to serve\n    traffic (noting from the section\n    [Check mechanisms](https:\/\/kubernetes.io\/docs\/concepts\/workloads\/pods\/probes\/)\n    that a `tcpSocket` check succeeds as soon as the port is open), and add a\n    `readinessProbe` (and a `livenessProbe` if missing) by following the\n    \"Define readiness probes\" and \"Define a liveness command\" sections of\n    [Configure Liveness, Readiness and Startup Probes](https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/configure-liveness-readiness-startup-probes\/)\n    (see the section\n    [Create a Redis Cluster on GKE](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/tutorials\/upgrading-stateful-workload.md.txt)\n    for an example).\n*   To apply the Pod template change (which can trigger a rolling update of the\n    StatefulSet's replicas, depending on the StatefulSet's `updateStrategy`),\n    follow the \"Updating a StatefulSet\" and \"Update strategies\" sections of\n    [Deploying a stateful application](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/stateful-apps.md.txt).\n\n### Verification\n\n*   To monitor and verify the StatefulSet rollout after applying the change,\n    follow the section\n    [Inspecting update rollout](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/stateful-apps.md.txt).\n*   Recommendations are assessed once daily, so it may take up to 24 hours for\n    the recommendation to resolve after a change is implemented (or you can\n    dismiss the recommendation if you decide not to add a probe; see the section\n    [Implement the guidance to improve disruption readiness](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)).\n\nLearn more:\n[Ensure workloads are disruption-ready](https:\/\/docs.cloud.google.com\/kubernetes-engine\/docs\/how-to\/workload-disruption-readiness.md.txt)\n(Sections: \"When GKE identifies workloads with vulnerability to disruption\",\n\"Implement the guidance to improve disruption readiness\") and\n[Configure Liveness, Readiness and Startup Probes](https:\/\/kubernetes.io\/docs\/tasks\/configure-pod-container\/configure-liveness-readiness-startup-probes\/)\n(Section: \"Define readiness probes\").\n```\n","use_cases":["Check if StatefulSets are protected by PDB but lack readiness probes.","Propose fixes for premature eviction during node pool upgrades or drains."],"limitations":[],"compatibility":[],"setup_tip":null,"sample_input":null,"sample_output":null,"source_url":"https:\/\/github.com\/google\/skills\/blob\/c413c1fdc1714f2e4ae44a449b9744348197119c\/skills\/cloud\/gke-statefulset-without-probes\/SKILL.md","source_commit":"c413c1fdc1714f2e4ae44a449b9744348197119c","license":null,"version":null,"listing_approved_at":"2026-11-27","created_at":"2026-11-26T11:00:39.000000Z","updated_at":"2026-11-27T07:43:08.000000Z","seo_title":"Audit GKE StatefulSets for Missing Readiness Probes","seo_description":"Audit GKE StatefulSets protected by PDB but missing readiness probes. Identify and propose fixes for premature eviction during disruptions.","seo_keywords":["GKE StatefulSet audit","Missing readiness probes","PodDisruptionBudget audit","GKE disruption readiness","StatefulSet PDB check"]}}