Skip to content

Commit

Permalink
Merge pull request #825 from sparkoo/namespaceStrategies
Browse files Browse the repository at this point in the history
installation guide - namespace per user strategy
  • Loading branch information
themr0c authored Oct 1, 2019
2 parents 0926f58 + 176dc0c commit 3311ea1
Showing 1 changed file with 53 additions and 17 deletions.
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
----
====

0 comments on commit 3311ea1

Please sign in to comment.