-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add article about limiting the number of running workspaces ac… (
#2788) * chore: Add article about limiting the number of running workspaces across the cluster and concealing editors Signed-off-by: Anatolii Bazko <[email protected]> Co-authored-by: Jana Vrbkova <[email protected]>
- Loading branch information
1 parent
186138a
commit dcbd82a
Showing
10 changed files
with
271 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
172 changes: 172 additions & 0 deletions
172
modules/administration-guide/pages/concealing-editors-definitions.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
:_content-type: PROCEDURE | ||
:description: Concealing editors definitions | ||
:keywords: administration guide, concealing, dashboard, editors | ||
:navtitle: Concealing editors definitions | ||
|
||
[id="concealing-editors-definitions"] | ||
= Concealing editors definitions | ||
|
||
Learn how to conceal {prod-short} editor definitions. This is useful when you want to hide selected editors from the Dashboard UI, e.g. hide the IntelliJ IDEA Ultimate and have only Visual Studio Code - Open Source visible. | ||
|
||
.Prerequisites | ||
|
||
* An active `{orch-cli}` session with administrative permissions to the {orch-name} cluster. See {orch-cli-link}. | ||
|
||
* `jq`. See link:https://stedolan.github.io/jq/download/[Downloading `jq`]. | ||
|
||
.Procedure | ||
|
||
. Find out the namespace where the {prod-short} Operator is deployed: | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
OPERATOR_NAMESPACE=$({orch-cli} get pods -l app.kubernetes.io/component={prod-operator} -o jsonpath={".items[0].metadata.namespace"} --all-namespaces) | ||
---- | ||
|
||
. Find out the available editors definitions files: | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
{orch-cli} exec -n $OPERATOR_NAMESPACE deploy/{prod-operator} -- ls /tmp/editors-definitions | ||
---- | ||
The output should look similar to the following example: | ||
+ | ||
[source] | ||
---- | ||
che-code-insiders.yaml | ||
che-code-latest.yaml | ||
che-idea-latest.yaml | ||
che-idea-next.yaml | ||
---- | ||
|
||
. Choose an editor definition to conceal. | ||
For example, to conceal the `che-idea-next.yaml` editor definition, set the editor definition file name: | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
CHE_EDITOR_CONCEAL_FILE_NAME=che-idea-next.yaml | ||
---- | ||
|
||
. Define the ConfigMap name for the concealed editor definition: | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
CHE_EDITOR_CONCEAL_CONFIGMAP_NAME=che-conceal-$CHE_EDITOR_CONCEAL_FILE_NAME | ||
---- | ||
|
||
. Create the ConfigMap: | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
{orch-cli} create configmap $CHE_EDITOR_CONCEAL_CONFIGMAP_NAME \ | ||
--namespace $OPERATOR_NAMESPACE \ | ||
--from-literal=$CHE_EDITOR_CONCEAL_FILE_NAME="" | ||
---- | ||
|
||
. Find out the Operator subscription namespace (if it exists): | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
SUBSCRIPTION_NAMESPACE=$({orch-cli} get subscription \ | ||
--all-namespaces \ | ||
--field-selector=metadata.name={prod-operator-subscription} \ | ||
--output jsonpath='{.items[0].metadata.namespace}' 2>/dev/null | ||
) | ||
---- | ||
|
||
. Patch the {kubernetes} resource to mount the ConfigMap with the empty editor definition. The resource to patch depends on the existence of the Operator subscription. If the subscription exists, then the subscription should be patched. If not, patch the Operator deployment: | ||
+ | ||
[source,subs="+attributes"] | ||
---- | ||
if [[ -n $SUBSCRIPTION_NAMESPACE ]]; then | ||
if [[ $({orch-cli} get subscription {prod-operator-subscription} --namespace $SUBSCRIPTION_NAMESPACE --output jsonpath='{.spec.config}') == "" ]]; then | ||
{orch-cli} patch subscription {prod-operator-subscription} \ | ||
--namespace $SUBSCRIPTION_NAMESPACE \ | ||
--type json \ | ||
--patch '[{ | ||
"op":"add", | ||
"path":"/spec/config", | ||
"value": {} | ||
}]' | ||
fi | ||
if [[ $({orch-cli} get subscription {prod-operator-subscription} --namespace $SUBSCRIPTION_NAMESPACE --output jsonpath='{.spec.config.volumes}') == "" ]]; then | ||
{orch-cli} patch subscription {prod-operator-subscription} \ | ||
--namespace $SUBSCRIPTION_NAMESPACE \ | ||
--type json \ | ||
--patch '[{ | ||
"op":"add", | ||
"path":"/spec/config/volumes", | ||
"value": [] | ||
}]' | ||
fi | ||
if [[ $({orch-cli} get subscription {prod-operator-subscription} --namespace $SUBSCRIPTION_NAMESPACE --output jsonpath='{.spec.config.volumeMounts}') == "" ]]; then | ||
{orch-cli} patch subscription {prod-operator-subscription} \ | ||
--namespace $SUBSCRIPTION_NAMESPACE \ | ||
--type json \ | ||
--patch '[{ | ||
"op":"add", | ||
"path":"/spec/config/volumeMounts", | ||
"value": [] | ||
}]' | ||
fi | ||
{orch-cli} patch subscription {prod-operator-subscription} \ | ||
--namespace $SUBSCRIPTION_NAMESPACE \ | ||
--type json \ | ||
--patch '[{ | ||
"op":"add", | ||
"path":"/spec/config/volumes/-", | ||
"value": { | ||
"name":"'$(echo ${CHE_EDITOR_CONCEAL_FILE_NAME%.*})'", | ||
"configMap": { | ||
"name": "'$CHE_EDITOR_CONCEAL_CONFIGMAP_NAME'" | ||
} | ||
} | ||
}, | ||
{ | ||
"op":"add", | ||
"path":"/spec/config/volumeMounts/-", | ||
"value":{ | ||
"name": "'$(echo ${CHE_EDITOR_CONCEAL_FILE_NAME%.*})'", | ||
"subPath":"'$CHE_EDITOR_CONCEAL_FILE_NAME'", | ||
"mountPath": "/tmp/editors-definitions/'$CHE_EDITOR_CONCEAL_FILE_NAME'" | ||
} | ||
}]' | ||
else | ||
{orch-cli} patch deployment {prod-operator} \ | ||
--namespace $OPERATOR_NAMESPACE \ | ||
--type json \ | ||
--patch '[{ | ||
"op":"add", | ||
"path":"/spec/template/spec/volumes/-", | ||
"value": { | ||
"name":"'$(echo ${CHE_EDITOR_CONCEAL_FILE_NAME%.*})'", | ||
"configMap": { | ||
"name": "'$CHE_EDITOR_CONCEAL_CONFIGMAP_NAME'" | ||
} | ||
} | ||
}, | ||
{ | ||
"op":"add", | ||
"path":"/spec/template/spec/containers/0/volumeMounts/-", | ||
"value":{ | ||
"name": "'$(echo ${CHE_EDITOR_CONCEAL_FILE_NAME%.*})'", | ||
"subPath":"'$CHE_EDITOR_CONCEAL_FILE_NAME'", | ||
"mountPath": "/tmp/editors-definitions/'$CHE_EDITOR_CONCEAL_FILE_NAME'" | ||
} | ||
} | ||
]' | ||
fi | ||
---- | ||
|
||
|
||
.Additional resources | ||
|
||
* xref:configuring-editors-definitions.adoc[] | ||
|
||
* xref:configuring-default-editor-definition.adoc[] | ||
|
||
* {editor-definition-samples-link} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
modules/administration-guide/pages/configuring-default-editor-definition.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
:_content-type: PROCEDURE | ||
:description: Configuring default editor | ||
:keywords: administration guide, dashboard, editors | ||
:navtitle: Configuring default editor definition | ||
|
||
[id="configuring-default-editor-definition"] | ||
= Configuring default editor definition | ||
|
||
Learn how to configure {prod-short} default editor definition. | ||
|
||
.Prerequisites | ||
|
||
* An active `{orch-cli}` session with administrative permissions to the {orch-name} cluster. See {orch-cli-link}. | ||
|
||
* `jq`. See link:https://stedolan.github.io/jq/download/[Downloading `jq`]. | ||
|
||
.Procedure | ||
|
||
. Find out the IDs of the available editors: | ||
+ | ||
[source,subs="+quotes,+attributes"] | ||
---- | ||
{orch-cli} exec deploy/{prod-id-short}-dashboard -n {prod-namespace} \ | ||
-- curl -s http://localhost:8080/dashboard/api/editors | jq -r '.[] | "\(.metadata.attributes.publisher)/\(.metadata.name)/\(.metadata.attributes.version)"' | ||
---- | ||
|
||
. Configure the `defaultEditor`: | ||
+ | ||
[source,subs="+quotes,+attributes"] | ||
---- | ||
{orch-cli} patch checluster/{prod-checluster} \ | ||
--namespace {prod-namespace} \ | ||
--type='merge' \ | ||
-p '{"spec":{"devEnvironments":{"defaultEditor": "__<default_editor>__"}}}'# <1> | ||
---- | ||
<1> The default editor for creating a workspace can be specified using either a plugin ID or a URI. The plugin ID should follow the format: `publisher/name/version`. See available editors IDs in the first step. | ||
|
||
.Additional resources | ||
|
||
* xref:configuring-editors-definitions.adoc[] | ||
|
||
* xref:concealing-editors-definitions.adoc[] | ||
|
||
* {editor-definition-samples-link} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...es/limiting-the-number-of-workspaces-that-all-users-can-run-simultaneously.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
:_content-type: PROCEDURE | ||
:description: Limiting the number of workspaces that all users can run simultaneously | ||
:keywords: administration guide, number, workspaces | ||
:navtitle: Limiting the number of workspaces that all users can run simultaneously | ||
:page-aliases: | ||
|
||
[id="limiting-the-number-of-workspaces-that-all-users-can-run-simultaneously"] | ||
= Limiting the number of workspaces that all users can run simultaneously | ||
|
||
By default, all users can run unlimited number of workspaces. You can limit the number of workspaces that all users can run simultaneously. This configuration is part of the `CheCluster` Custom Resource: | ||
|
||
[source,yaml,subs="+quotes"] | ||
---- | ||
spec: | ||
devEnvironments: | ||
maxNumberOfRunningWorkspacesPerCluster: __<running_workspaces_limit>__#<1> | ||
---- | ||
<1> The maximum number of concurrently running workspaces across the entire Kubernetes cluster. | ||
This applies to all users in the system. If the value is set to -1, it means there is | ||
no limit on the number of running workspaces. | ||
|
||
.Procedure | ||
|
||
. Configure the `maxNumberOfRunningWorkspacesPerCluster`: | ||
+ | ||
[source,subs="+quotes,attributes"] | ||
---- | ||
{orch-cli} patch checluster/{prod-checluster} -n {prod-namespace} \ | ||
--type='merge' -p \ | ||
'{"spec":{"devEnvironments":{"maxNumberOfRunningWorkspacesPerCluster": __<running_workspaces_limit>__}}}'# <1> | ||
---- | ||
<1> Your choice of the `__<running_workspaces_limit>__` value. | ||
|
||
.Additional resources | ||
|
||
* xref:using-the-cli-to-configure-the-checluster-custom-resource.adoc[] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters