mirror of
https://github.com/kubesphere/website.git
synced 2025-12-26 00:12:48 +00:00
Update workspace management docs
Signed-off-by: hongming <talonwan@yunify.com>
This commit is contained in:
parent
e8628f03f1
commit
40b554768c
|
|
@ -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 企业空间
|
||||
|
||||
|
|
|
|||
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
title: "注意事项"
|
||||
keywords: 'Kubernetes, KubeSphere, 注意事项'
|
||||
description: '使用过程中的一些注意事项'
|
||||
weight: 16250
|
||||
---
|
||||
|
|
@ -0,0 +1,31 @@
|
|||
---
|
||||
title: "删除企业空间"
|
||||
keywords: "Kubernetes, KubeSphere, 删除企业空间"
|
||||
description: "删除企业空间"
|
||||
linkTitle: "删除企业空间"
|
||||
weight: 16251
|
||||
---
|
||||
|
||||
## 删除企业空间需要注意的事项
|
||||
|
||||
在 KubeSphere 中,可以通过企业空间(workspace)对项目(namespace)进行分组管理,企业空间下项目的生命周期会受到企业空间的影响。
|
||||
|
||||
企业空间删除之后,企业空间下的项目及资源也同时会被销毁。在删除企业空间时需要多加注意,务必确认是否需要对企业空间下所有的项目及资源进行释放。
|
||||
|
||||
通过 kubectl 直接操作企业空间资源对象时由于没有风险提示,务必注意相关风险。
|
||||
|
||||
### 从企业空间中移除项目
|
||||
|
||||
如果你在删除企业空间时,需要保留一些项目,或者是希望将项目与企业空间进行解绑,可以通过一下命令进行操作
|
||||
|
||||
```
|
||||
kubectl label ns <namespace> kubesphere.io/workspace- && kubectl patch ns <namespace> -p '{"metadata":{"ownerReferences":[]}}' --type=merge
|
||||
```
|
||||
|
||||
{{< notice note >}}
|
||||
|
||||
移除与企业空间关联的 label 并移除 ownerReferences。
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
你可以重新将项目[添加至其他的的企业空间](../../access-control/add-kubernetes-namespace-to-kubesphere-workspace/#添加命名空间至-kubesphere-企业空间)
|
||||
|
|
@ -60,9 +60,6 @@ weight: 9100
|
|||
|
||||
{{< notice warning >}}
|
||||
|
||||
企业空间删除后将无法恢复,并且企业空间下的资源也同时会被销毁。
|
||||
[企业空间删除后将无法恢复](../../faq/notices/delete-workspace),并且企业空间下的资源也同时会被销毁。
|
||||
|
||||
{{</ notice >}}
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue