This documentation is for a release that is no longer maintained
See documentation for the latest supported version.3.4. 全局配置工作区
本节介绍如何全局配置工作区。
3.4.1. 限制用户可以保留的工作区数量 复制链接链接已复制到粘贴板!
复制链接链接已复制到粘贴板!
默认情况下,用户可以在仪表板中保留无限数量的工作区,但您可以限制这个数量来减少集群中的需求。
这个配置是 CheCluster 自定义资源的一部分:
spec:
components:
cheServer:
extraProperties:
CHE_LIMITS_USER_WORKSPACES_COUNT: "<kept_workspaces_limit>"
spec:
components:
cheServer:
extraProperties:
CHE_LIMITS_USER_WORKSPACES_COUNT: "<kept_workspaces_limit>"
- 1
- 设置每个用户的最大工作区数量。默认值
-1允许用户保持无限数量的工作区。使用正整数设置每个用户的最大工作区数。
流程
获取 OpenShift Dev Spaces 命名空间的名称:
oc get checluster --all-namespaces \ -o=jsonpath="{.items[*].metadata.namespace}"$ oc get checluster --all-namespaces \ -o=jsonpath="{.items[*].metadata.namespace}"Copy to Clipboard Copied! Toggle word wrap Toggle overflow 默认为
openshift-operators。配置
CHE_LIMITS_USER_WORKSPACES_COUNT:oc patch checluster/devspaces -n openshift-operators \ --type='merge' -p \ '{"spec":{"components":{"cheServer":{"extraProperties":{"CHE_LIMITS_USER_WORKSPACES_COUNT": "<kept_workspaces_limit>"}}}}}'$ oc patch checluster/devspaces -n openshift-operators \1 --type='merge' -p \ '{"spec":{"components":{"cheServer":{"extraProperties":{"CHE_LIMITS_USER_WORKSPACES_COUNT": "<kept_workspaces_limit>"}}}}}'2 Copy to Clipboard Copied! Toggle word wrap Toggle overflow