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

fix(metrics-collector): allow user to nuke ephemeral-storage requests #1312

Merged
merged 3 commits into from
Sep 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions pkg/util/v1beta1/katibconfig/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -250,5 +250,13 @@ func setResourceRequirements(configResource corev1.ResourceRequirements) corev1.
defaultDiskLimit, _ := resource.ParseQuantity(consts.DefaultDiskLimit)
configResource.Limits[corev1.ResourceEphemeralStorage] = defaultDiskLimit
}

// If user explicitly sets ephemeral-storage value to something negative, nuke it.
// This enables compability with the GKE nodepool autoscalers, which cannot scale
// pods which define ephemeral-storage resource constraints.
if diskLimit.Sign() == -1 && diskRequest.Sign() == -1 {
delete(configResource.Limits, corev1.ResourceEphemeralStorage)
delete(configResource.Requests, corev1.ResourceEphemeralStorage)
}
return configResource
}