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

Ability to declare Kubernetes resources requests and limits through properties #12398

Closed
yanaga opened this issue Sep 29, 2020 · 9 comments · Fixed by #12613
Closed

Ability to declare Kubernetes resources requests and limits through properties #12398

yanaga opened this issue Sep 29, 2020 · 9 comments · Fixed by #12613
Labels
Milestone

Comments

@yanaga
Copy link

yanaga commented Sep 29, 2020

Description
Kubernetes allows to specify how much resources (memory and cpu) a container needs to be executed. In addition to this, Kubernetes also allows you to enforce a limit on the amount of resources (again memory and cpu) that a container can use.

This information can be provided inside the following structure in the following yaml excerpt:

    spec:
      containers:
        image: quay.io/myrepo/myapp:1.0.0-SNAPSHOT
        imagePullPolicy: Always
        resources:
          requests:
            memory: "64Mi"
            cpu: "250m"
          limits:
            memory: "512Mi"
            cpu: "1000m"

It'd be nice if the quarkus-kubernetes extension could generate these information using some properties. A proposed name and usage for these properties is:

quarkus.kubernetes.resources.requests.memory=64Mi
quarkus.kubernetes.resources.requests.cpu=250m
quarkus.kubernetes.resources.limits.memory=512Mi
quarkus.kubernetes.resources.limits.cpu=1000m
@yanaga yanaga added the kind/enhancement New feature or request label Sep 29, 2020
@quarkusbot
Copy link

/cc @geoand

@geoand
Copy link
Contributor

geoand commented Sep 29, 2020

@iocanel we have this capability in dekorate right? So we just need to expose it here

@mkonzal
Copy link

mkonzal commented Sep 29, 2020

Is a dedicated issue for the OpenShift extension needed?

@geoand
Copy link
Contributor

geoand commented Sep 29, 2020

Nope, introducing the feature would be done generally

@yanaga
Copy link
Author

yanaga commented Sep 29, 2020

I can see that in dekorate you can declare the information with these properties:

dekorate.kubernetes.request-resources.cpu=1m
dekorate.kubernetes.request-resources.memory=64Mi
dekorate.kubernetes.limit-resources.cpu=5m
dekorate.kubernetes.limit-resources.memory=256Mi

And for OpenShift, it's:

dekorate.openshift.request-resources.cpu=1m
dekorate.openshift.request-resources.memory=64Mi
dekorate.openshift.limit-resources.cpu=5m
dekorate.openshift.limit-resources.memory=256Mi

@geoand
Copy link
Contributor

geoand commented Sep 29, 2020

Right, so we just need to expose it to the Quarkus config system.

@iocanel do you want to take this one?

@missourian55
Copy link

Appreciate guys, just tested this with 1.10.0.CR1 works great

@yanaga
Copy link
Author

yanaga commented Nov 12, 2020

Reporting that I also tested it today and works great too!

@geoand
Copy link
Contributor

geoand commented Nov 12, 2020

Thanks for testing and reporting back folks!

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

Successfully merging a pull request may close this issue.

6 participants