diff --git a/content/en/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md b/content/en/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md index 808d65cc3..152f893b1 100755 --- a/content/en/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md +++ b/content/en/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md @@ -11,24 +11,24 @@ In KubeSphere 3.3, we introduce the GitOps concept, which is a way of implementi This section walks you through the process of deploying an application using a continuous deployment. ## Prerequisites -- You have a workspace, a DevOps project and a user (`project-regular`) invited to the DevOps project with the `operator` role. If they are not ready yet, please refer to [Create Workspaces, Projects, Users and Roles](../../../../quick-start/create-workspace-and-project/). +- You have a workspace, a DevOps project and a user (**project-regular**) invited to the DevOps project with the **operator** role. If they are not ready yet, please refer to [Create Workspaces, Projects, Users and Roles](../../../../quick-start/create-workspace-and-project/). - You need to [enable the KubeSphere DevOps system](../../../../pluggable-components/devops/). ## Import a Code Repository -1. Log in to the KubeSphere console as `project-regular`. In the navigation pane on the left, click **DevOps Projects**. +1. Log in to the KubeSphere console as **project-regular**. In the left-side navigation pane, click **DevOps Projects**. 2. On the **DevOps Projects** page, click the DevOps project you created. -3. In the navigation pane on the left, click **Code Repositories**. +3. In the left-side navigation pane, click **Code Repositories**. 4. On the **Code Repositories** page on the left, click **Import**. -5. In the **Import Code Repository** dialog box, enter the name of code repository, for example, `open-podcasts`, and select a code repository. Optionally, you can set an alias and add description. +5. In the **Import Code Repository** dialog box, enter the name of code repository, for example, **open-podcasts**, and select a code repository. Optionally, you can set an alias and add description. -6. In the **Select Code Repository** dialog box, click **Git**. In **Code Repository URL**, enter the URL of the code repository, for example, `https://github.com/kubesphere-sigs/open-podcasts`, and click **OK**. +6. In the **Select Code Repository** dialog box, click **Git**. In **Code Repository URL**, enter the URL of the code repository, for example, **https://github.com/kubesphere-sigs/open-podcasts**, and click **OK**. {{< notice note >}} @@ -38,35 +38,295 @@ This section walks you through the process of deploying an application using a c ## Create a Continuous Deployment -1. In the navigation pane on the left, click **Continuous Deployments**. +1. In the left-side navigation pane, click **Continuous Deployments**. 2. On the **Continuous Deployments** page, click **Create**. -3. On the **Basic Information** tab, enter a name of the continuous deployment, for example, `open-podcasts`, and choose a code repository. Then, click **Next**. Optionally, you can set an alias and add description. +3. On the **Basic Information** tab, enter a name of the continuous deployment, for example, **open-podcasts**, and choose a code repository. Then, click **Next**. Optionally, you can set an alias and add description. -4. On the **Deployment Settings** tab, choose the cluster and project that the continuous deployment will be deployed. +4. In the **Deployment Location** section of the **Deployment Settings** tab, configure the cluster and project for which the continuous deployment will be deployed. -5. In **Code Repository Settings**, set a branch or tag of the repository and specify the path of the manifest file, for example, `config/default`. +5. In the **Code Repository Settings** section, specify a branch or tag of the repository and the manifest file path. -6. In **Sync Strategy**, you can choose either **Manual Sync** or **Auto Sync**. If you choose **Auto Sync**, select **Prune resources** and **Self-heal** as needed. + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
+
+

Revision

+
+
+
+

The commit ID, branch, or tag of the repository. For example, master, v1.2.0, 0a1b2c3, or HEAD.

+
+
+
+

Manifest File Path

+
+
+
+

The manifest file path. For example, config/default.

+
+
- - **Prune resources**: Automatically deletes resources that are no longer defined in Git. - - **Self-heal**: Always synchronizes the state defined in Git. +6. In the **Sync Strategy** section, select **Auto Sync** or **Manual Sync** as needed. -7. In **Sync Settings**, select the following options as needed: - - **skip schema validation**: Does not validate resources. - - **Auto create project**: Automatically creates a project during synchronization. - - **Prune last**: Deletes resources that no longer exist after all resources have been synchronized and become healthy. - - **Apply out of sync only**: Skips syncing resources that are already in the desired state. + - **Auto Sync**: automatically syncs an application when it detects differences between the desired manifests in Git, and the live state in the cluster. The following table describes the parameters. -8. In **Prune Propagation Policy**, choose a deletion policy: - - **foreground**: Deletes dependents first, and then deletes owners. - - **background**: Deletes owners first, and then deletes dependents. - - **orphan**: Deletes owners while retaining dependents. + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
+
+

Prune resources

+
+
+
+

If checked, it will delete resources that are no longer defined in Git. By default and as a safety mechanism, auto sync will not delete resources.

+
+
+
+

Self-heal

+
+
+
+

If checked, it will force the state defined in Git into the cluster when a deviation in the cluster is detected. By default, changes that are made to the live cluster will not trigger auto sync.

+
+
-9. In **Replace Resource**, decide whether you want to replace resources that already exist. Click **Create**. - - On the **Continuous Deployments** page, you can view the created continuous deployment, as shown in the following table. + - **Manual Sync**: manually triggers application synchronization according to the synchronization options set. The following table describes the parameters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
+
+

Prune resources

+
+
+
+

If checked, it will delete resources that are no longer defined in Git. + By default and as a safety mechanism, manual sync will not delete resources, but mark the resource out-of-sync state.

+
+
+
+

Dry run

+
+
+
+

Preview apply without affecting the cluster.

+
+
+
+

Apply only

+
+
+
+

If checked, it will skip pre/post sync hooks and just run kubectl apply for application resources.

+
+
+
+

Force

+
+
+
+

If checked, it will use kubectl apply --force to sync resources.

+
+
+ +7. In the **Sync Settings** section, configure parameters as needed. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
+
+

Skip schema validation

+
+
+
+

Disables kubectl validation. --validate=false is added when kubectl apply runs.

+
+
+
+

Auto create project

+
+
+
+

Automatically creates projects for application resources if the projects do not exist.

+
+
+
+

Prune last

+
+
+
+

Resource pruning happened as a final, implicit wave of a sync operation, after other resources have been deployed and become healthy.

+
+
+
+

Selective sync

+
+
+
+

Syncs only out-of-sync resources.

+
+
+ +8. In the **Prune Propagation Policy** section, select a policy as needed. + + + + + + + + + + + + + + + + + + + + + + + + + + +
ParameterDescription
+
+

foreground

+
+
+
+

Deletes dependent resources first, and then deletes the owner resource.

+
+
+
+

background

+
+
+
+

Deletes the owner resource immediately, and then deletes the dependent resources in the background.

+
+
+
+

orphan

+
+
+
+

Deletes the dependent resources that remain orphaned after the owner resource is deleted.

