Skip to content

Commit

Permalink
fix(metrics-collector): allow user to nuke ephemeral-storage requests
Browse files Browse the repository at this point in the history
  • Loading branch information
khersey committed Sep 16, 2020
1 parent 721a382 commit 61095c4
Showing 1 changed file with 8 additions and 0 deletions.
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
}

0 comments on commit 61095c4

Please sign in to comment.