4.18. 因内存不足或 CPU 造成 pod 崩溃或重启
如果 Velero 或 Restic pod 因为缺少内存或 CPU 而导致崩溃,您可以为其中任何一个资源设置特定的资源请求。
资源请求字段的值必须遵循与 Kubernetes 资源要求相同的格式。如果您没有指定 configuration.velero.podConfig.resourceAllocations
或 configuration.restic.podConfig.resourceAllocations
,请参阅 Velero 或 Restic pod 的以下默认资源规格配置:
requests: cpu: 500m memory: 128Mi
requests:
cpu: 500m
memory: 128Mi
4.18.1. 为 Velero pod 设置资源请求
您可以使用 oadp_v1alpha1_dpa.yaml
文件中的 configuration.velero.podConfig.resourceAllocations
规格字段为 Velero
pod 设置特定的资源请求。
流程
在 YAML 文件中设置
cpu
和memory
资源请求:Velero 文件示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication ... configuration: velero: podConfig: resourceAllocations: requests: cpu: 200m memory: 256Mi
apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication ... configuration: velero: podConfig: resourceAllocations:
1 requests: cpu: 200m memory: 256Mi
- 1
- 列出的
resourceAllocations
用于平均使用。
4.18.2. 为 Restic pod 设置资源请求
您可以使用 configuration.restic.podConfig.resourceAllocations
specification 字段为 Restic
pod 设置特定的资源请求。
流程
在 YAML 文件中设置
cpu
和memory
资源请求:Restic 文件示例
Copy to Clipboard Copied! Toggle word wrap Toggle overflow apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication ... configuration: restic: podConfig: resourceAllocations: requests: cpu: 1000m memory: 16Gi
apiVersion: oadp.openshift.io/v1alpha1 kind: DataProtectionApplication ... configuration: restic: podConfig: resourceAllocations:
1 requests: cpu: 1000m memory: 16Gi
- 1
- 列出的
resourceAllocations
用于平均使用。