-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
[installer] Allow configuration of resource requests and limits #9545
Conversation
To allow each component (server, dashboard etc) to specify resource requirements via the `experimental` config section.
Take a default set of ResourceRequirements and override them if any resource config for the given component is present in the `experimental` section.
Use the common.ResourceRequirements function from the parent commits, passing in the existing defaults.
I'm not sure whether it's worth making the gitpod/install/installer/pkg/common/common.go Lines 305 to 308 in 3998444
|
@andrew-farries ah, good find! No, let's keep that as is for now. 👍 |
@@ -79,6 +81,108 @@ func TestReplicas(t *testing.T) { | |||
} | |||
} | |||
|
|||
func TestResourceRequirements(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, and tests run! 👍
/werft run 👍 started the job as gitpod-build-af-installer-specify-resourcerequirements.4 |
incorrectServerResources := corev1.ResourceRequirements{
Requests: corev1.ResourceList{
"cpu": resource.MustParse("0"),
"memory": resource.MustParse("0"),
},
Limits: corev1.ResourceList{
"cpu": resource.MustParse("-500m"),
"memory": resource.MustParse("800Mi"),
},
} after {
"limits": {
"cpu": "-500m",
"memory": "800Mi"
},
"requests": {
"cpu": "0",
"memory": "0"
}
} Should we validate it and panic first? or let it failed after apply to k8s |
@mustard-mh IMO that's a kubernetes thing, as we're re-using their data structures. 👍 |
Setting to true will add pod (anti)-affinity fields to the server and proxy components.
Description
One of the Webapp team's epics for Q2 is to use the Gitpod installer to deploy to Gitpod SaaS. In order to do that we will need to add additional configuration to the installer to make the output suitable for a SaaS deployment as opposed to a self-hosted deployment.
This PR adds the ability to configure the resource requests and limits for all components via the
experimental
section in the installer config file.Related Issue(s)
Part of #9097
How to test
Create an installer config file containing this
experimental
section:Get a
versions.yaml
for use with the installer:Then invoke the installer as:
The rendered output will have the values from the config for the
server
anddashboard
component resource requests and limits. All other components will use their default hard-coded resources as before.Release Notes
Documentation
None.