我在提交Workflow时遇到了缺少资源的问题。Kubernetes命名空间my-namespace启用了配额,无论出于什么原因,提交工作流后创建的pod都会失败,出现以下错误:
pods "hello" is forbidden: failed quota: team: must specify limits.cpu,limits.memory,requests.cpu,requests.memory我提交了以下Workflow,
apiVersion: "argoproj.io/v1alpha1"
kind: "Workflow"
metadata:
name: "hello"
namespace: "my-namespace"
spec:
entrypoint: "main"
templates:
- name: "main"
container:
image: "docker/whalesay"
resources:
requests:
memory: 0
cpu: 0
limits:
memory: "128Mi"
cpu: "250m"Argo在Kubernetes1.19.6上运行,并与official Helm chart版本0.16.10一起部署。以下是我的Helm值:
controller:
workflowNamespaces:
- "my-namespace"
resources:
requests:
memory: 0
cpu: 0
limits:
memory: 500Mi
cpu: 0.5
pdb:
enabled: true
# See https://argoproj.github.io/argo-workflows/workflow-executors/
# docker container runtime is not present in the TKGI clusters
containerRuntimeExecutor: "k8sapi"
workflow:
namespace: "my-namespace"
serviceAccount:
create: true
rbac:
create: true
server:
replicas: 2
secure: false
resources:
requests:
memory: 0
cpu: 0
limits:
memory: 500Mi
cpu: 0.5
pdb:
enabled: true
executer:
resources:
requests:
memory: 0
cpu: 0
limits:
memory: 500Mi
cpu: 0.5你知道我可能错过了什么吗?谢谢,韦尔登
更新1:我尝试了另一个没有启用配额的命名空间,并解决了缺少资源的问题。然而,我现在看到:Failed to establish pod watch: timed out waiting for the condition。下面是这个pod的spec外观。您可以看到缺少resources的wait容器。这是导致此问题报告的问题的容器。
spec:
containers:
- command:
- argoexec
- wait
env:
- name: ARGO_POD_NAME
valueFrom:
fieldRef:
apiVersion: v1
fieldPath: metadata.name
- name: ARGO_CONTAINER_RUNTIME_EXECUTOR
value: k8sapi
image: argoproj/argoexec:v2.12.5
imagePullPolicy: IfNotPresent
name: wait
resources: {}
terminationMessagePath: /dev/termination-log
terminationMessagePolicy: File
volumeMounts:
- mountPath: /argo/podmetadata
name: podmetadata
- mountPath: /var/run/secrets/kubernetes.io/serviceaccount
name: default-token-v4jlb
readOnly: true
- image: docker/whalesay
imagePullPolicy: Always
name: main
resources:
limits:
cpu: 250m
memory: 128Mi
requests:
cpu: "0"
memory: "0"发布于 2021-05-27 02:11:23
如果可以,请尝试在另一个名称空间上部署工作流,并验证它是否正常工作。
如果您可以尝试删除相应名称空间的配额。
除了配额,您还可以使用
apiVersion: v1
kind: LimitRange
metadata:
name: default-limit-range
spec:
limits:
- default:
memory: 512Mi
cpu: 250m
defaultRequest:
cpu: 50m
memory: 64Mi
type: Container因此,任何容器都没有资源请求,上述限制将获得50MCPU和64Mi内存这个默认配置。
https://stackoverflow.com/questions/67710199
复制相似问题