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

feat(deploy): support ephemeral storage requests limits labels #1936

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

jvitor83
Copy link
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Allow to use labels in the deploy section to convert to kubernetes resources requests and limits for ephemeral-storage

Which issue(s) this PR fixes:

Fixes #1935

Special notes for your reviewer:

❤️

@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Sep 27, 2024
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 27, 2024
Copy link
Member

@cdrage cdrage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great implementation and it works! Thank you so much.

We should follow the label convention (suggested in a comment).

Also are you able to write a test for k8sutils.go for the new functionality?

@@ -811,7 +811,7 @@ func KomposeObjectToServiceConfigGroupMapping(komposeObject *kobject.KomposeObje
// TranslatePodResource config pod resources
func TranslatePodResource(service *kobject.ServiceConfig, template *api.PodTemplateSpec) {
// Configure the resource limits
if service.MemLimit != 0 || service.CPULimit != 0 {
if service.MemLimit != 0 || service.CPULimit != 0 || service.DeployLabels["limits.ephemeral-storage"] != "" {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should follow https://kompose.io/user-guide/#labels convention.

Maybe instead let's do kompose.ephemeral-storage.limit and kompose.ephemeral-storage.request

?

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 3, 2024
@jvitor83
Copy link
Contributor Author

jvitor83 commented Oct 3, 2024

Changed and Added tests as asked @cdrage

@cdrage
Copy link
Member

cdrage commented Oct 30, 2024

So sorry for the delay, but thank you for the changes, this LGTM.

@cdrage
Copy link
Member

cdrage commented Oct 30, 2024

/lgtm

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 30, 2024
@cdrage
Copy link
Member

cdrage commented Oct 30, 2024

/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 30, 2024
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cdrage, jvitor83

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@cdrage
Copy link
Member

cdrage commented Oct 30, 2024

Amazing work, big thanks for this new feature!!! 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀 🚀

@k8s-ci-robot
Copy link
Contributor

New changes are detected. LGTM label has been removed.

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Oct 31, 2024
@jvitor83
Copy link
Contributor Author

Fixed the expected label in test, sorry, forgot to rename there before.
All good now @cdrage

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Generate ephemeral-storage requests and limits configuration using deploy labels
3 participants