kubernetes pod上的Django设备上没有剩余空间

m4pnthwp  于 2023-07-01  发布在  Go
关注(0)|答案(1)|浏览(103)

所以我在kubernetes pod中运行Django App,试图保存一个图像文件:

img_obj.image.save(img_file, File(img_file_org))

我得到没有空间离开错误:

File "/code/ocr_client/management/commands/pdf_to_image.py", line 126, in handle
    img_obj.image.save(img_file, File(img_file_org))
  File "/opt/conda/lib/python3.7/site-packages/django/db/models/fields/files.py", line 88, in save
    self.name = self.storage.save(name, content, max_length=self.field.max_length)
  File "/opt/conda/lib/python3.7/site-packages/django/core/files/storage.py", line 54, in save
    return self._save(name, content)
  File "/opt/conda/lib/python3.7/site-packages/django/core/files/storage.py", line 274, in _save
    fd = os.open(full_path, self.OS_OPEN_FLAGS, 0o666)
OSError: [Errno 28] No space left on device: '/code/pca_back_data/media/file1.png'

我已经跑了

kubectl exec <my-pod> -- df -ah

还有20%的空间(100 GB)
我也按照其他帖子中的建议运行:

kubectl exec <my-pod> -- df -hi

而索引节点的使用率仅为5%
我不知道这里还有什么问题?Kubernetes中是否有一些配置限制了pod/进程的存储使用?

vwhgwdsa

vwhgwdsa1#

请增加资源的pod它会帮助,因为当应用程序处于启动状态时,它的资源消耗高峰,所以,你也可以分享,有多少资源,你已经使用了这一点

resources:
        limits:
          cpu: 50m
          memory: 450Mi
        requests:
          cpu: 30m
          memory: 350Mi

根据您的要求编辑此

相关问题