+
+
+ +9. In the **Replace Resource** section, specify whether to replace the resources that already exist. + + + + If checked, the resources will be synced by **kubectl replace/create**. By default, the resources will be synced by **kubectl apply**. + + + +10. Click **Create**. The resource you create will appear in the list of continuous deployments. + +## View the Created Continuous Deployment + +1. On the **Continuous Deployments** page, view the created continuous deployment. The following table describes the parameters. @@ -108,11 +368,11 @@ This section walks you through the process of deploying an application using a c
-10. Click icon on the right of the continuous deployment, and you can perform the following: - - **Edit Information**: Edits the alias and description. - - **Edit YAML**: Edits the YAML file. - - **Sync**: Triggers resources synchronization. - - **Delete**: Deletes the continuous deployment. +2. Click icon on the right of the continuous deployment, and you can perform the following: + - **Edit Information**: edits the alias and description. + - **Edit YAML**: edits the YAML file. + - **Sync**: triggers resources synchronization. + - **Delete**: deletes the continuous deployment. {{< notice warning >}} @@ -121,17 +381,17 @@ This section walks you through the process of deploying an application using a c {{}} -11. Click the created continuous deployment to go to its details page, where you can view the synchronization status and result. +3. Click the created continuous deployment to go to its details page, where you can view the synchronization status and result. ## Access the Created Application -1. Go to the project where the continuous deployment resides, in the navigation pane on the left, click **Services**. +1. Go to the project where the continuous deployment resides, in the left-side navigation pane, click **Services**. 2. On the **Services** page on the left, click icon on the right of the deployed application, and click **Edit External Access**. 3. In **Access Mode**, select **NodePort**, and click **OK**. -4. In the **External Access** column, check the exposed port, and access the application by `nodeIP: nodePort`. +4. In the **External Access** column, check the exposed port, and access the application by **nodeIP: nodePort**. {{< notice note >}} Before accessing the service, open the exposed port in security groups. diff --git a/content/zh/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md b/content/zh/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md index 370ae8cdf..20bf9e903 100755 --- a/content/zh/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md +++ b/content/zh/docs/v3.3/devops-user-guide/how-to-use/continuous-deployments/use-gitops-for-continous-deployment.md @@ -12,13 +12,13 @@ KubeSphere 3.3 引入了一种为云原生应用实现持续部署的理念 – ## 准备工作 -- 您需要有一个企业空间、一个 DevOps 项目和一个用户 (`project-regular`),并已邀请此帐户至 DevOps 项目中且授予 `operator` 角色。如果尚未准备好,请参考[创建企业空间、项目、用户和角色](../../../../quick-start/create-workspace-and-project/)。 +- 您需要有一个企业空间、一个 DevOps 项目和一个用户 (**project-regular**),并已邀请此帐户至 DevOps 项目中且授予 **operator** 角色。如果尚未准备好,请参考[创建企业空间、项目、用户和角色](../../../../quick-start/create-workspace-and-project/)。 - 您需要启用 [KubeSphere DevOps 系统](../../../../pluggable-components/devops/)。 ## 导入代码仓库 -1. 以 `project-regular` 用户登录 KubeSphere 控制台,在左侧导航树,点击 **DevOps 项目**。 +1. 以 **project-regular** 用户登录 KubeSphere 控制台,在左侧导航树,点击 **DevOps 项目**。 2. 在右侧的 **DevOps 项目**页面,点击您创建的 DevOps 项目。 @@ -26,10 +26,10 @@ KubeSphere 3.3 引入了一种为云原生应用实现持续部署的理念 – 4. 在右侧的**代码仓库**页面,点击**导入**。 -5. 在**导入代码仓库**对话框,输入代码仓库名称,如 `open-podcasts`,并选择代码仓库。您也可以为代码仓库设置别名和添加描述信息。 +5. 在**导入代码仓库**对话框,输入代码仓库名称,如 **open-podcasts**,并选择代码仓库。您也可以为代码仓库设置别名和添加描述信息。 -6. 在**选择代码仓库**对话框,点击 **Git**,在**代码仓库地址**区域,输入代码仓库地址,如 `https://github.com/kubesphere-sigs/open-podcasts`,点击**确定**。 +6. 在**选择代码仓库**对话框,点击 **Git**,在**代码仓库地址**区域,输入代码仓库地址,如 **https://github.com/kubesphere-sigs/open-podcasts**,点击**确定**。 {{< notice note >}} @@ -43,33 +43,291 @@ KubeSphere 3.3 引入了一种为云原生应用实现持续部署的理念 – 2. 在右侧的**持续部署**页面,点击**创建**。 -3. 在**基本信息**页签,输入持续部署名称,如 `open-podcasts`,并选择上一步创建的代码仓库,您也可以设置别名和添加描述信息,点击**下一步**。 +3. 在**基本信息**页签,输入持续部署名称,如 **open-podcasts**,并选择上一步创建的代码仓库,您也可以设置别名和添加描述信息,点击**下一步**。 4. 在**部署设置**页签,选择持续部署的部署集群和项目。 -5. 在**代码仓库设置**区域,设置代码仓库的分支或标签以及 kustomization 清单文件路径,如 `config/default`。 +5. 在**代码仓库设置**区域,设置代码仓库的分支或标签以及 Kustomization 清单文件路径。 -6. 在**同步策略**区域,您可以选择**手动同步**或**自动同步**。当选择**自动同步**时,会出现**清理资源**和**自恢复**选项,请根据您的实际需要选择。 + + + + + + + + + + + + + + + + + + + + + +
参数描述
+
+

修订版本

+
+
+
+

Git 仓库中的 commit ID、分支或标签。例如,master, v1.2.0, 0a1b2c3HEAD

+
+
+
+

清单文件路径

+
+
+
+

设置清单文件路径。例如,config/default

+
+
- - **清理资源**:自动同步时,自动删除 Git 中不存在的资源。 - - **自恢复**:时刻保证与 Git 中定义的状态同步。 +6. 在**同步策略**区域,根据需要选择**自动同步**或**手动同步**。 + + - **自动同步**:在检测到 Git 仓库中的清单与部署资源的实时状态之间存在差异时,根据设置的同步选项,自动触发应用程序同步。具体参数如下表所示。 + + + + + + + + + + + + + + + + + + + + + + +
参数描述
+
+

清理资源

+
+
+
+

