简体   繁体   English

Argo Workflows pod 缺少 cpu/内存资源

[英]Argo Workflows pods missing cpu/memory resources

I'm running into a missing resources issue when submitting a Workflow .提交Workflow时遇到资源缺失问题。 The Kubernetes namespace my-namespace has a quota enabled, and for whatever reason the pods being created after submitting the workflow are failing with: Kubernetes 命名空间my-namespace启用了配额,无论出于何种原因,在提交工作流后创建的 pod 都失败了:

pods "hello" is forbidden: failed quota: team: must specify limits.cpu,limits.memory,requests.cpu,requests.memory

I'm submitting the following Workflow ,我正在提交以下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 is running on Kubernetes 1.19.6 and was deployed with the official Helm chart version 0.16.10. Argo 在 Kubernetes 1.19.6 上运行,并与官方 Helm 图表版本 0.16.10 一起部署。 Here are my Helm values:这是我的 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

Any ideas on what I may be missing?关于我可能遗漏的任何想法? Thanks, Weldon谢谢, 韦尔登

Update 1: I tried another namespace without quotas enabled and got past the missing resources issue.更新 1:我尝试了另一个没有启用配额的命名空间,并解决了缺少资源的问题。 However I now see: Failed to establish pod watch: timed out waiting for the condition .但是我现在看到: Failed to establish pod watch: timed out waiting for the condition Here's what the spec looks like for this pod.这是这个 pod 的spec You can see the wait container is missing resources .您可以看到wait容器缺少resources This is the container causing the issue reported by this question.这是导致此问题报告的问题的容器。

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"

try deploying the workflow on another namespace if you can, and verify if it's working or not.如果可以,请尝试在另一个命名空间上部署工作流,并验证它是否正常工作。

if you can try with removing the quota for respective namespace.如果您可以尝试删除相应命名空间的配额。

instead of quota you can also use the而不是配额,您还可以使用

apiVersion: v1
kind: LimitRange
metadata:
  name: default-limit-range
spec:
  limits:
  - default:
      memory: 512Mi
      cpu: 250m
    defaultRequest:
      cpu: 50m
      memory: 64Mi
    type: Container

so any container have not resource request, limit mentioned that will get this default config of 50m CPU & 64 Mi Memory.所以任何容器都没有资源请求,提到的限制将获得 50m CPU 和 64 Mi Memory 的默认配置。

https://kubernetes.io/docs/concepts/policy/limit-range/ https://kubernetes.io/docs/concepts/policy/limit-range/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM