GKE Kubernetes 作业无法在 Autopilot 集群中使用临时卷

问题描述 投票:0回答:1

我正在尝试在自动驾驶仪 GKE 集群上设置作业。

该作业用于恢复数据库备份,因此需要能够下载并解压非常大的文件(大约50 - 100Gi)。

但是,自动驾驶 Pod 的容量限制为 10Gi,因此我按照本指南操作,以便能够使用临时卷:

https://cloud.google.com/kubernetes-engine/docs/how-to/generic-ephemeral-volumes

我已使用以下命令确认该卷确实可用于 pod:

kubectl exec -it deploy/ephemeral-deployment -- bash

因此,该卷正在创建、安装并可供作业使用,为其提供所需的 100Gi 空间。尽管如此,作业仍然失败,我收到错误消息:

Pod ephemeral local storage usage exceeds the total limit of containers 1Gi.

我做了一些研究,发现这是由于 YAML 文件中设置的资源限制造成的:

resources:
      limits:
        cpu: "5"
        ephemeral-storage: 1Gi   <------
        memory: 6Gi
      requests:
        cpu: "5"
        ephemeral-storage: 1Gi
        memory: 6Gi

问题是,我无法消除限制。如果我在 YAML 中创建没有它们的作业,它会自动为我添加它们。如果我增加它们,它会将它们重置回 10GB 限制。

无论哪种方式,它都会导致我无法使用我在临时卷上设置的 100GB。几乎就像它在与自己战斗一样。

有什么办法可以解决这个问题吗?

kubernetes autopilot ephemeral-storage
1个回答
0
投票

这是 GKE Autopilot 集群上的一项新功能,您可以阅读这篇文章

为了能够在 GKE Autopilot 上使用更高的临时存储,需要考虑的事项:

  • 升级到版本 1.28.6-gke.1095000 或更高版本

  • 您需要使用性能计算类、C3、C3D等机器系列

  • 使用下面的示例 YAML 作为参考:

apiVersion: v1
kind: Pod
metadata:
  name: performance-pod
spec:
  nodeSelector:
    cloud.google.com/compute-class: Performance
    cloud.google.com/machine-family: c3d
  containers:
  - name: my-container
    image: "k8s.gcr.io/pause"
    resources:
      requests:
        cpu: 4
        memory: "16Gi"
        ephemeral-storage: 100Gi
© www.soinside.com 2019 - 2024. All rights reserved.