Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resources for migration-job. #1841

Open
3 tasks done
norbertgrz opened this issue Apr 25, 2024 · 8 comments
Open
3 tasks done

Resources for migration-job. #1841

norbertgrz opened this issue Apr 25, 2024 · 8 comments

Comments

@norbertgrz
Copy link

Please confirm the following

  • I agree to follow this project's code of conduct.
  • I have checked the current issues for duplicates.
  • I understand that AWX Operator is open source software provided for free and that I might not receive a timely response.

Feature Summary

As we are working on namespaces with quota limitations on our kubernetes cluster, we are unable to deploy awx-operator. Migration job created by operator has no resources specified and this is why pod is not created.

(combined from similar events): Error creating: pods "test-migration-24.3.0-cnkfj" is forbidden: failed quota: default-knlbg: must specify limits.cpu for: migration-job; limits.memory for: migration-job; requests.cpu for: migration-job; requests.memory for: migration-job

Is there a posibility to add resources to migration job template?

@JMora77
Copy link

JMora77 commented May 6, 2024

Have you tried setting a LimitRange?

apiVersion: v1
kind: LimitRange
metadata:
  name: limit-mem-cpu-per-pod
  namespace: my-ns
spec:
  limits:
  - max:
      cpu: "800m"
      memory: "1Gi"
    min:
      cpu: "100m"
      memory: "99Mi"
    type: Pod

That would ensure that every pod has pre-defined resources without overwriting existing resource specifications.

@norbertgrz
Copy link
Author

Have you tried setting a LimitRange?

apiVersion: v1
kind: LimitRange
metadata:
  name: limit-mem-cpu-per-pod
  namespace: my-ns
spec:
  limits:
  - max:
      cpu: "800m"
      memory: "1Gi"
    min:
      cpu: "100m"
      memory: "99Mi"
    type: Pod

That would ensure that every pod has pre-defined resources without overwriting existing resource specifications.

Yes, this is what has been done. But i'm not a cluster admin. Cluster was prepared by our K8S admins, we have limited access to configuration and also custom permissions to install operator.

@JMora77
Copy link

JMora77 commented May 7, 2024

I see.

If I am not mistaken there is a ResourceQuota on the namespace you are working on.
You can contact your k8s admins to enable a LimitRange, and specify resources for all pods that do not already have them.

Adding resources to the migration job is a good solution and I hope it is implemented, but there are also other pods (like the ones running AWX jobs) that will also have the same error.

The LimitRange solution has been working in my case.

@norbertgrz
Copy link
Author

As i mentioned before, limitRange was already set on my cluster. About running jobs, isn't this setting ee_resource_requirements responsible for assigning resources to running execution environments?

@JMora77
Copy link

JMora77 commented May 7, 2024

I thought so as well, but it did not work for me. However, I found out it can also be defined in the WebUI.

@norbertgrz
Copy link
Author

Could you guide me where did you found thoses settings?

@Guent4
Copy link

Guent4 commented May 17, 2024

@norbertgrz, I ran into the same issue as you and stumbled upon this thread. I think @JMora77 means something along the lines of this which worked for me:

---
apiVersion: v1
kind: LimitRange
metadata:
  name: awx
  namespace: awx
spec:
  limits:
  - type: Container
    default:
      cpu: "300m"
      memory: "400Mi"

@Guent4
Copy link

Guent4 commented May 19, 2024

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants