From 40b554768c5d71e6ffef9ebfc70adab02c2b8134 Mon Sep 17 00:00:00 2001 From: hongming Date: Tue, 11 May 2021 11:30:21 +0800 Subject: [PATCH] Update workspace management docs Signed-off-by: hongming --- ...netes-namespace-to-kubesphere-workspace.md | 31 +++---------------- content/zh/docs/faq/notices/_index.md | 6 ++++ .../zh/docs/faq/notices/delete-workspace.md | 31 +++++++++++++++++++ .../what-is-workspace.md | 5 +-- 4 files changed, 43 insertions(+), 30 deletions(-) create mode 100644 content/zh/docs/faq/notices/_index.md create mode 100644 content/zh/docs/faq/notices/delete-workspace.md diff --git a/content/zh/docs/faq/access-control/add-kubernetes-namespace-to-kubesphere-workspace.md b/content/zh/docs/faq/access-control/add-kubernetes-namespace-to-kubesphere-workspace.md index 1dd937480..74873301a 100644 --- a/content/zh/docs/faq/access-control/add-kubernetes-namespace-to-kubesphere-workspace.md +++ b/content/zh/docs/faq/access-control/add-kubernetes-namespace-to-kubesphere-workspace.md @@ -20,34 +20,13 @@ Kubernetes 命名空间即 KubeSphere 项目。如果您不是在 KubeSphere 控 首先,创建一个示例 Kubernetes 命名空间,以便稍后将其添加至企业空间。 -1. 执行以下命令创建一个名为 `demo-namespace` 的文件。 +执行以下命令创建一个名为 `demo-namespace` 的命名空间。 - ```bash - vi demo-namespace.json - ``` +```bash +kubectl create ns demo-namespace +``` -2. 在该文件中输入以下内容然后保存。 - - ```json - { - "apiVersion": "v1", - "kind": "Namespace", - "metadata": { - "name": "demo-namespace", - "labels": { - "name": "demo-namespace" - } - } - } - ``` - -3. 创建命名空间。 - - ```bash - kubectl create -f demo-namespace.json - ``` - - 有关创建 Kubernetes 命名空间的更多信息,请参见[命名空间演练](https://kubernetes.io/zh/docs/tasks/administer-cluster/namespaces-walkthrough/)。 +有关创建 Kubernetes 命名空间的更多信息,请参见[命名空间演练](https://kubernetes.io/zh/docs/tasks/administer-cluster/namespaces-walkthrough/)。 ## 添加命名空间至 KubeSphere 企业空间 diff --git a/content/zh/docs/faq/notices/_index.md b/content/zh/docs/faq/notices/_index.md new file mode 100644 index 000000000..6e9a30cf9 --- /dev/null +++ b/content/zh/docs/faq/notices/_index.md @@ -0,0 +1,6 @@ +--- +title: "注意事项" +keywords: 'Kubernetes, KubeSphere, 注意事项' +description: '使用过程中的一些注意事项' +weight: 16250 +--- diff --git a/content/zh/docs/faq/notices/delete-workspace.md b/content/zh/docs/faq/notices/delete-workspace.md new file mode 100644 index 000000000..2bcdce538 --- /dev/null +++ b/content/zh/docs/faq/notices/delete-workspace.md @@ -0,0 +1,31 @@ +--- +title: "删除企业空间" +keywords: "Kubernetes, KubeSphere, 删除企业空间" +description: "删除企业空间" +linkTitle: "删除企业空间" +weight: 16251 +--- + +## 删除企业空间需要注意的事项 + +在 KubeSphere 中,可以通过企业空间(workspace)对项目(namespace)进行分组管理,企业空间下项目的生命周期会受到企业空间的影响。 + +企业空间删除之后,企业空间下的项目及资源也同时会被销毁。在删除企业空间时需要多加注意,务必确认是否需要对企业空间下所有的项目及资源进行释放。 + +通过 kubectl 直接操作企业空间资源对象时由于没有风险提示,务必注意相关风险。 + +### 从企业空间中移除项目 + +如果你在删除企业空间时,需要保留一些项目,或者是希望将项目与企业空间进行解绑,可以通过一下命令进行操作 + +``` +kubectl label ns kubesphere.io/workspace- && kubectl patch ns -p '{"metadata":{"ownerReferences":[]}}' --type=merge +``` + +{{< notice note >}} + +移除与企业空间关联的 label 并移除 ownerReferences。 + +{{}} + +你可以重新将项目[添加至其他的的企业空间](../../access-control/add-kubernetes-namespace-to-kubesphere-workspace/#添加命名空间至-kubesphere-企业空间) \ No newline at end of file diff --git a/content/zh/docs/workspace-administration/what-is-workspace.md b/content/zh/docs/workspace-administration/what-is-workspace.md index 3ae941ba4..064089db7 100644 --- a/content/zh/docs/workspace-administration/what-is-workspace.md +++ b/content/zh/docs/workspace-administration/what-is-workspace.md @@ -60,9 +60,6 @@ weight: 9100 {{< notice warning >}} - 企业空间删除后将无法恢复,并且企业空间下的资源也同时会被销毁。 + [企业空间删除后将无法恢复](../../faq/notices/delete-workspace),并且企业空间下的资源也同时会被销毁。 {{}} - - -