diff --git a/components/ws-manager-api/go/config/config.go b/components/ws-manager-api/go/config/config.go index 0f053ae7585580..3d98f701c8d3a6 100644 --- a/components/ws-manager-api/go/config/config.go +++ b/components/ws-manager-api/go/config/config.go @@ -297,15 +297,15 @@ type ContainerConfiguration struct { // Validate validates a container configuration func (c *ContainerConfiguration) Validate() error { return ozzo.ValidateStruct(c, - ozzo.Field(&c.Requests, validResourceConfig), - ozzo.Field(&c.Limits, validResourceConfig), + ozzo.Field(&c.Requests, validResourceRequestConfig), + ozzo.Field(&c.Limits, validResourceLimitConfig), ) } -var validResourceConfig = ozzo.By(func(o interface{}) error { +var validResourceRequestConfig = ozzo.By(func(o interface{}) error { rc, ok := o.(*ResourceRequestConfiguration) if !ok { - return xerrors.Errorf("can only validate ResourceConfiguration") + return xerrors.Errorf("can only validate ResourceRequestConfiguration") } if rc == nil { return nil diff --git a/components/ws-manager/pkg/manager/create_test.go b/components/ws-manager/pkg/manager/create_test.go index 93e2db26ea1986..9525f5cc7e60e1 100644 --- a/components/ws-manager/pkg/manager/create_test.go +++ b/components/ws-manager/pkg/manager/create_test.go @@ -28,13 +28,13 @@ var ( func TestCreateDefiniteWorkspacePod(t *testing.T) { type WorkspaceClass struct { - DefaultTemplate *corev1.Pod `json:"defaultTemplate,omitempty"` - PrebuildTemplate *corev1.Pod `json:"prebuildTemplate,omitempty"` - ProbeTemplate *corev1.Pod `json:"probeTemplate,omitempty"` - ImagebuildTemplate *corev1.Pod `json:"imagebuildTemplate,omitempty"` - RegularTemplate *corev1.Pod `json:"regularTemplate,omitempty"` - ResourceRequests *config.ResourceConfiguration `json:"resourceRequests,omitempty"` - ResourceLimits *config.ResourceConfiguration `json:"resourceLimits,omitempty"` + DefaultTemplate *corev1.Pod `json:"defaultTemplate,omitempty"` + PrebuildTemplate *corev1.Pod `json:"prebuildTemplate,omitempty"` + ProbeTemplate *corev1.Pod `json:"probeTemplate,omitempty"` + ImagebuildTemplate *corev1.Pod `json:"imagebuildTemplate,omitempty"` + RegularTemplate *corev1.Pod `json:"regularTemplate,omitempty"` + ResourceRequests *config.ResourceRequestConfiguration `json:"resourceRequests,omitempty"` + ResourceLimits *config.ResourceLimitConfiguration `json:"resourceLimits,omitempty"` } type tpl struct { FN string @@ -190,9 +190,9 @@ func TestCreateDefiniteWorkspacePod(t *testing.T) { func TestCreatePVCForWorkspacePod(t *testing.T) { type WorkspaceClass struct { - PVCConfig *config.PVCConfiguration `json:"pvcConfig,omitempty"` - ResourceRequests *config.ResourceConfiguration `json:"resourceRequests,omitempty"` - ResourceLimits *config.ResourceConfiguration `json:"resourceLimits,omitempty"` + PVCConfig *config.PVCConfiguration `json:"pvcConfig,omitempty"` + ResourceRequests *config.ResourceRequestConfiguration `json:"resourceRequests,omitempty"` + ResourceLimits *config.ResourceLimitConfiguration `json:"resourceLimits,omitempty"` } type fixture struct { WorkspaceClass diff --git a/components/ws-manager/pkg/manager/integration_test.go b/components/ws-manager/pkg/manager/integration_test.go index 96b169c6727313..6a5cd5f6490003 100644 --- a/components/ws-manager/pkg/manager/integration_test.go +++ b/components/ws-manager/pkg/manager/integration_test.go @@ -75,13 +75,13 @@ func forIntegrationTestGetManager(t *testing.T) *Manager { "": { Container: config.ContainerConfiguration{ Limits: &config.ResourceLimitConfiguration{ - CPU: config.CpuResourceLimit{ - MinLimit: "", + CPU: &config.CpuResourceLimit{ + MinLimit: "600m", BurstLimit: "900m", }, Memory: "1000M", }, - Requests: &config.ResourceConfiguration{ + Requests: &config.ResourceRequestConfiguration{ CPU: "1m", Memory: "1m", }, diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_admission.golden b/components/ws-manager/pkg/manager/testdata/cdwp_admission.golden index a027e58fb38ded..6ef56a58d75c0d 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_admission.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_admission.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_everyone", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_affinity.golden b/components/ws-manager/pkg/manager/testdata/cdwp_affinity.golden index 9f975348315489..0ce864250ae865 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_affinity.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_affinity.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.golden b/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.golden index 9c11d9992ca31f..9734900b51738b 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.golden @@ -9,4 +9,4 @@ "status": {} }, "error": "cannot create definite workspace pod: cannot create workspace container: cannot parse workspace container requests: cpu: quantities must match the regular expression '^([+-]?[0-9.]+)([eEinumkKMGTP]*[-+]?[0-9]*)$'" -} \ No newline at end of file +} diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.json b/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.json index 14b60d55095864..dc65fdfce6cc64 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.json +++ b/components/ws-manager/pkg/manager/testdata/cdwp_broken_resource_request.json @@ -28,4 +28,4 @@ "resourceRequests": { "cpu": "foobar" } -} \ No newline at end of file +} diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_class.golden b/components/ws-manager/pkg/manager/testdata/cdwp_class.golden index 0f81931a8e14ae..f6e65eddf23739 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_class.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_class.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "1200m", + "gitpod.io/cpuLimit": "900m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", @@ -154,7 +156,7 @@ ], "resources": { "limits": { - "cpu": "900m" + "cpu": "1200m" }, "requests": { "cpu": "900m" diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_class.json b/components/ws-manager/pkg/manager/testdata/cdwp_class.json index 1d13d2ba64bc99..8d275f9f6449a1 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_class.json +++ b/components/ws-manager/pkg/manager/testdata/cdwp_class.json @@ -2,7 +2,12 @@ "classes": { "gitpodio-internal-foobar": { "resourceRequests": {"cpu": "900m"}, - "resourceLimits": {"cpu": "900m"}, + "resourceLimits": { + "cpu": { + "min": "900m", + "burst": "1200m" + } + }, "defaultTemplate": { "spec": { "dnsConfig": { diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_class_notfound.golden b/components/ws-manager/pkg/manager/testdata/cdwp_class_notfound.golden index 8872fa39919d14..30e53e81d83ee6 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_class_notfound.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_class_notfound.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_customcerts.golden b/components/ws-manager/pkg/manager/testdata/cdwp_customcerts.golden index 1fb4ba0486e960..2d3d4a35130b07 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_customcerts.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_customcerts.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_debug_workspace_pod.golden b/components/ws-manager/pkg/manager/testdata/cdwp_debug_workspace_pod.golden index 1403b4da635895..6d632162a21b8d 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_debug_workspace_pod.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_debug_workspace_pod.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.golden b/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.golden index 3ff4def8a68f8d..33d039b1c5c4d3 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "1200m", + "gitpod.io/cpuLimit": "900m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", @@ -145,6 +147,9 @@ } ], "resources": { + "limits": { + "cpu": "1200m" + }, "requests": { "cpu": "5m" } diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.json b/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.json index 698ba2c531c570..155daecf0b2822 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.json +++ b/components/ws-manager/pkg/manager/testdata/cdwp_empty_resource_req.json @@ -28,5 +28,11 @@ "resourceRequests": { "cpu": "5m", "memory": "0Gi" + }, + "resourceLimits": { + "cpu": { + "min": "900m", + "burst": "1200m" + } } -} \ No newline at end of file +} diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_envvars.golden b/components/ws-manager/pkg/manager/testdata/cdwp_envvars.golden index f37f927793629e..360e05d589f3b3 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_envvars.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_envvars.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_fixedresources.golden b/components/ws-manager/pkg/manager/testdata/cdwp_fixedresources.golden index eb61a3d9166b3a..e74059b5ea27ff 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_fixedresources.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_fixedresources.golden @@ -22,6 +22,7 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", "gitpod.io/cpuLimit": "900m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_fullworkspacebackup.golden b/components/ws-manager/pkg/manager/testdata/cdwp_fullworkspacebackup.golden index d2e754e3104069..eabc307bb0628d 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_fullworkspacebackup.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_fullworkspacebackup.golden @@ -23,6 +23,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild.golden b/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild.golden index ba16d217c2ff84..ffb5f867fe0d11 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild_template.golden b/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild_template.golden index ba16d217c2ff84..ffb5f867fe0d11 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild_template.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_imagebuild_template.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_prebuild.golden b/components/ws-manager/pkg/manager/testdata/cdwp_prebuild.golden index ba3ec9293e47ec..da64df6b8e4782 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_prebuild.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_prebuild.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template.golden b/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template.golden index ba3ec9293e47ec..da64df6b8e4782 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template_override_resources.golden b/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template_override_resources.golden index 8c5195db0d1477..49a8ded500628d 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template_override_resources.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_prebuild_template_override_resources.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_probe.golden b/components/ws-manager/pkg/manager/testdata/cdwp_probe.golden index dd3caf55e812dd..1f3b6dadbbce9d 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_probe.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_probe.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_readinessprobe.golden b/components/ws-manager/pkg/manager/testdata/cdwp_readinessprobe.golden index 9d81426fc605b4..3c1ca1c8e86a76 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_readinessprobe.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_readinessprobe.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_secrets.golden b/components/ws-manager/pkg/manager/testdata/cdwp_secrets.golden index e88b28e62ff15e..1578f44959d5aa 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_secrets.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_secrets.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_sshkeys.golden b/components/ws-manager/pkg/manager/testdata/cdwp_sshkeys.golden index 7bbbe7e6286de0..568f84b9438623 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_sshkeys.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_sshkeys.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod.io/sshPublicKeys": "Cl9zc2gtZWQyNTUxOSBBQUFBQzNOemFDMWxaREkxTlRFNUFBQUFJSG0yK2tKSy93dWwxVkd3OXJmQ21kY0dqSjBXbUdiQmpDNXA1OTA4VUdnWiBnaXRwb2RAdW5rbm93bgqvAWVjZHNhLXNoYTItbmlzdHAyNTYgQUFBQUUyVmpaSE5oTFhOb1lUSXRibWx6ZEhBeU5UWUFBQUFJYm1semRIQXlOVFlBQUFCQkJNL0Eva3JhV2pXeTI4blZmc1Y0R2EyRjROQUFWT0dwL1YzazNVOThuT3QyVVNZd3U3RXRTcUVPN1BDUFErK3pOSmR1aFk1SjBmYm42TzA0K25LdmR0OD0gZ2l0cG9kQHVua25vd24=", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_tasks.golden b/components/ws-manager/pkg/manager/testdata/cdwp_tasks.golden index 953fb8c3ce8d0b..83affef612540f 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_tasks.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_tasks.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_template.golden b/components/ws-manager/pkg/manager/testdata/cdwp_template.golden index c0311497025b35..307f6e60800deb 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_template.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_template.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_timeout.golden b/components/ws-manager/pkg/manager/testdata/cdwp_timeout.golden index a51122931e8029..979dd896064536 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_timeout.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_timeout.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/customTimeout": "35m20s", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_userns.golden b/components/ws-manager/pkg/manager/testdata/cdwp_userns.golden index 9cd02604de21fc..e1bcb27c227391 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_userns.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_userns.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_withaffinity_regular.golden b/components/ws-manager/pkg/manager/testdata/cdwp_withaffinity_regular.golden index c0311497025b35..307f6e60800deb 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_withaffinity_regular.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_withaffinity_regular.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "test", diff --git a/components/ws-manager/pkg/manager/testdata/cdwp_withaffinityheadless.golden b/components/ws-manager/pkg/manager/testdata/cdwp_withaffinityheadless.golden index ba16d217c2ff84..ffb5f867fe0d11 100644 --- a/components/ws-manager/pkg/manager/testdata/cdwp_withaffinityheadless.golden +++ b/components/ws-manager/pkg/manager/testdata/cdwp_withaffinityheadless.golden @@ -22,6 +22,8 @@ "cluster-autoscaler.kubernetes.io/safe-to-evict": "false", "container.apparmor.security.beta.kubernetes.io/workspace": "unconfined", "gitpod.io/attemptingToCreate": "true", + "gitpod.io/cpuBurstLimit": "900m", + "gitpod.io/cpuLimit": "300m", "gitpod/admission": "admit_owner_only", "gitpod/contentInitializer": "GmcKZXdvcmtzcGFjZXMvY3J5cHRpYy1pZC1nb2VzLWhlcmcvZmQ2MjgwNGItNGNhYi0xMWU5LTg0M2EtNGU2NDUzNzMwNDhlLnRhckBnaXRwb2QtZGV2LXVzZXItY2hyaXN0ZXN0aW5n", "gitpod/id": "foobar", diff --git a/components/ws-manager/pkg/manager/testdata/cpwp_custom_storage.json b/components/ws-manager/pkg/manager/testdata/cpwp_custom_storage.json index 3e5c5cd1c84294..daba1892d2dc0c 100644 --- a/components/ws-manager/pkg/manager/testdata/cpwp_custom_storage.json +++ b/components/ws-manager/pkg/manager/testdata/cpwp_custom_storage.json @@ -2,7 +2,6 @@ "classes": { "gitpodio-pvc": { "resourceRequests": {"cpu": "900m"}, - "resourceLimits": {"cpu": "900m"}, "pvcConfig": { "size": "30Gi", "storageClass": "test-storage", diff --git a/components/ws-manager/pkg/manager/testdata/cpwp_default_storage.json b/components/ws-manager/pkg/manager/testdata/cpwp_default_storage.json index d3d0dc95616b13..de1c74e3be3fa7 100644 --- a/components/ws-manager/pkg/manager/testdata/cpwp_default_storage.json +++ b/components/ws-manager/pkg/manager/testdata/cpwp_default_storage.json @@ -2,7 +2,6 @@ "classes": { "gitpodio-pvc": { "resourceRequests": {"cpu": "900m"}, - "resourceLimits": {"cpu": "900m"}, "pvcConfig": { "size": "30Gi", "storageClass": "", diff --git a/components/ws-manager/pkg/manager/testdata/cpwp_from_volume_snapshot.json b/components/ws-manager/pkg/manager/testdata/cpwp_from_volume_snapshot.json index 21123117a106ed..d8ecc924c7f5d1 100644 --- a/components/ws-manager/pkg/manager/testdata/cpwp_from_volume_snapshot.json +++ b/components/ws-manager/pkg/manager/testdata/cpwp_from_volume_snapshot.json @@ -2,7 +2,6 @@ "classes": { "gitpodio-pvc": { "resourceRequests": {"cpu": "900m"}, - "resourceLimits": {"cpu": "900m"}, "pvcConfig": { "size": "30Gi", "storageClass": "test-storage", diff --git a/components/ws-manager/pkg/manager/testdata/cpwp_no_pvc.json b/components/ws-manager/pkg/manager/testdata/cpwp_no_pvc.json index 0a9fe6f4b70d74..b0a4c7451ea0d8 100644 --- a/components/ws-manager/pkg/manager/testdata/cpwp_no_pvc.json +++ b/components/ws-manager/pkg/manager/testdata/cpwp_no_pvc.json @@ -2,7 +2,12 @@ "classes": { "gitpodio-pvc": { "resourceRequests": {"cpu": "900m"}, - "resourceLimits": {"cpu": "900m"} + "resourceLimits": { + "cpu": { + "low": "900m", + "burst": "1200m" + } + } } }, "spec": { diff --git a/components/ws-manager/pkg/manager/testing_test.go b/components/ws-manager/pkg/manager/testing_test.go index ed440167f840b5..89a544af6762f1 100644 --- a/components/ws-manager/pkg/manager/testing_test.go +++ b/components/ws-manager/pkg/manager/testing_test.go @@ -44,13 +44,13 @@ func forTestingOnlyManagerConfig() config.Configuration { config.DefaultWorkspaceClass: { Container: config.ContainerConfiguration{ Limits: &config.ResourceLimitConfiguration{ - CPU: config.CpuResourceLimit{ - MinLimit: "", + CPU: &config.CpuResourceLimit{ + MinLimit: "300m", BurstLimit: "900m", }, Memory: "1000M", }, - Requests: &config.ResourceConfiguration{ + Requests: &config.ResourceRequestConfiguration{ CPU: "899m", EphemeralStorage: "5Gi", Memory: "999M",