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

[Resource Quota Lecture] All objects must use either requests or limits #19

Open
abdennour opened this issue Sep 6, 2018 · 6 comments · Fixed by #21
Open

[Resource Quota Lecture] All objects must use either requests or limits #19

abdennour opened this issue Sep 6, 2018 · 6 comments · Fixed by #21
Assignees
Labels

Comments

@abdennour
Copy link
Collaborator

abdennour commented Sep 6, 2018

What happens during that lecture is we configure the limits.cpu in the Resourcequote. But don't configure it in the tomcat-deployment instead we configure the Cpu requests.

Which occurs in the error we receive. If you change limits.cpu to requests.cpu everything works just fine.

Related Question(s)

@abdennour
Copy link
Collaborator Author

abdennour commented Sep 6, 2018

Here a possible solution:

apiVersion: v1
kind: ResourceQuota
metadata:
  name: compute-resources
spec:
  hard:
    limits.cpu: "400m"
---
apiVersion: apps/v1beta2
kind: Deployment
metadata:
  name: tomcat-deployment
spec:
  selector:
    matchLabels:
      app: tomcat
  replicas: 3
  template:
    metadata:
      labels:
        app: tomcat
    spec:
      containers:
      - name: tomcat
        image: tomcat:9.0
        ports:
        - containerPort: 8080
        resources:
          limits: # Instead of "requests:"
            cpu: "200m"

@jleetutorial
Copy link
Member

@abdennour Thanks for the proposed solution, I have put up a PR, can you take a look? #21

@jleetutorial
Copy link
Member

Actually shall we put both requests and limits in the tomcat-deployment?

@jleetutorial
Copy link
Member

@abdennour

@abdennour
Copy link
Collaborator Author

abdennour commented Sep 8, 2018

@jleetutorial I think we should consider limits, requests or both.

The dependency follows those formulas:

𝔦∑limits_cpu(deployment[i]) <= limits_cpu(resource-quota) 
𝔦∑limits_memory(deployment[i]) <= limits_memory(resource-quota) 
𝔦∑requests_cpu(deployment[i]) <= requests_cpu(resource-quota) 
𝔦∑requests_memory(deployment[i]) <= requests_memory(resource-quota) 

Hence, I will merge your PR

abdennour added a commit that referenced this issue Sep 8, 2018
@abdennour
Copy link
Collaborator Author

abdennour commented Sep 22, 2018

I have to open this one again.
While the source code was fixed, the lecture is not yet fixed:
1- Both yaml object should be consistent: either use "resources.requests" or "resources.limits"
2- Make the source code consistent with the lecture.

image

image

@jleetutorial Please FYA

@abdennour abdennour reopened this Sep 22, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants