Skip to content
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

installation guide - namespace per user strategy #825

Merged
merged 3 commits into from
Oct 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,27 +1,63 @@
[id="configuring-namespace-strategies_{context}"]
---
title: Configuring namespace strategies
keywords:
tags: []
sidebar: che_7_docs
permalink: che-7/configuring-namespace-strategies/
folder: che-7/installation-guide
summary:
---

:parent-configuring-namespace-strategies: {context}

[id="configuring-namespace-strategies"]
= Configuring namespace strategies

This paragraph is the procedure module introduction: a short description of the procedure.
NOTE: The term _namespace_ (Kubernetes) is used interchangeably with _project_ (OpenShift).

[discrete]
== Prerequisites
=== One Namespace per Workspace strategy

* A bulleted list of conditions that must be satisfied before the user starts following this assembly.
* You can also link to other modules or assemblies the user must follow before starting this assembly.
* Delete the section title and bullets if the assembly has no prerequisites.
The strategy creates new namespace for each new workspace. Name of new namespace is workspace's id.

[discrete]
== Procedure
To use the strategy, unset or leave empty `CHE_INFRA_KUBERNETES_NAMESPACE` variable on Kubernetes or `CHE_INFRA_OPENSHIFT_PROJECT` variable on Openshift.
[subs="+quotes"]
----
CHE_INFRA_KUBERNETES_NAMESPACE=
----

. Start each step with an active verb.
=== One Namespace for all Workspaces strategy

. Include one command or action per step.
The strategy uses one predefined namespace for all workspaces.

. Use an unnumbered bullet (*) if the procedure includes only one step.
To use the strategy, set the `CHE_INFRA_KUBERNETES_NAMESPACE` variable on Kubernetes or the `CHE_INFRA_OPENSHIFT_PROJECT` variable on Openshift. The value must be name of desired namespace that you want to use.

[discrete]
== Additional resources
.Example
To have all workspaces created in `che-workspaces` namespace, set:
[subs="+quotes"]
----
CHE_INFRA_KUBERNETES_NAMESPACE=che-workspaces
----

* A bulleted list of links to other material closely related to the contents of the procedure module.
* For more details on writing procedure modules, see the link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide].
* Use a consistent system for file names, IDs, and titles. For tips, see _Anchor Names and File Names_ in link:https://github.com/redhat-documentation/modular-docs#modular-documentation-reference-guide[Modular Documentation Reference Guide].

=== One Namespace per User strategy

The strategy isolates each user in their own namespace.

To use the strategy, set the `CHE_INFRA_KUBERNETES_NAMESPACE` variable on Kubernetes or the `CHE_INFRA_OPENSHIFT_PROJECT` variable on OpenShift. The value must contain one or more user identifiers. Currently supported identifiers are `_<username>_` and `_<userid>_`.

.Example
To assign namespace names composed of a `che-ws` prefix and individual usernames (`che-ws-user1`, `che-ws-user2`), set:

[subs="+quotes"]
----
CHE_INFRA_KUBERNETES_NAMESPACE=che-ws-__<username>__
----

[IMPORTANT]
====
Using the _One Namespace per User_ strategy with the `common` PVC strategy only works correctly when the user runs not more than one workspace at a time. To enforce this limit, set:

----
CHE_LIMITS_USER_WORKSPACES_RUN_COUNT=1
----
====