{
  "id": "kubernetes/persistentvolumeclaim-stuck-pending-no-storageclass",
  "signature": "persistentvolumeclaim is stuck in Pending state: no storage class specified",
  "signature_zh": "持久卷声明卡在Pending状态：未指定存储类",
  "regex": "persistentvolumeclaim is stuck in Pending state: no storage class specified",
  "domain": "kubernetes",
  "category": "config_error",
  "subcategory": null,
  "root_cause": "A PersistentVolumeClaim (PVC) is stuck in Pending state because it doesn't specify a storageClassName and the cluster has no default StorageClass configured.",
  "root_cause_type": "generic",
  "root_cause_zh": "持久卷声明（PVC）卡在Pending状态，因为它没有指定storageClassName，并且集群没有配置默认的StorageClass。",
  "versions": [
    {
      "version": "Kubernetes v1.26.6",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes v1.27.4",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "Kubernetes v1.28.1",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "Manually create a PersistentVolume (PV) with the same size",
      "why_fails": "Without a storage class, the PVC won't bind to a manually created PV unless the PV has the exact same label and access modes, and the PVC doesn't specify a selector. It's easier to configure a StorageClass.",
      "fail_rate": 0.75,
      "condition": "",
      "sources": []
    },
    {
      "action": "Delete and recreate the PVC with a random storageClassName",
      "why_fails": "Using a random or non-existent storage class name will still result in Pending state. The storage class must exist and be configured correctly.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check existing StorageClasses: `kubectl get storageclass`. If none is set as default, set one: `kubectl patch storageclass <name> -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'`",
      "success_rate": 0.85,
      "how": "Check existing StorageClasses: `kubectl get storageclass`. If none is set as default, set one: `kubectl patch storageclass <name> -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'`",
      "condition": "",
      "sources": []
    },
    {
      "action": "Update the PVC to specify an existing storage class: `kubectl edit pvc <pvc-name>` and add `spec.storageClassName: <existing-class-name>`",
      "success_rate": 0.9,
      "how": "Update the PVC to specify an existing storage class: `kubectl edit pvc <pvc-name>` and add `spec.storageClassName: <existing-class-name>`",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check existing StorageClasses: `kubectl get storageclass`. If none is set as default, set one: `kubectl patch storageclass <name> -p '{\"metadata\": {\"annotations\":{\"storageclass.kubernetes.io/is-default-class\":\"true\"}}}'`",
    "Update the PVC to specify an existing storage class: `kubectl edit pvc <pvc-name>` and add `spec.storageClassName: <existing-class-name>`"
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://kubernetes.io/docs/concepts/storage/persistent-volumes/#storageclasses",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.87,
  "fix_success_rate": 0.88,
  "resolvable": "true",
  "first_seen": "2023-09-15",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}