actions-runner-controller icon indicating copy to clipboard operation
actions-runner-controller copied to clipboard

Bug

Open rs1986x opened this issue 4 years ago • 3 comments

Controller Version

0.25.2

Helm Chart Version

0.20.2

CertManager Version

1.9.2

Deployment Method

Helm

cert-manager installation

Followed the documentation to a T, also installed cert-manager from official helm chart

Checks

  • [X] This isn't a question or user support case (For Q&A and community support, go to Discussions. It might also be a good idea to contract with any of contributors and maintainers if your business is so critical and therefore you need priority support
  • [X] I've read releasenotes before submitting this issue and I'm sure it's not due to any recently-introduced backward-incompatible changes
  • [X] My actions-runner-controller version (v0.x.y) does support the feature
  • [X] I've already upgraded ARC (including the CRDs, see charts/actions-runner-controller/docs/UPGRADING.md for details) to the latest and it didn't fix the issue

Resource Definitions

---
apiVersion: actions.summerwind.dev/v1alpha1
kind: RunnerDeployment
metadata:
  name: standard-runners-deployment
  namespace: actions-runner-system
spec:
  template:
    spec:
      organization: blablabla
      labels: 
      - standard
      - k8s
      group: "GKE runners"
      resources:
        limits:
          memory: "16Gi"
        # requests:
        #   cpu: 1
        #   memory: "1Gi"
      # dockerdContainerResources:
      #   limits:
      #     memory: "16Gi"
        # requests:
        #   cpu: 1
        #   memory: "1Gi"

To Reproduce

try to deploy it to a node with less than 16Gi of ram

Describe the bug

It seems that the resource limit for kind: RunnerDeployment is treated as a request as well, i can verify that pods do not get scheduled if the limit exceed the available memory of the nodes, which should not be the case

Describe the expected behavior

a runnerdeployements should be scheduled regardless of the available memory on the node since it has no request in the resource

Controller Logs

https://gist.github.com/rs1986x/7a1190e79e08fe68da06030b44c7c9d9

Runner Pod Logs

no log, it doesn't get scheduled
`0/2 nodes are available: 2 Insufficient memory.`

Additional Context

No response

rs1986x avatar Aug 30 '22 09:08 rs1986x

Hey, this might be the solution to your question - https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#requests-and-limits

Note: If you specify a limit for a resource, but do not specify any request, and no admission-time mechanism has applied a default request for that resource, then Kubernetes copies the limit you specified and uses it as the requested value for the resource.

I haven't checked but it's possible the Runner is copying what you've provided i.e it's creating a pod with only limits and no requests. This is then interpreted by k8s and it tries to add the same request as the limit. This obviously doesn't work and you see the issue.

bm1216 avatar Aug 30 '22 19:08 bm1216

@rs1986x if you try kubectl describe on the unscheduled pod, does it have a request or just the limit?

Diontsoumas avatar Aug 30 '22 20:08 Diontsoumas

You guys are right, totally my mistake, i did forget to set requests. I'm going to close the ticket and thank you for the quick answer thank you so much

rs1986x avatar Aug 31 '22 06:08 rs1986x