From 020efcafd7294e3abc29dd6fdb899e1d2ccb2aa2 Mon Sep 17 00:00:00 2001 From: David Kwon Date: Sun, 10 Jul 2022 16:03:08 -0400 Subject: [PATCH] feat: implement secondsOfInactivityBeforeIdling and secondsOfRunBeforeIdling CR config Signed-off-by: David Kwon --- api/checluster_conversion_from_test.go | 4 ++ api/checluster_conversion_to_test.go | 11 ++-- api/v1/checluster_conversion_from.go | 2 + api/v1/checluster_conversion_to.go | 2 + api/v1/checluster_types.go | 10 ++++ api/v1/zz_generated.deepcopy.go | 13 ++++- api/v2/checluster_types.go | 10 ++++ api/v2/zz_generated.deepcopy.go | 11 ++++ .../che-operator.clusterserviceversion.yaml | 4 +- .../org.eclipse.che_checlusters.yaml | 30 +++++++++++ .../bases/org.eclipse.che_checlusters.yaml | 30 +++++++++++ controllers/usernamespace/controller.go | 51 +++++++++++++++++++ controllers/usernamespace/controller_test.go | 16 ++++++ deploy/deployment/kubernetes/combined.yaml | 20 ++++++++ ....eclipse.che.CustomResourceDefinition.yaml | 20 ++++++++ deploy/deployment/openshift/combined.yaml | 20 ++++++++ ....eclipse.che.CustomResourceDefinition.yaml | 20 ++++++++ ....eclipse.che.CustomResourceDefinition.yaml | 20 ++++++++ 18 files changed, 288 insertions(+), 6 deletions(-) diff --git a/api/checluster_conversion_from_test.go b/api/checluster_conversion_from_test.go index dcb0710ec..ff81ec1c5 100644 --- a/api/checluster_conversion_from_test.go +++ b/api/checluster_conversion_from_test.go @@ -347,6 +347,8 @@ func TestConvertFrom(t *testing.T) { Value: "Value", Effect: "Effect", }}, + SecondsOfInactivityBeforeIdling: pointer.Int32Ptr(900), + SecondsOfRunBeforeIdling: pointer.Int32Ptr(-1), }, ContainerRegistry: chev2.CheClusterContainerRegistry{ Hostname: "AirGapContainerRegistryHostname", @@ -405,6 +407,8 @@ func TestConvertFrom(t *testing.T) { assert.Equal(t, checlusterv1.Spec.DevWorkspace.ControllerImage, "DevWorkspaceImage") assert.Equal(t, checlusterv1.Spec.DevWorkspace.RunningLimit, "RunningLimit") + assert.Equal(t, checlusterv1.Spec.DevWorkspace.SecondsOfInactivityBeforeIdling, pointer.Int32Ptr(900)) + assert.Equal(t, checlusterv1.Spec.DevWorkspace.SecondsOfRunBeforeIdling, pointer.Int32Ptr(-1)) assert.True(t, checlusterv1.Spec.DevWorkspace.Enable) assert.Equal(t, checlusterv1.Spec.Dashboard.Warning, "DashboardWarning") diff --git a/api/checluster_conversion_to_test.go b/api/checluster_conversion_to_test.go index 76d64b1de..8258639f0 100644 --- a/api/checluster_conversion_to_test.go +++ b/api/checluster_conversion_to_test.go @@ -16,6 +16,7 @@ import ( "testing" "k8s.io/apimachinery/pkg/api/resource" + "k8s.io/utils/pointer" devfile "github.com/devfile/api/v2/pkg/apis/workspaces/v1alpha2" "github.com/devfile/devworkspace-operator/pkg/infrastructure" @@ -274,9 +275,11 @@ func TestConvertTo(t *testing.T) { Enable: true, }, DevWorkspace: chev1.CheClusterSpecDevWorkspace{ - Enable: true, - ControllerImage: "ControllerImage", - RunningLimit: "RunningLimit", + Enable: true, + ControllerImage: "ControllerImage", + RunningLimit: "RunningLimit", + SecondsOfInactivityBeforeIdling: pointer.Int32Ptr(900), + SecondsOfRunBeforeIdling: pointer.Int32Ptr(-1), }, Dashboard: chev1.CheClusterSpecDashboard{ Warning: "DashboardWarning", @@ -413,6 +416,8 @@ func TestConvertTo(t *testing.T) { assert.Equal(t, checlusterv2.Spec.DevEnvironments.Storage.Pvc.ClaimSize, "WorkspacePvcClaimSize") assert.Equal(t, checlusterv2.Spec.DevEnvironments.Storage.Pvc.StorageClass, "WorkspacePVCStorageClassName") assert.Equal(t, checlusterv2.Spec.DevEnvironments.Storage.PvcStrategy, "PvcStrategy") + assert.Equal(t, checlusterv2.Spec.DevEnvironments.SecondsOfInactivityBeforeIdling, pointer.Int32Ptr(900)) + assert.Equal(t, checlusterv2.Spec.DevEnvironments.SecondsOfRunBeforeIdling, pointer.Int32Ptr(-1)) assert.Equal(t, checlusterv2.Status.CheURL, "CheURL") assert.Equal(t, checlusterv2.Status.CheVersion, "CheVersion") diff --git a/api/v1/checluster_conversion_from.go b/api/v1/checluster_conversion_from.go index 0da31bb64..ada1a6739 100644 --- a/api/v1/checluster_conversion_from.go +++ b/api/v1/checluster_conversion_from.go @@ -342,6 +342,8 @@ func (dst *CheCluster) convertFrom_DevWorkspace(src *chev2.CheCluster) error { } dst.Spec.DevWorkspace.RunningLimit = src.Spec.Components.DevWorkspace.RunningLimit + dst.Spec.DevWorkspace.SecondsOfInactivityBeforeIdling = src.Spec.DevEnvironments.SecondsOfInactivityBeforeIdling + dst.Spec.DevWorkspace.SecondsOfRunBeforeIdling = src.Spec.DevEnvironments.SecondsOfRunBeforeIdling dst.Spec.DevWorkspace.Enable = true return nil } diff --git a/api/v1/checluster_conversion_to.go b/api/v1/checluster_conversion_to.go index 025134f09..11b12192d 100644 --- a/api/v1/checluster_conversion_to.go +++ b/api/v1/checluster_conversion_to.go @@ -128,6 +128,8 @@ func (src *CheCluster) convertTo_DevEnvironments(dst *chev2.CheCluster) error { dst.Spec.DevEnvironments.DefaultEditor = src.Spec.Server.WorkspaceDefaultEditor dst.Spec.DevEnvironments.DefaultComponents = src.Spec.Server.WorkspaceDefaultComponents + dst.Spec.DevEnvironments.SecondsOfInactivityBeforeIdling = src.Spec.DevWorkspace.SecondsOfInactivityBeforeIdling + dst.Spec.DevEnvironments.SecondsOfRunBeforeIdling = src.Spec.DevWorkspace.SecondsOfRunBeforeIdling if err := src.convertTo_Workspaces_Storage(dst); err != nil { return err diff --git a/api/v1/checluster_types.go b/api/v1/checluster_types.go index a297537ee..6d9510a1e 100644 --- a/api/v1/checluster_types.go +++ b/api/v1/checluster_types.go @@ -724,6 +724,16 @@ type CheClusterSpecDevWorkspace struct { // Maximum number of the running workspaces per user. // +optional RunningLimit string `json:"runningLimit,omitempty"` + // Idle timeout for workspaces in seconds. + // This timeout is the duration after which a workspace will be idled if there is no activity. + // To disable workspace idling due to inactivity, set this value to -1. + // +kubebuilder:default:=900 + SecondsOfInactivityBeforeIdling *int32 `json:"secondsOfInactivityBeforeIdling,omitempty"` + // Run timeout for workspaces in seconds. + // This timeout is the maximum duration a workspace runs. + // To disable workspace run timeout, set this value to -1. + // +kubebuilder:default:=-1 + SecondsOfRunBeforeIdling *int32 `json:"secondsOfRunBeforeIdling,omitempty"` } // +k8s:openapi-gen=true diff --git a/api/v1/zz_generated.deepcopy.go b/api/v1/zz_generated.deepcopy.go index d2f426ab5..d020ed028 100644 --- a/api/v1/zz_generated.deepcopy.go +++ b/api/v1/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // @@ -93,7 +94,7 @@ func (in *CheClusterSpec) DeepCopyInto(out *CheClusterSpec) { out.Metrics = in.Metrics out.K8s = in.K8s out.ImagePuller = in.ImagePuller - out.DevWorkspace = in.DevWorkspace + in.DevWorkspace.DeepCopyInto(&out.DevWorkspace) } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheClusterSpec. @@ -173,6 +174,16 @@ func (in *CheClusterSpecDashboard) DeepCopy() *CheClusterSpecDashboard { // DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil. func (in *CheClusterSpecDevWorkspace) DeepCopyInto(out *CheClusterSpecDevWorkspace) { *out = *in + if in.SecondsOfInactivityBeforeIdling != nil { + in, out := &in.SecondsOfInactivityBeforeIdling, &out.SecondsOfInactivityBeforeIdling + *out = new(int32) + **out = **in + } + if in.SecondsOfRunBeforeIdling != nil { + in, out := &in.SecondsOfRunBeforeIdling, &out.SecondsOfRunBeforeIdling + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheClusterSpecDevWorkspace. diff --git a/api/v2/checluster_types.go b/api/v2/checluster_types.go index 400f5deb1..b57cafbda 100644 --- a/api/v2/checluster_types.go +++ b/api/v2/checluster_types.go @@ -90,6 +90,16 @@ type CheClusterDevEnvironments struct { // These default components are meant to be used when a Devfile, that does not contain any components. // +optional DefaultComponents []devfile.Component `json:"defaultComponents,omitempty"` + // Idle timeout for workspaces in seconds. + // This timeout is the duration after which a workspace will be idled if there is no activity. + // To disable workspace idling due to inactivity, set this value to -1. + // +kubebuilder:default:=900 + SecondsOfInactivityBeforeIdling *int32 `json:"secondsOfInactivityBeforeIdling,omitempty"` + // Run timeout for workspaces in seconds. + // This timeout is the maximum duration a workspace runs. + // To disable workspace run timeout, set this value to -1. + // +kubebuilder:default:=-1 + SecondsOfRunBeforeIdling *int32 `json:"secondsOfRunBeforeIdling,omitempty"` } // Che components configuration. diff --git a/api/v2/zz_generated.deepcopy.go b/api/v2/zz_generated.deepcopy.go index b4bb521d2..b3cf7453b 100644 --- a/api/v2/zz_generated.deepcopy.go +++ b/api/v2/zz_generated.deepcopy.go @@ -1,3 +1,4 @@ +//go:build !ignore_autogenerated // +build !ignore_autogenerated // @@ -151,6 +152,16 @@ func (in *CheClusterDevEnvironments) DeepCopyInto(out *CheClusterDevEnvironments (*in)[i].DeepCopyInto(&(*out)[i]) } } + if in.SecondsOfInactivityBeforeIdling != nil { + in, out := &in.SecondsOfInactivityBeforeIdling, &out.SecondsOfInactivityBeforeIdling + *out = new(int32) + **out = **in + } + if in.SecondsOfRunBeforeIdling != nil { + in, out := &in.SecondsOfRunBeforeIdling, &out.SecondsOfRunBeforeIdling + *out = new(int32) + **out = **in + } } // DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CheClusterDevEnvironments. diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml index 21241184f..d45023d75 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/che-operator.clusterserviceversion.yaml @@ -76,7 +76,7 @@ metadata: operators.operatorframework.io/project_layout: go.kubebuilder.io/v3 repository: https://github.com/eclipse-che/che-operator support: Eclipse Foundation - name: eclipse-che-preview-openshift.v7.50.0-621.next + name: eclipse-che-preview-openshift.v7.51.0-622.next namespace: placeholder spec: apiservicedefinitions: {} @@ -1390,7 +1390,7 @@ spec: maturity: stable provider: name: Eclipse Foundation - version: 7.50.0-621.next + version: 7.51.0-622.next webhookdefinitions: - admissionReviewVersions: - v1 diff --git a/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml b/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml index 1148e4dbd..38e2c4415 100644 --- a/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml +++ b/bundle/next/eclipse-che-preview-openshift/manifests/org.eclipse.che_checlusters.yaml @@ -439,6 +439,21 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout + is the duration after which a workspace will be idled if there + is no activity. To disable workspace idling due to inactivity, + set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout + is the maximum duration a workspace runs. To disable workspace + run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -5174,6 +5189,21 @@ spec: description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout + is the duration after which a workspace will be idled if there + is no activity. To disable workspace idling due to inactivity, + set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout + is the maximum duration a workspace runs. To disable workspace + run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common diff --git a/config/crd/bases/org.eclipse.che_checlusters.yaml b/config/crd/bases/org.eclipse.che_checlusters.yaml index 73a23d391..73d9bf829 100644 --- a/config/crd/bases/org.eclipse.che_checlusters.yaml +++ b/config/crd/bases/org.eclipse.che_checlusters.yaml @@ -416,6 +416,21 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout + is the duration after which a workspace will be idled if there + is no activity. To disable workspace idling due to inactivity, + set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout + is the maximum duration a workspace runs. To disable workspace + run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -5022,6 +5037,21 @@ spec: description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout + is the duration after which a workspace will be idled if there + is no activity. To disable workspace idling due to inactivity, + set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout + is the maximum duration a workspace runs. To disable workspace + run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common diff --git a/controllers/usernamespace/controller.go b/controllers/usernamespace/controller.go index 0b0e965f7..7015a0555 100644 --- a/controllers/usernamespace/controller.go +++ b/controllers/usernamespace/controller.go @@ -15,6 +15,7 @@ package usernamespace import ( "context" "encoding/json" + "strconv" "github.com/eclipse-che/che-operator/pkg/common/chetypes" "github.com/eclipse-che/che-operator/pkg/common/constants" @@ -34,6 +35,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" + "k8s.io/utils/pointer" ctrl "sigs.k8s.io/controller-runtime" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/handler" @@ -238,6 +240,11 @@ func (r *CheUserNamespaceReconciler) Reconcile(ctx context.Context, req ctrl.Req return ctrl.Result{}, err } + if err = r.reconcileIdleSettings(ctx, req.Name, checluster, deployContext); err != nil { + logrus.Errorf("Failed to reconcile idle settings into namespace '%s': %v", req.Name, err) + return ctrl.Result{}, err + } + if err = r.reconcileNodeSelectorAndTolerations(ctx, req.Name, checluster, deployContext); err != nil { logrus.Errorf("Failed to reconcile the workspace pod node selector and tolerations in namespace '%s': %v", req.Name, err) return ctrl.Result{}, err @@ -448,6 +455,50 @@ func (r *CheUserNamespaceReconciler) reconcileProxySettings(ctx context.Context, return err } +func (r *CheUserNamespaceReconciler) reconcileIdleSettings(ctx context.Context, targetNs string, checluster *chev2.CheCluster, deployContext *chetypes.DeployContext) error { + + noIdle := pointer.Int32Ptr(-1) + if checluster.Spec.DevEnvironments.SecondsOfInactivityBeforeIdling == noIdle && checluster.Spec.DevEnvironments.SecondsOfRunBeforeIdling == noIdle { + return nil + } + configMapName := prefixedName("idle-settings") + cfg := &corev1.ConfigMap{} + + requiredLabels := defaults.AddStandardLabelsForComponent(checluster, userSettingsComponentLabelValue, map[string]string{ + dwconstants.DevWorkspaceMountLabel: "true", + dwconstants.DevWorkspaceWatchConfigMapLabel: "true", + }) + requiredAnnos := map[string]string{ + dwconstants.DevWorkspaceMountAsAnnotation: "env", + } + + data := map[string]string{} + + if checluster.Spec.DevEnvironments.SecondsOfInactivityBeforeIdling != noIdle { + data["SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING"] = strconv.Itoa(int(*checluster.Spec.DevEnvironments.SecondsOfInactivityBeforeIdling)) + } + + if checluster.Spec.DevEnvironments.SecondsOfRunBeforeIdling != noIdle { + data["SECONDS_OF_DW_RUN_BEFORE_IDLING"] = strconv.Itoa(int(*checluster.Spec.DevEnvironments.SecondsOfRunBeforeIdling)) + } + + cfg = &corev1.ConfigMap{ + TypeMeta: metav1.TypeMeta{ + Kind: "ConfigMap", + APIVersion: "v1", + }, + ObjectMeta: metav1.ObjectMeta{ + Name: configMapName, + Namespace: targetNs, + Labels: requiredLabels, + Annotations: requiredAnnos, + }, + Data: data, + } + _, err := deploy.DoSync(deployContext, cfg, deploy.ConfigMapDiffOpts) + return err +} + func (r *CheUserNamespaceReconciler) reconcileGitTlsCertificate(ctx context.Context, targetNs string, checluster *chev2.CheCluster, deployContext *chetypes.DeployContext) error { if err := deleteLegacyObject("git-tls-creds", &corev1.ConfigMap{}, targetNs, checluster, deployContext); err != nil { return err diff --git a/controllers/usernamespace/controller_test.go b/controllers/usernamespace/controller_test.go index c1a10742a..f5f7fb125 100644 --- a/controllers/usernamespace/controller_test.go +++ b/controllers/usernamespace/controller_test.go @@ -76,6 +76,8 @@ func setupCheCluster(t *testing.T, ctx context.Context, cl client.Client, scheme TrustedCerts: &chev2.TrustedCerts{ GitTrustedCertsConfigMapName: "che-git-self-signed-cert", }, + SecondsOfInactivityBeforeIdling: pointer.Int32Ptr(900), + SecondsOfRunBeforeIdling: pointer.Int32Ptr(1800), }, Networking: chev2.CheClusterSpecNetworking{ Domain: "root-domain", @@ -325,6 +327,20 @@ func TestCreatesDataInNamespace(t *testing.T) { assert.Equal(t, ".svc", proxySettings.Data["NO_PROXY"], "Unexpected proxy settings") + idleSettings := corev1.ConfigMap{} + assert.NoError(t, cl.Get(ctx, client.ObjectKey{Name: "che-idle-settings", Namespace: namespace.GetName()}, &idleSettings)) + + assert.Equal(t, "env", idleSettings.GetAnnotations()[dwconstants.DevWorkspaceMountAsAnnotation], + "idle settings should be annotated as mount as 'env'") + + assert.Equal(t, "true", idleSettings.GetLabels()[dwconstants.DevWorkspaceMountLabel], + "idle settings should be labeled as mounted") + + assert.Equal(t, 2, len(idleSettings.Data), "Expecting 2 elements in the idle settings") + + assert.Equal(t, "900", idleSettings.Data["SECONDS_OF_DW_INACTIVITY_BEFORE_IDLING"], "Unexpected idle settings") + assert.Equal(t, "1800", idleSettings.Data["SECONDS_OF_DW_RUN_BEFORE_IDLING"], "Unexpected idle settings") + cert := corev1.Secret{} assert.NoError(t, cl.Get(ctx, client.ObjectKey{Name: "che-server-cert", Namespace: namespace.GetName()}, &cert)) diff --git a/deploy/deployment/kubernetes/combined.yaml b/deploy/deployment/kubernetes/combined.yaml index 3e7c06cce..bd2235501 100644 --- a/deploy/deployment/kubernetes/combined.yaml +++ b/deploy/deployment/kubernetes/combined.yaml @@ -266,6 +266,16 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -3349,6 +3359,16 @@ spec: type: string description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common diff --git a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 8f9fdec6f..e913e550d 100644 --- a/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/kubernetes/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -261,6 +261,16 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -3344,6 +3354,16 @@ spec: type: string description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common diff --git a/deploy/deployment/openshift/combined.yaml b/deploy/deployment/openshift/combined.yaml index a88f0ffa0..97c55408c 100644 --- a/deploy/deployment/openshift/combined.yaml +++ b/deploy/deployment/openshift/combined.yaml @@ -266,6 +266,16 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -3349,6 +3359,16 @@ spec: type: string description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common diff --git a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 9557d3430..5362ec176 100644 --- a/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/deploy/deployment/openshift/objects/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -261,6 +261,16 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -3344,6 +3354,16 @@ spec: type: string description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common diff --git a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml index 8f9fdec6f..e913e550d 100644 --- a/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml +++ b/helmcharts/next/crds/checlusters.org.eclipse.che.CustomResourceDefinition.yaml @@ -261,6 +261,16 @@ spec: runningLimit: description: Maximum number of the running workspaces per user. type: string + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer required: - enable type: object @@ -3344,6 +3354,16 @@ spec: type: string description: The node selector limits the nodes that can run the workspace pods. type: object + secondsOfInactivityBeforeIdling: + default: 900 + description: Idle timeout for workspaces in seconds. This timeout is the duration after which a workspace will be idled if there is no activity. To disable workspace idling due to inactivity, set this value to -1. + format: int32 + type: integer + secondsOfRunBeforeIdling: + default: -1 + description: Run timeout for workspaces in seconds. This timeout is the maximum duration a workspace runs. To disable workspace run timeout, set this value to -1. + format: int32 + type: integer storage: default: pvcStrategy: common