Kubernetes FailedAttachVolume 및 FailedMount

Kubernetes FailedAttachVolume 및 FailedMount

ovh 클라우드에 kubernetes 클러스터가 있습니다. 오늘 nginx는 웹사이트에 전화할 때 갑자기 503 오류로 응답했습니다. 그런 다음 Kubernetes 클러스터를 확인한 결과 kubectl get pods특정 볼륨과 연결된 모든 포드가 더 이상 준비되지 않은 것을 확인할 수 있었습니다. 모든 포드에는 이벤트에 FailedAttachVolume 및 FailedMount 오류가 표시됩니다. 예를 들어 Pod의 이벤트 로그는 다음과 같습니다.

      Warning  FailedAttachVolume  15m                  attachdetach-controller  AttachVolume.Attach failed for volume "example-managed-kubernetes-mrx2n8-pvc-ca435065-1111-aaaa-0123-543465516bb2" : rpc error: code = Internal desc = [ControllerPublishVolume] Attach Volume failed with error failed to attach 0655d400-3333-2222-1111-6fbcc2b62f94 volume to 5d51a18b-abcd-w2re-wfe2-a94d2b4ca988 compute: Bad request with: [POST https://compute.de1.cloud.example.net/v2.1/e2b2680af21e4q9n3e8hfoc39rpgowpd/servers/5d51a18b-abcd-w2re-wfe2-a94d2b4ca988/os-volume_attachments], error message: {"badRequest": {"code": 400, "message": "Invalid input received: Invalid volume: Volume 0655d400-3333-2222-1111-6fbcc2b62f94 status must be available or downloading to reserve, but the current status is in-use. (HTTP 400) (Request-ID: req-b1820e9f-935b-442e-b68e-efe7de0feb35)"}}
      Warning  FailedAttachVolume  12m (x2 over 14m)    attachdetach-controller  AttachVolume.Attach failed for volume "example-managed-kubernetes-mrx2n8-pvc-ca435065-1111-aaaa-0123-543465516bb2" : rpc error: code = Internal desc = [ControllerPublishVolume] Attach Volume failed with error failed to attach 0655d400-3333-2222-1111-6fbcc2b62f94 volume to 5d51a18b-abcd-w2re-wfe2-a94d2b4ca988 compute: Bad request with: [POST https://compute.de1.cloud.example.net/v2.1/e2b2680af21e4q9n3e8hfoc39rpgowpd/servers/5d51a18b-abcd-w2re-wfe2-a94d2b4ca988/os-volume_attachments], error message: {"badRequest": {"code": 400, "message": "Invalid input received: Invalid volume: Volume 0655d400-3333-2222-1111-6fbcc2b62f94 status must be available or downloading to reserve, but the current status is in-use. (HTTP 400) (Request-ID: req-c6e51d31-8646-44a2-ba75-7069e3ed87fa)"}}
      Warning  FailedAttachVolume  10m                  attachdetach-controller  AttachVolume.Attach failed for volume "example-managed-kubernetes-mrx2n8-pvc-ca435065-1111-aaaa-0123-543465516bb2" : rpc error: code = Internal desc = [ControllerPublishVolume] Attach Volume failed with error failed to attach 0655d400-3333-2222-1111-6fbcc2b62f94 volume to 5d51a18b-abcd-w2re-wfe2-a94d2b4ca988 compute: Bad request with: [POST https://compute.de1.cloud.example.net/v2.1/e2b2680af21e4q9n3e8hfoc39rpgowpd/servers/5d51a18b-abcd-w2re-wfe2-a94d2b4ca988/os-volume_attachments], error message: {"badRequest": {"code": 400, "message": "Invalid input received: Invalid volume: Volume 0655d400-3333-2222-1111-6fbcc2b62f94 status must be available or downloading to reserve, but the current status is in-use. (HTTP 400) (Request-ID: req-a5c9c89e-5578-4b6c-8722-acf583dea1a8)"}}
      Warning  FailedMount         3m18s (x4 over 12m)  kubelet                  Unable to attach or mount volumes: unmounted volumes=[files-volume], unattached volumes=[kube-api-access-q9pjc files-volume]: timed out waiting for the condition
      Warning  FailedMount         63s (x3 over 14m)    kubelet                  Unable to attach or mount volumes: unmounted volumes=[files-volume], unattached volumes=[files-volume kube-api-access-q9pjc]: timed out waiting for the condition
      Warning  FailedAttachVolume  11s (x5 over 8m21s)  attachdetach-controller  (combined from similar events): AttachVolume.Attach failed for volume "example-managed-kubernetes-mrx2n8-pvc-ca435065-1111-aaaa-0123-543465516bb2" : rpc error: code = Internal desc = [ControllerPublishVolume] Attach Volume failed with error failed to attach 0655d400-3333-2222-1111-6fbcc2b62f94 volume to 5d51a18b-abcd-w2re-wfe2-a94d2b4ca988 compute: Bad request with: [POST https://compute.de1.cloud.example.net/v2.1/e2b2680af21e4q9n3e8hfoc39rpgowpd/servers/5d51a18b-abcd-w2re-wfe2-a94d2b4ca988/os-volume_attachments], error message: {"badRequest": {"code": 400, "message": "Invalid input received: Invalid volume: Volume 0655d400-3333-2222-1111-6fbcc2b62f94 status must be available or downloading to reserve, but the current status is in-use. (HTTP 400) (Request-ID: req-39554882-3f5c-40e9-aad2-482ff427c632)"}}

PVC는 다음과 같이 모든 배포에 통합됩니다.

spec:
  ...
  template:
    spec:
      ...
      containers:
      - name: ...
        ...
        volumeMounts:
        - name: files-volume
          mountPath: /files
        ...
      volumes:
        - name: files-volume
          persistentVolumeClaim:
            claimName: pv-files-claim

PVC는 다음과 같습니다

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: pv-files-claim
spec:
  storageClassName: csi-cinder-high-speed
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 1Gi

이 오류는 어떻게 발생할 수 있으며 어떻게 해결합니까? 그리고 앞으로는 어떻게 오류를 방지할 수 있나요?

그 동안 하나를 제외한 모든 포드가 자체적으로 볼륨에 다시 연결되었습니다. 그러나 하나의 포드에서는 작동하지 않는 것 같습니다.

관련 정보