如果勾选,自动同步时会删除 Git 仓库中不存在的资源。不勾选时,自动同步触发时不会删除集群中的资源。

+
+
+
+

自纠正

+
+
+
+

如果勾选,当检测到 Git 仓库中定义的状态与部署资源中有偏差时,将强制应用 Git 仓库中的定义。不勾选时,对部署资源做更改时不会触发自动同步。

+
+
+ + - **手动同步**:根据设置的同步选项,手动触发应用程序同步。具体参数如下表所示。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数描述
+
+

清理资源

+
+
+
+

如果勾选,同步会删除 Git 仓库中不存在的资源。不勾选时,同步不会删除集群中的资源,而是会显示 out-of-sync

+
+
+
+

模拟运行

+
+
+
+

模拟同步,不影响最终部署资源。

+
+
+
+

仅执行 Apply

+
+
+
+

如果勾选,同步应用资源时会跳过 pre/post 钩子,仅执行 kubectl apply

+
+
+
+

强制 Apply

+
+
+
+

如果勾选,同步时会执行 kubectl apply --force

+
+
-7. 在**同步设置**区域,按照实际需要选择以下设置项: +7. 在**同步设置**区域,根据需要设置同步相关参数。 - - **跳过规范校验**:不校验资源规范性。 - - **自动创建项目**:在同步的过程中,自动创建项目。 - - **最后清理**:直到所有的资源都已经同步且处于健康状态才删除不存在的资源。 - - **仅应用未同步**:仅应用未同步的资源。 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
参数描述
+
+

跳过规范校验

+
+
+
+

跳过 kubectl 验证。执行 kubectl apply 时,增加 --validate=false 标识。

+
+
+
+

自动创建项目

+
+
+
+

在项目不存在的情况下自动为应用程序资源创建项目。

+
+
+
+

最后清理

+
+
+
+

同步操作时,其他资源都完成部署且处于健康状态后,再清理资源。

+
+
+
+

选择性同步

+
+
+
+

仅同步 out-of-sync 状态的资源。

+
+
-8. 在**依赖清理策略**区域,选择一个清理策略: - - **foreground**:先删除附属资源,再删除主资源。 - - **background**:先删除主资源,再删除附属资源。 - - **orphan**:删除主资源之后,附属资源仍然存在。 +8. 在**依赖清理策略**区域,根据需要选择依赖清理策略。 -9. 在**替换资源**区域,选择是否需要替换已存在的资源,点击**创建**。 + + + + + + + + + + + + + + + + + + + + + + + + + +
参数描述
+
+

foreground

+
+
+
+

先删除依赖资源,再删除主资源。

+
+
+
+

background

+
+
+
+

先删除主资源,再删除依赖资源。

+
+
+
+

orphan

+
+
+
+

删除主资源,留下依赖资源成为孤儿。

+
+
+ +9. 在**替换资源**区域,选择是否需要替换已存在的资源。 + + {{< notice note >}} + + 如果勾选,将执行 **kubectl replace/create** 命令同步资源。不勾选时,使用 **kubectl apply** 命令同步资源。 + + {{}} - 您可以在**持续部署**页面上查看到已创建的持续部署的信息,如下表所示: +10. 点击**创建**。资源创建完成后将显示在持续部署列表中。 + +## 查看已创建的持续部署信息 + +1. 在**持续部署**页面上查看到已创建的持续部署信息。具体参数如下表所示。 @@ -111,11 +369,11 @@ KubeSphere 3.3 引入了一种为云原生应用实现持续部署的理念 –
-10. 点击持续部署右侧的 icon,您可以执行以下操作: - - 编辑信息:编辑别名和描述信息。 - - 编辑 YAML:编辑持续部署的 YAML 文件。 - - 同步:触发资源同步。 - - 删除:删除持续部署。 +2. 点击持续部署右侧的 icon,您可以执行以下操作: + - **编辑信息**:编辑别名和描述信息。 + - **编辑 YAML**:编辑持续部署的 YAML 文件。 + - **同步**:触发资源同步。 + - **删除**:删除持续部署。 {{< notice warning >}} @@ -123,7 +381,7 @@ KubeSphere 3.3 引入了一种为云原生应用实现持续部署的理念 – {{}} -11. 点击已创建的持续部署进入详情页面,可以查看同步状态和同步结果。 +3. 点击已创建的持续部署进入详情页面,可以查看同步状态和同步结果。 ## 访问已创建的应用